LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Machine template

For the code that I normally develop for test rigs, I was toying with the idea of putting together a basic template kind of thing. A kind off State Machine it is and incorporates some ideas recently given by Altenbach (Thanks!) in this forum. This has all the standard AI, AO, DI and DO functions ; a time delay function; Armed with these writing code for a full machine with case transistions based on real time events must not be a problem. I have attached it for viewing.

I have few queries :

1. In the wiring there are quite a few hidden ones behind the case struct. I know its bad, but alternatives are minimum and if really have to make them visible, then lots of detour wiring needed. Which is better ?

2. Can this be made into a sub VI ? And is there any benefit to get out of that ? I somehow can't figure out how as all of the real time code will go inside the case struct.

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 2
(2,502 Views)
More than one error stream is unusual. I would have just one error stream and then add states for an error handler. This way you could examine the error and terminate, if needed, or log or ignore.

Hidden wires are frowned upon. I would put all of the shift registers at the top of the loop and have the DAQ ref nums come down through the top as vertical wires. If the code is written with your discipline, then you know that there is no funny business going on in the hidden wiring, it is just going straight across, but other people who read your code do not know your discipline, hence the style rule.
0 Kudos
Message 2 of 2
(2,492 Views)