LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Builder 3.5: Exchange data between states

Hello,
 
I'm using Vision Builder 3.5 and I built a state machine in the State Diagram window. In the first state, I open a TCP connection, in the second state I do an inspection and write the results via TCP IP and in the last state I close the connection. 
 
I need to have the refnum of the connection in the first state and use it for the other states. How can I do that? I know I can exchange data in the same state, but how can I do that between states?
 
 
Thank you very much
 
Stephanie
0 Kudos
Message 1 of 4
(2,427 Views)
Hi Stephanie,

There are a few ways to pass data between states.  But the recommended way is with Shift Registers. 

Check out the Example Finder for some exercises that will help you understand how they work. 

Good luck with your project.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 2 of 4
(2,418 Views)
Hi Patrick,
 
I think you misunderstand what was my problem. It's not that kind of state machine (with a while loop, few cases and shift register). It's a state machine in Vision Builder (see the picture).  
 
So in each state I have a "Run LabVIEW VI". The first VI (in the first state) is the an open connection and I'd like to have the refnum assigned in that state for the other state (inspect and deconnection), because I'm going to read and deconnect the TCP network connection.
 
Thank you for helping
 
Stephanie
0 Kudos
Message 3 of 4
(2,415 Views)
Hi again Stephanie,

I guess I thought the State Machine "builder" in Vision Builder would be similar to using the State Diagram Toolkit.  (Since the diagram appears almost identical) 

I do have Vision Builder 3.0.1   But so far I've only ever played with it a little. 

In the Additional Tools tab, there is a Set Global Variable function.  You should be able to use this function to pass any data you need.   At first glance, it appears to be the only choice for passing data around within Vision Builder Code. 

Another option would be to us the "Migrate Inspection to LabVIEW" function and then manually add the code you need.  However that assumes you have LabVIEW. 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 4
(2,406 Views)