03-20-2019 08:00 PM - edited 03-20-2019 08:19 PM
Hello there,
Trying to add a generic timeout function to our QSM-PC template and I'm having a hard time to wrap my head around the dataflow and what needs to be done to make that happen.
The goal is to notify the user and pause/abort the slave loop if the producer loop detects that no change of state has happened within the set timeout.
Then, ideally the user would have the choice to...
---
Is that possible at all?
I have thought about programming a timeout function in all SubVIs executed within a certain task, but according to DRY principles, I'm wondering if there wouldn't be a a more clever way to program a "catch-all" timeout instead of adding the same logic over and over in multiple subvis.
In order to maintain the data already processed (to resume operation or generate report), I think we should not exit the current state. However, if we cannot exit the current state, I'm not sure how to process the actual Timeout state and my tests has been unsuccessful so far.
Here's a quick mindmap of the thought process...
Attached is the template.
Thank you for your help!
03-21-2019 04:24 PM
Hi TBM,
I've found a few examples that may not be 100% relevant but can serve as a good starting point when considering things like this.
I was going to suggest using another event structure to check for timeout but that is generally not considered best practice. Check those links out and see if there's any relevancy there. Link #1 is an example of a UI driven producer loop, which has some commonality with what you're asking about. This may be a good "best practices" question for NI phone support, if you have SSP.
03-22-2019 07:36 PM
Thank you for the links walker.p,
The first one relates to the same kind of producer/consumer architecture we use but unfortunately did not provide any elements of solution as to how to abort calculation in a stalled state.
While there is an "Emergency Stop" configured, it still waits until the loop has completed to fire (which would never happen if the process is stalled).
The other two links are not using a PC architecture and did not provide information I could extrapolate to my situation I'm afraid.
Unfortunately I don't have access to phone support so I'll have to keep digging.
It seems so simple to explain yet I can't wrap my head around how to achieve it.
Hopefully with a little persistence I'll find a way 😉