LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using invoke nodes to change a control on a server vi

I am trying to pass a parameter to a vi running in parallel with my main vi. I am using invoke nodes to do this without any problems. In server.vi I want to respond to a change in the control using an event structure. I have found that when passing the value to the vi using the invoke node from client.vi the event structure does not respond to the change in value. Is this correct behaviour? In the attachment run client and server, any change in the client panel is reflected in server without a response from the event structure. Running server by itself a change in the cluster causes the event structure to respond as expected. Thanks in advance for any help on this.
0 Kudos
Message 1 of 4
(2,803 Views)
The set control value method is the same as using a local variable or the value property - it doesn't fire the event. To fire the event, you need to use the Value(signaling) property. To do this, you need to get a reference to the control. You can do this by taking the Front Panel property of the server VI and wiring that reference into another property node. Then, you get an array of references to all the controls on the FP. You will need to find your control and wire its reference into the signaling property and then the event will fire. There are, of course, other ways of doing this - this one is fairly complicated, since you have to find the reference.

___________________
Try to take over the world!
Message 2 of 4
(2,800 Views)
Thanks for taking the time to respond. If I need to pass often changing data structures to parallel vi's, is the best method to use invoke nodes? VI server is not appropriate for this application. I was also considering using global data control and accessing them in each vi. Thanks again for your help
0 Kudos
Message 3 of 4
(2,795 Views)
The best (and easiest) way of sharing data between different VIs is definitely using a shared data space. Or in other words, a global variables. You can use LV internal global variables, which could be problematic memory-wise if you have large data structures. You can also use a type of global called "functional global". Search for it on this site and you should find some tutorials on using it. In any case, you should watch out for race conditions when writing to the same variable from different VIs. You may want to employ synchronization devices like semaphores or queues.

___________________
Try to take over the world!
Message 4 of 4
(2,785 Views)