How does the Poll Scheduler work in any given Niagara Driver
The Poll Scheduler is a sophisticated component within Niagara 4 drivers that manages the timing, sequencing, and coordination of device polling operations. It works in conjunction with the Tuning Policy to optimise communication efficiency and ensure reliable data collection from field devices.
Overview
The Poll Scheduler is responsible for:
- Sequencing Polls: Determining the order in which devices are polled
- Timing Coordination: Managing when polls occur to avoid conflicts
- Load Balancing: Distributing polling load across time to prevent network congestion
- Priority Management: Handling high-priority devices before lower-priority ones
- Error Recovery: Rescheduling polls after communication failures
How Poll Scheduling Works
Basic Scheduling Mechanism
- Policy Configuration: The Tuning Policy defines the base poll interval for the driver
- Scheduler Initialisation: When the driver starts, the scheduler creates a polling schedule
- Device Registration: Each device connected to the driver is registered with the scheduler
- Schedule Generation: The scheduler creates a polling sequence based on device priorities and intervals
- Execution: The scheduler executes polls according to the generated schedule
Scheduling Algorithms
The Poll Scheduler uses several algorithms to optimise polling:
Round-Robin Scheduling
- Devices are polled in a circular sequence
- Ensures fair distribution of polling time
- Prevents any single device from monopolising the driver
Priority-Based Scheduling
- High-priority devices are polled more frequently
- Critical devices receive immediate attention
- Lower-priority devices are polled when resources are available
Adaptive Scheduling
- Adjusts polling frequency based on device response times
- Reduces polling for slow-responding devices
- Increases polling for fast-responding devices
Step-by-Step Configuration
Step 1: Access Driver Configuration
- Open Niagara Workbench
- Navigate to your Station
- Expand the Drivers folder
- Right-click on the target driver
- Select Properties
Step 2: Navigate to Poll Scheduler Settings
- In Driver Properties, locate the Poll Scheduler section
- This may be under Advanced or Scheduling tab
- Review current scheduler configuration
Step 3: Configure Scheduler Mode
Select the scheduling mode:
- Automatic: Driver automatically manages scheduling (recommended)
- Manual: Manual configuration of polling sequences
- Custom: Custom scheduling based on specific requirements
Step 4: Set Device Priorities
Configure priority levels for devices:
- Navigate to Devices under the driver
- For each device, set priority:
- High: Critical devices requiring frequent updates
- Normal: Standard devices with regular polling
- Low: Non-critical devices with infrequent polling
Step 5: Configure Poll Intervals
Set polling intervals per device or device group:
- Select a device or device group
- Set Poll Interval (e.g., 5s, 30s, 1m, 5m)
- Configure Poll Offset to stagger polling times
- Repeat for all devices
Step 6: Configure Scheduler Parameters
Set scheduler-specific parameters:
- Maximum Concurrent Polls: Number of simultaneous polls (typically 1-5)
- Poll Queue Size: Maximum number of queued polls
- Scheduler Resolution: Minimum time between scheduled polls (typically 1 second)
Step 7: Enable Adaptive Scheduling (Optional)
If supported by the driver:
- Enable Adaptive Scheduling
- Configure Adaptation Rate: How quickly scheduler adapts (typically 0.1-0.5)
- Set Minimum Interval: Smallest allowed poll interval
- Set Maximum Interval: Largest allowed poll interval
Step 8: Apply Configuration
- Click OK to save configuration
- Restart the driver if required
- Monitor scheduler performance
Understanding Scheduler Behaviour
Poll Sequence Generation
The scheduler generates polling sequences based on:
- Device Priority: High-priority devices scheduled first
- Poll Intervals: Devices with shorter intervals polled more frequently
- Poll Offsets: Offsets prevent simultaneous polling of multiple devices
- Network Constraints: Scheduler considers network bandwidth and latency
Dynamic Adjustments
The scheduler dynamically adjusts polling:
- Response-Based: Adjusts based on device response times
- Error-Based: Reduces polling frequency for devices with errors
- Load-Based: Adjusts to prevent network congestion
- Time-Based: Adapts to time-of-day patterns if configured
Conflict Resolution
When scheduling conflicts occur:
- Priority Resolution: Higher-priority polls take precedence
- Queue Management: Conflicting polls are queued for later execution
- Resource Allocation: Scheduler allocates resources based on availability
Integration with Tuning Policy
The Poll Scheduler works closely with the Tuning Policy:
- Policy Sets Base Interval: Tuning Policy defines the base poll interval
- Scheduler Manages Execution: Poll Scheduler determines actual execution timing
- Coordination: Both components coordinate to optimise performance
The Tuning Policy provides the framework, while the Poll Scheduler handles the execution details.
Best Practices
Scheduler Configuration
- Use Automatic Mode: Let the driver manage scheduling automatically when possible
- Set Appropriate Priorities: Assign priorities based on device importance
- Stagger Poll Times: Use poll offsets to prevent simultaneous polling
- Monitor Performance: Regularly review scheduler performance metrics
Device Organisation
- Group Similar Devices: Group devices with similar requirements
- Balance Load: Distribute polling load evenly across time
- Consider Network Topology: Account for network structure in scheduling
Performance Optimisation
- Limit Concurrent Polls: Restrict concurrent polls to prevent network congestion
- Use Adaptive Scheduling: Enable adaptive scheduling for variable network conditions
- Review Intervals: Regularly review and adjust poll intervals based on needs
Troubleshooting
Polls Not Executing
If polls are not executing:
- Check Scheduler Status: Verify scheduler is enabled and running
- Review Device Status: Ensure devices are online and accessible
- Check Poll Intervals: Verify intervals are not set too high
- Review Driver Logs: Check for scheduler-related errors
Uneven Polling Distribution
If some devices are polled more frequently than others:
- Review Priorities: Check device priority settings
- Check Intervals: Verify poll intervals are configured correctly
- Review Offsets: Ensure poll offsets are properly configured
- Monitor Scheduler: Use scheduler monitoring tools to identify issues
Network Congestion
If polling causes network congestion:
- Reduce Concurrent Polls: Lower maximum concurrent polls setting
- Increase Intervals: Increase poll intervals for non-critical devices
- Stagger Polls: Use larger poll offsets to spread polling over time
- Review Network: Check network capacity and configuration
Slow Response Times
If scheduler response is slow:
- Reduce Queue Size: Lower poll queue size to prevent backlog
- Increase Resolution: Increase scheduler resolution for faster execution
- Review Priorities: Ensure high-priority devices are scheduled first
- Optimise Intervals: Adjust poll intervals based on actual needs
Monitoring Scheduler Performance
Scheduler Metrics
Monitor these key metrics:
- Poll Execution Rate: Number of polls executed per unit time
- Average Poll Latency: Time between scheduled and actual poll execution
- Queue Depth: Number of polls waiting in queue
- Error Rate: Percentage of failed polls
- Device Coverage: Percentage of devices polled within their intervals
Performance Analysis
Regularly analyse scheduler performance:
- Review Metrics: Check scheduler metrics regularly
- Identify Bottlenecks: Find devices or times causing issues
- Optimise Configuration: Adjust configuration based on analysis
- Document Changes: Keep records of configuration changes
Related Topics
- How does the Tuning Policy work in any given Niagara Driver
- How to calculate the quantity of Global Capacity Points consumed in a Station
Additional Resources
- Niagara 4 Driver Architecture Guide
- Poll Scheduler Best Practices
- Network Optimisation for Building Automation Systems