LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using shared variables for arbitrating shared access devices

Hi all,
 
I'm trying to find out if shared variables are a good candidate for arbitrating shared access devices.
 
The system architecture involves two PC's networked to several TCP/IP devices. Each TCP/IP device only allows a single connection from a client PC.
 
I was hoping to use a shared variable to indicate that a particular TCP/IP device is currently 'locked' and being controlled by the first PC.  The status of this shared variable could then be read by the second PC to disable control areas of its front panel accordingly.
 
Unfortunately there is a chance that one of the PC's (could be either one) may not be running, so I'm not sure how to control the deployment of the shared variable.  Also the IP addresses of the workstations may be changed when the system is deployed.
 
Is is possible to search for the existance of a shared variable or create a new shared variable if required at run-time?
 
Best regards
 
Phill
0 Kudos
Message 1 of 2
(2,439 Views)
Hi Phill,

The easiest and best way to do this is to put some intelligence in front of the instrument. So, you may involve a third PC or use one of the PCs on your network which always talks to the instrument. All other PCs on the network will have to talk to this PC if they want to talk to the instrument. You can do this by implementing a multi client single server architecture. More information about them can be found here:
A Multi-client Server Design Pattern Using Simple TCP/IP Messaging
Managing Multiple Clients from One Server Using TCP/IP in LabVIEW
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 2
(2,417 Views)