LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a timeout fail safe in QSM-PC

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...

  1. Resume operation (reset watchdog)
  2. Abort operation (immediately return to idle state)
  3. Generate report (gather data, export then return to idle state)

---

 

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...

  • If we stay in the state that triggered the timeout to better resume operation / generate report, how do we process the Timeout state?
  • If we exit the faulty state, we should implement a data buffer logic in order to be able to retrieve it later, workable. So now...
  • How do we exit a state that has timed out if calculations are stalled and no error is triggered?!

 

Attached is the template.

 

Thank you for your help!

 

 

Download All
0 Kudos
Message 1 of 3
(2,156 Views)

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. 


  1. https://forums.ni.com/t5/Example-Programs/UI-Producer-Loop-with-State-Machine-Consumer-Loop-Using-La...
  2. https://forums.ni.com/t5/LabVIEW/What-value-for-a-timeout-of-an-event-driven-state-machine/td-p/3827...
  3. https://forums.ni.com/t5/LabVIEW/Timeout-event-case-how-stop-it/td-p/3821105

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. 

0 Kudos
Message 2 of 3
(2,109 Views)

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 😉

0 Kudos
Message 3 of 3
(2,096 Views)