LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control access to shared variables by IP address or similar

I am switching from a setup that uses multiple computers to control a bunch of valves, heaters, and other simples devices to a cRIO.  One of the benefits of the cRIO is that I can much more easily allow multiple computers to control a single valve without changing any hardware.  I have set up the cRIO so that it publishes shared variables that link to the cRIO variables that represent the DO lines used for valve control.  However, I worry that someone will accidentally access a valve while another computer is using it and screw up one of our high-level processes.

 

Is there an easy way that I can simply turn on and off access to individual shared variables according to the IP address of the computer trying to access them?  The closest option I have come up with so far is to create more shared variables that lock and unlock the ones that represent valves, which I could then use to control access, but I am considering many different possible combinations of valves that a given computer might need to access, so this seems tedious.  It would be much better if I could just make a vi on the computer closest to the cRIO in which I can push a button to open up a given set of valves to a given computer.

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

Hi Steve,

 

I researched this scenario and it seems like blocking specific IPs will not be possible since the variable are on the open network any computers on the network will be able to access the variables. You could try using TCP and use handshaking so that only one computer can write at a time.

 

Regards

Arham H
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,396 Views)

Thanks for your response.  I don't think I can do that at the variable level, so I think the least complicated way for me to set this up and still allow multiple computers to write to different variables at the same time is to use multiple dummy variables for the ones that will be controlled by mutliple computers and then have another variable that tells the code which one to write to the actual valve control variable using a conditional statement.

0 Kudos
Message 3 of 3
(2,392 Views)