03-30-2017 12:56 PM
Hi there, I have the following problem: I want to use a single instrument from two computers, but I don't want them to compete for the instrument. For the most part, this will be avoided by staggering the tests. A test is about 20 minutes, and the instrument is only needed for about 7 minutes. In case of overlap, I'd like the second computer to access it to see that the instrument is "locked", and wait until it is free before trying to use it.
The instrument is a Network Analyzer, costing over $100k, which is why I don't want to buy a second one. So far, I've tried saving a file to the instrument (called "InUse") which is created when a computer starts using it, and deleted when it is finished using it. The second computer will look for this file every 1 second or so, and can use the instrument if the file is not present. But this can cause errors and disrupt the test of the first computer.
Does anyone have good ideas for handling this situation?
03-30-2017 01:08 PM
Assuming you can not write code that runs on the Network Analyzer...
Have the two application talk to each other and ask the other if they can use the analyzer?
if no reply assume the analyzer is available and the other application is not running.
or write your "InUse" file to mapped drives on the other machine.
And another approach could be...
Write a proxy that runs on one of the machines and acts as a gateway to the network analyzer
Ben
03-30-2017 01:16 PM
Hi Ben, thank you for your suggestions!
Have the two application talk to each other and ask the other if they can use the analyzer?
This sounds like a good option. I'm not sure exactly how to do that, since the tests are run through TestStand. Would I need to run a separate application just letting the computers talk to each other? Would that use a TCP/IP communication? (something I'm not familiar with, but willing to learn!)
or write your "InUse" file to mapped drives on the other machine.
I have considered doing this, with a file on a network drive.
Write a proxy that runs on one of the machines and acts as a gateway to the network analyzer
This one I don't understand, but it sounds like an elegant solution!
03-30-2017 01:51 PM - edited 03-30-2017 01:52 PM
Network drive sounds like the easiest ... provided the availability of the drive is questionable. You may want to check time stamps of the file to cover the "other" application crashing and leaving the file on the drive.
The other two methods require more work since you will have to account for the "other" application may not be running.
Ben
03-30-2017 02:03 PM
03-30-2017 02:06 PM
Why not set this up similar to printer sharing - You can open a personal printer connected to your PC to the network. Use this same concept.
Have the Main/Primary system perform the following:
03-30-2017 02:10 PM
I see, that sounds like the proxy that Ben mentioned. Thank you for laying it out in steps for me, I will try to think about how to implement it!
03-30-2017 02:14 PM
Essentially, only one system will communicate with the instrument. All others will communicate with that instrument through that one and will control it via a request system. This will protect the piece of equipment and allow you to set up whatever priority interfacing and control you would like. Possibly resetting the piece of equipment during each transition phase to return it to a known state.
03-30-2017 02:32 PM
Wouldn't a shared or network variable work here?
03-30-2017 02:42 PM
@RTSLVU wrote:
Wouldn't a shared or network variable work here?
In theory YES but which of the two machine will host the variable... and what happens if the serving machine is down and we try to run the other machine?
Ben