LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set control value[Variant]

Hi,

I have an vi (vi1) and another vi (vi2). In my vi2 I update a control placed in vi1 using set control value[Variant] method but I want that when I do this, the vi1 knows that the value of its control has changed, I have an event case which one event is when this control value changes (value changed) and I want to handle it. If I use set control value[Variant] method , it forces signaling? I would like this method has the same behavior as value(signaling) property node. Does 'set control value[Variant]' method have the same behavior as value(signaling) when I update the control value using it?

Thanks,

ToNi.
0 Kudos
Message 1 of 4
(3,318 Views)
Hi,

I attach here a little example about what I want to do. There is two VIs, the father.vi and child.vi. Father.vi set the value of the control boolean to true when the user press the button ok placed in father.vi. Then, in child.vi, when the value of boolean control change to true I want to handle this event and then I want to change the state of my another control (Numeric) from dissable and grayed to enabled but it doesn't work.

A solution is to create a global variable reference to boolean control placed in child.vi and from father.vi use a value(signaling) property node associated to this global varaible reference of that control but I don't want to use global variable, I want to do it using set control value [variant] but it doesn't work.

Any ideas?

To use these VIs you must do:

1.-Run child.vi
2.-Run father.vi
3.-Press button ok placed in father.vi and then you see the checkbox placed in child.vi changes its value from false to true but boolean control doesn't change its state from dissabled and grayed to enabled that it is just I want to do.

Thanks,

ToNi.
0 Kudos
Message 2 of 4
(3,294 Views)
You could do something like the attached where in the timeout event, you compare current value to the previous value in a shift register. If different, then set the Value (Signaling) property.
0 Kudos
Message 3 of 4
(3,283 Views)
If you really want to do it this way, why don't you use the Value (signaling) property of the control instead of Set Control Value (variant)? In your father.vi, optain the reference to the front panel of the child vi. Then get the references to the front panel controls and search for the one you want by name (the control has a unique label, right?). Now you have a reference to the control that you can use the traditional control property node with, and you won't need to poll for a change of value.

I haven't looked at your vi's, but have you considered using a queue to communicate with your child vi?

Let me know if you'd like more material on either of these solutions.

Chris

Message Edited by C. Minnella on 10-31-2005 01:34 PM

0 Kudos
Message 4 of 4
(3,280 Views)