Open skykep opened 3 years ago
I would say yes. Write your own function that performs a read based upon the scan rate timeout you wish to have.
I meant natively rather than using setInterval to perform individual reads, which is less efficient than subscriptions.
I wouldn't use a setInterval. track the last time each tag was read and then get the oldest one most needing to be read. Add several to a tag group and read the tag group is also an option. A feature request for this library may be to add a scan rate to tag groups.
while( true ) {
await getNextTagThatIsAgedEnough()
await readThatTag()
await extraDelayWhenNoTags()
}
A feature request for this library may be to add a scan rate to tag groups.
Great idea. Appreciate your insight.
I always just read tag groups in a loop with a delay, similar to what Nate shows. But I do end up setting up different controllers for each tag group and even run each controller on its own server. Usually 4 total for my standard HMI framework. But some of that may be specific for my application.
Current Behavior
Expected Behavior
Possible Solution (Optional)
Context
Steps to Reproduce (for bugs only)
1. 2. 3. 4.
Your Environment
npm list
- e.g. 1.0.6):node --version
- e.g. 9.8.0):