LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine if shared variable library was deployed

I am building two applications that will shared information between each by shared variables.  The first application will deploy the shared variable library.  I would like to build into second application the ability to check if the library is deployed and inform the user to start the first application before continuing with the second.  The problem I am having is finding a way to check if the library is deployed.  Can someone help me out with this.

 

Terry

0 Kudos
Message 1 of 10
(3,435 Views)

Hello Terry, 

 

That is a great question. There are two options for you to do this. The first is you could set up a known signal variable in the shared variable library that is created by the first application.  Then you could build into the second application code that checked if it can read that known value from the shared variable library.  In the second method you could use errror handling in order to be assured that the library has been deployed. You could read the information that was already in the shared varible library and if it gives you a timeout error that there is no informaiton available at that location then you could inform the user to check if the second application is looking in the correct location or if the first application deployed the shared variable and did it deploy it to the correct location.   

 

Regards,

 

Izzy O.

Applications Engineer

National Instruments 

0 Kudos
Message 2 of 10
(3,417 Views)

Does anybody know any better (more elegant and without waiting for timeout) way to check this out (LabVIEW 2014 SP1)? 

Thanks!

 

Mateusz Owczarek

Mateusz Owczarek
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 3 of 10
(3,334 Views)

@MateuszOwczarek wrote:

Does anybody know any better (more elegant and without waiting for timeout) way to check this out (LabVIEW 2014 SP1)? 

Thanks!

 

Mateusz Owczarek


Maybe I'm being naive, but it seems to me that you almost have to "wait for a timeout", at least if you want to conclude "The Shared Variable is not available".  Here's my simple example -- disconnect the remote PC from the network.  How can you "know" that it is not there without "asking" for it (Ping, attempt to access something, etc.) and having it fail?  What does it mean, "to fail"?  Doesn't it mean "no response for N milliseconds"?

 

Bob Schor

Message 4 of 10
(3,321 Views)

Hi Bob,

 

Thanks for your answer, actually you're right about the timeout.

However, I still miss something I'm looking for. I can check if specific variable exists (and set timeout value for that operation, which is great!) using 'Open and Verify Variable Connection Function' (http://zone.ni.com/reference/en-XX/help/371361L-01/lvcomm/veropenvarcon/), but I would like to examine the library, not a single variable. Any idea? 

Mateusz Owczarek
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 5 of 10
(3,310 Views)

The machine from which you deployed the Shared Variables should have an instance of the NI Distributed System Manager running (look for it in the National Instruments folder under All Programs).  This shows you all "reachable" machines and any variables they may be hosting, and even allows you to (manually) read, write, and otherwise "play" with them.

 

Bob Schor

0 Kudos
Message 6 of 10
(3,289 Views)

Thanks, I know this tool. I'm looking for programatically access from LabVIEW. 

Mateusz Owczarek
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 7 of 10
(3,272 Views)

Hi Mateusz

 

I don’t think you’ll be able to determine the reachable machines programmatically in LabVIEW to the same degree as you would by looking at the Distributed System Manager. I think the best option may be the previous suggestion, waiting for a timeout of one of the variables. Would it work if you just checked a specific variable that always exists when the deployed machine is in a reachable state?

0 Kudos
Message 8 of 10
(3,237 Views)

I never did find an elegant way of determining if the library is deployed. So in my case I decided to check whether the first application is running.  The first application looks after the error checking to ensure deployment.  The second application only needs to determine if the first is running. I sys exec.vi to check the computers tasklist.

 

Test If App Running.jpg

Terry

0 Kudos
Message 9 of 10
(3,220 Views)

Terry,

Will,

Bob,

 

Thank you guys for answers. Of course I can handle that e.g. using your ideas. Unfortunately netiher of them are what I'm really looking for (simple and elegant way to check if shared variable library is deployed), so it is probably impossible in LabVIEW.

As you suggested, probably the best available way is to read specific variable, so we can close this topic unless somebody has any brilliant idea 🙂

 

Mateusz

Mateusz Owczarek
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 10 of 10
(3,192 Views)