LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Control access to shared resources

Hello all,

for a set of applications I am developing I need to limit access to a shared resources to one application only. Specifically, the resources are climatic chambers remotely controlle on ethernet by applications located on different PCs. Chambers and PCs are on the same network, and I need to prevent that a program on one machine can control a chamber if it is already controlled by another machine.

It seems the chambers do not offer this facility by themselves unless I manually edit some configuration parameters to prevent access by IP, but it is a complicated procedure that I cannot be sure the operators will perform every time. I would like to have some locking object I can share across several PCs, but I don't see a way that locks or mutexes can be shared across different machines so I am in search of other methods.

If it can be of help, both PCs and chambers have fixed IP.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 3
(3,811 Views)

My first thought would be having a Network Shared Variable hosted by One of the PCs that others car read/modify containing the owner.

When a PC need to access the resource it must read this variable before and then, if it's empty write the name/IP address inside and start to communicate with the climatic chamber.

 

I do not know other methods to implement a network shared resource.

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

Yes, I was thinking to a shared variable as an alternative to some messaging via TCP/IP.

One possible problem is that there isn't a "master" pc that is always on and can operate as a central organizational unit: I have two machines that could be on or off at any moment. I am thinking that each unit could publish some state variable about their use of the chambers and negotiate with the other what to do.

This could be accomplished also implementing some client/server mechanism between the machines: each application could check when starting if the other is on and connect to it as a client, otherwise start a TCP server waiting for the other to connect. When one of them requires a chamber it signals it as not available to the other.

 

I'm still trying to understand pros and cons of each scenario and evaluate which can be the most reliable.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(3,779 Views)