Hi Dojo
I have a http device that can receive commands.
When I send a command to change a parameter and I get confirmation that the command is received. The device can take up to a few seconds to process that request and change its parameter.
Now the procedure to send a command is.
1. Send the command.
2. Send a get request to get the new values
So when I send my get parameter after the command I still get the old value back, causing the table to be out of sync.
How should I poll this parameter, to get the correct value?
Hi Arne, when the device doesn't have a blocking call that only returns when the new data is ready, I don't think there are many alternatives.
What you could try is to put the get requests also in a faster timer, and use a condition on that group. The condition is by default disabled. After doing set, you could then use that group to temporary poll new data faster by activating the condition. When you see that the data has been updated, you can stop the fast polling again.
Hi Tom, in this case you could also use a “get after set” buffer (for example in a queue in a QAction) and use a 1sec timer to evaluate if any item in that buffer needs to be processed. You would have to add some functionality though to ensure you limit the amount of retries as the value could also never change (set not accepted). However, question is if this is worth the effort.
I developed a NuGet package that optimizes polling requests by temporarily speeding up their timer, until a change is detected or until a set number of retries is exceeded. This can greatly enhance the efficiency and responsiveness of applications that rely on frequent polling.
The Nuget package is called “Skyline.DataMiner.Utils.GetAfterSet.Protocol” and can be found on nuget.org.
The web interface polls the data of the current page every second, but to implement this in DataMiner seems like a bit too much overhead.