Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

passing visa session to frames in stacked sequence

At the moment i am passing the Error out and VISA session values to several frames in a stacked sequence structure.  I am using sequence locals to make one large loop in which the error and VISA is passed frame 0 to 1 to 2...  However, this ends up becoming very messy with wires from the output of each frame back around to the input of the next frame.  Is there a way to do this more elegantly withough the messy sequence locals?  I presume i dont understand custom error handlers well but i havent found any good examples of this yet.

Regards,
Bryan
0 Kudos
Message 1 of 2
(2,943 Views)
The simple answer is that you don't need to use a sequence structure at all. Just lay out all of your functions horizontally and connect your error in/error out and VISA connections between them. In most cases, the sequence structure just serves to hide your code without providing any real advantage. If you need something a bit more sophisticated, the the state machine architecture is much better. There are a couple of shipping examples and you can also search the Developer Zone for more. Bascially a state machine is a case statement inside a while loop. A shift register or a queue wired to the case selector determines which case will execute. 
0 Kudos
Message 2 of 2
(2,941 Views)