Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Programmatically Controlling One VI's Front Panel from Another Using VI Server

6 ratings | 5.00 out of 5
Print

Downloads

Filename: prgctlvs.zip
Requirements: View

These VIs demonstrate the use of VI Server to control the front panel objects of one VI from another. Run the Master.vi, and it will (in turn) run the Slave.vi. You can then use the controls on the front panel of the Master.vi to change the controls on the front panel of the Slave.vi.

Master.vi
Master.vi uses VI Server to open another VI (Slave.vi) that is located in the same directory. The Property Node makes sure that Slave.vi's front panel is visible, while the first Invoke Node runs the VI (like calling a subVI), but with the "Wait until done" set to False, it will run independently of Master.vi. However, Master.vi can programmatically update the values of the controls on Slave.vi's front panel.

The Case Structure inside the While Loop is optional. It is included so that the programmatic control of Slave.vi's front panel can be turned on and off. The four Invoke Nodes within the True case affect the correspondingly named controls on Slave.vi's front panel. It is critical that the Control Name input be an exact match for the name of the control on the other VI's front panel. The Flatten to String functions are used to flatten the data for the Type Descriptor and Flattened Data inputs.

The Close VI Reference on the outside of the While Loop ends the VI Server session. Please note that, even after Master.vi stops, Slave.vi will continue to run until
its own Stop button is pushed.

Slave.vi
Slave.vi has four front panel controls (two digital controls and two boolean buttons), a chart that displays the current values of the digital controls, and two LEDs that indicate the current values of the boolean buttons. A 250 ms delay in Slave.vi's While Loop is optional, but makes it easier to notice changes in the controls.

Requirements


Filename: prgctlvs.zip

Software Requirements


Application Software: LabVIEW Full Development System 5.0.1
Language(s): LabVIEW

 
6 ratings | 5.00 out of 5
Print

Reader Comments | Submit a comment »

Can't open example with LV 8.5
I am another person with LabVIEW 8.5 that can't open this example. Seems like we are being punished for staying current. Please do not remove older examples, of which there are many good ones. Instead, either recompile and repost them using conversion tools that you must have, let us have that tool (post it), or fix LabVIEW to open VIs that go back at least to 5.0 and maybe even 4.0.
- Phillip Gold, Lockheed Martin Co.. phillip.w.gold@lmco.com - May 6, 2008

VIs slightly out of date
Perhaps there is another page that has an updated version of this example, but I cannot open this VIs in this example because I have LabVIEW 8.5 and the VIs here are too old of a version to be upgraded.
- Bob Schneider, Signalysis. bob.schneider@signalysis.com - Jan 31, 2008

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).