Hi:
We're still qualifying the changes, but I believe I finally have the elapsed timer working. I was able to run overnight with the changes without any crashes, which is something I could not do before.
I tried several things to get it working. In the end, I discovered I could not get any variables within the Runstate context from the callback. With the callback being called every second, and with numerous executions being in the foreground at any time, it seems that the Runstate context does not exist 100% of the time. Even with PropertyExist checks before getting values, the operator interface eventually crashes when trying to get a value that does not appear to exist (though it did the line before...)!
So here is a summary of what I ended up doing:
1. From the batch and parallel model, send a UI message to set progress text to include socket number (we were doing this already).
2. From the batch and parallel model, immediately before the Mainsequence call, send a custom UI message to the operator interface to start the timer for the given socket index
--> operator interface receives the UI message, determines start seconds, and assigns this value to a global array value indexed by socket number
3. Elapsed timer callback every second
--> determine socket number from progress text (if socket number exists)
--> determine start seconds from global array (if start seconds has been assigned yet)
--> determine current seconds, calculate/update elapsed timer
4. From the batch and parallel model, immediately after the Mainsequence
call, send a custom UI message to the operator interface to stop the
timer for the given socket index
--> operator interface receives the UI message, assigns 0 to a global array value indexed by socket
number
Appears to work - and no Runstate calls required in the callback.
If anyone can tell me why the RunState calls appear to not be reliable from the callback, please let me know!
Thanks for your help.
Cheers,
Dave