NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing G-initiated LabVIEW data in TestStand

Suppose a VI is started by pointing a browser to the URL of the VI.  The G web server starts the VI and the VI can communicate with the browser.  Is there any way for a running instance of TestStand to interact with that VI since it didn't invoke it?  Is there a callback method or global method that can be used?
0 Kudos
Message 1 of 8
(3,927 Views)
The VI will be running under a different process than TestStand, so there is no direct way to access it.  The only way you will be able to communicate with it is to use some type of intra-process communications, such as TestStand Syncrhonization objects.

Allen P.
NI
0 Kudos
Message 2 of 8
(3,912 Views)
I looked at it a little closer, and it is actually being run in the LabVIEW process.  So you could call another VI (just make sure you have the Development System selected in the Adapter), and use VI Server to get control values, set control values, etc... I have not tested this, but it looks like it should work.

Allen P.
NI
0 Kudos
Message 3 of 8
(3,902 Views)
Allen--

Thank you for taking the time to consider my question.  I am not highly experienced and so I need a few more details.  Could you help me by clarifying a few points, please?

"I looked at it a little closer, and it..."

What does the second "it" refer to?

"...is actually being run in the LabVIEW process.  So you could call another VI (just make sure you have the Development System
selected in the Adapter), "

What do you mean by "
Development System selected in the Adapter"?

"...and use VI Server to get control values, set control values, etc... I have not tested this, but it looks like it should work."

Sorry for my ignorance.

Thanks,
Kevin
0 Kudos
Message 4 of 8
(3,883 Views)
Sorry about the confusion.  The second it refers to the VI itself.

For the Development System option-

If you go to Configre >> Adapters, and select LabVIEW, you can see if you are configured to call VIs in the LabVIEW Runtime Engine or LabVIEW Development System.  You will need to call any VI that you wish to access the VI running on the web in the LabVIEW Development System.

You will have to call another VI that uses VI Server (Property and Invoke Nodes) to get and set control values on the web VI.  There is a good example of using VI Server here:
http://zone.ni.com/devzone/cda/epd/p/id/1100

Although the example does not use the G Web Server, it will give you the basics of how to do it just in LabVIEW first.

Allen P.
NI
0 Kudos
Message 5 of 8
(3,878 Views)
I have not found a reliable way to make this work.  I tried using both LabVIEW global objects and the VI server.  There seems to be some memory space issues or I don't know how to use globals and references.
0 Kudos
Message 6 of 8
(3,770 Views)
Hi kc64,

I was able to set up an application that does this on my machine.  I have two VIs, both part of the same project.  This project also has a shared variable.  One of the VIs takes a number as input and writes it to the shared variable.  The other reads from the shared variable and displays the value.  The "read and display" VI can be run from a remote front panel when someone enters the proper URL.  The "write to shared variable" VI is called from TestStand and passed a number to write to the shared variable.

I used my browser to view and run the "read and display" VI, then ran a TestStand sequence which writes to the shared variable.  After running the sequence I could see the value being updated in my web browser.

I would suggest building this application incrementally.  First, set up a project with a VI which is run as a remote front panel and displays a value.  Once that is working, have it read from a shared variable in your project.  Then, create another VI that writes to the shared variable.  Test this with your web browser, running each of the 2 VIs separately and verifying that you see the updates.  Once this is complete, you simply have to call the VI in a TestStand code module.

I hope that helps!  Post back if you have any further difficulties.
Regards,


Marty H.
National Instruments
0 Kudos
Message 7 of 8
(3,749 Views)
Another very reliable way is to use UI messages. You set up TS to post the message and set up and event callback in LV to process the message. This is the process that we use around here to do this sort of thing.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 8 of 8
(3,731 Views)