LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop error handling

Hi,

 

I've been using timed loops and am confused about the purpose/intention of the error nodes in the right data node. I mistakenly thought that in a single frame timed loop the error I/O on the LH and RH data nodes behaved as a shift register - the context help says they propagate errors through the structure.

 

After much hair pulling I read a little deeper and experimented a little. It seems that to understand the idea of the TL error nodes it has to be imagined as a single frame TL sequence structure where an error at the RH data node causes the next frame to execute un-timed (immediately) and so on untill the error reaches the last RH error node where it will abort the structure. This makes sense in a multi frame TL as it prevents the propagation of the error getting held up by the sequence timing

 

However, I was using just a timed loop (single frame) with a case structure (simple state machine) inside for error handling and using the TL to manage loop priorities rather than timing. In the case of a single frame TL case it makes no sense for the RH data node to abort the loop if it receives an error. Still keeping with the logic of the implementation in a multiframe case I think it would make sense for it to cause the next iteration of the loop to execute un-timed rather than considering it the 'last RH node' and aborting.

 

If this isn't logical then maybe the deault for a single frame TL should not show the LH and RH data nodes?

 

If anyone can explain how the LH and RH error terminals should be used in a TL I would be grateful.

 

 

Many thanks,

Steve.

0 Kudos
Message 1 of 2
(3,365 Views)

It is common to build subvi's with an error case structure as the outermost structure Error in T executes the error case and usually just passes the error in to error out.  Common practice because and error means something is wrong so your code may not act correctly. 

 

Think of the TL error in - out the same way.  if an error is passed in the Error case (Null Code) is executed.  They are mearly there to reduce the number of error cases that you would need to wrap the loop with and wrap into the loop to get the same

"If error Return error else do something useful" functionality that we all know and love.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 2
(3,336 Views)