LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable reference problem

Hai all,
 
Am facing a problem in assigning a control as a global one.
 
Actually i have assigned two OK buttons g1 and g2 as global ones. In 1.vi i have created control c1 (Switch when pressed) and in 2.vi i used g1. when i run both VI's, the g1 get updated with the change in values i gave in c1 in 1.vi (NO PROBLEMS).
 
But in 1.vi i created another control c2 (Latch when released) and in 2.vi i used g2. when i run both the vi's, the g2 didn't get updated with the change in values i gave in c2 in 2.vi
 
Anybody please suggest a immediate reply.
 
Regards,
Mathan
0 Kudos
Message 1 of 5
(3,274 Views)
the latch option of a button is not compartible with global variables, or local ones.
If i remember correctly Labview changes the value property, to variant, if you try to use it. It is a kind of warning.


Message Edited by Pnt on 03-25-2008 01:42 PM
0 Kudos
Message 2 of 5
(3,266 Views)
Instead of globals (which can have race conditions) you should look into Action Engines or Queues, which are much more robust ways to share data between VIs.


Message Edited by JeffOverton on 03-25-2008 07:41 AM
Message 3 of 5
(3,263 Views)

Hai,

Thanks for the timely help. Actually am using parallel port read and write loop.vi from the example finders in Labview 8.5 in my application.

In my project, USB device test using USBCV utlity, am in need of two controls (buttons). One will be a switch which give a high/low value when pressed/released. Other one will be a latch which will be used for remote wakeup of the device (a pulse). i have done this in labview.

But the test needs to be automated. That is when the USBCV utlity asks to connect/disconnect a device, automatically the switch control should be handled accordingly. when the utility asks for a remote wakeup, the latch control will get pressed automatically.

That is when i run my VI and the USBCV utility, when the utility prompts for certain action (connect/disconnect, remote wakeup), the VI should give appropriate inputs (from switch or latch) automatically without any user inputs.

Kindly give suggestions.

0 Kudos
Message 4 of 5
(3,251 Views)

You can replace the latch control with a switch one. Make a event case for each control "value change". Then you can use the property "value signal" to programmatically trigger an event.

This is the easiest way.

0 Kudos
Message 5 of 5
(3,223 Views)