Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Flat Sequence Structures...am I wrong?

This is more a general question : being fairly new to LabView and having only done a handfull of projects I am starting to question my tactics.
I primarily am controlling test equipment via gpib utilizing visa. Invariably I find my vi's are all constructed from flat sequence structures. My vi requirements have bascially been the same. Do some function on 1 piece of equipment (lets say output a signal from a generator or a power supply etc) and capture that signal via a scope or meter etc and then write to a file or display the waveform on a graph. I find flat sequences allow me to control what happens when, though I am wondering if this is infact correct. As my vi's end up difficult to view and I find myself having to scroll continuously on my block diagrams.
This tells me I am perhaps not structuring my programs correctly. Any comments?
0 Kudos
Message 1 of 3
(2,810 Views)
The sequence structure does allow you to control the order of execution but just wiring error in/error out connections does the same thing. If you're connecting them and using the sequence structure, then the sequence structure is redundant and just adds some overhead. A long chain of functions with error in/error out connections might still take up a lot of diagram space so you want to consider combining some into subVIs and reducing diagram size that way. A great way to reduce diagram size is to use a state diagram architecture. There are shipping examples and you can also search the forum and NI Zone for other examples. Basically a case statement inside a while loop, the state machine gives you great flexibility in determining the order of execution and reacting to different conditions. Note that all of your code is not visible. To view everything, you would still need to click through all of the different cases. I don't mind this myself and would rather do this than scroll back and forth but that's a choice you'll have to make yourself.
0 Kudos
Message 2 of 3
(2,809 Views)
An intermediate solution you can adopt even without changing the structure of your programs is to use a stacked sequence structure instead of a flat one. This will mean you have to click through the different frames but like Dennis said, this is easier than scrolling back and forth.

___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(2,792 Views)