LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data exchange between main FP and subvi FP

Hi,
I have a subvi with 2 inputs. I place this subvi on another main vi and join two controls to these inputs. I want that the first control joined to the input get disabled if the second one is active. But I want to program the disabling action on the subvi, NOT in the main vi.
Thus I want to change the characteristics from a control (placed on the main vi) from the subvi. Is that possible?
 
Thanks
0 Kudos
Message 1 of 6
(2,809 Views)

I want that the first control joined to the input get disabled if the second one is active.

What exactly do yo mean by "the second one is active".

It sounds like you want to disable a control on the main front panel depending on if the other one has data in it. I'm guessing that you want to only allow data input on one of the controls.

If this is true, I think you're going to run into a problem trying to disable it from the subVI. The subVI can't do anything until it receives all of it's data, so there's no way way to disable one of the controls until the subVI is running. At this point it will be too late to disable anything to limit data input to only one of the controls.

You should be able to do this from the main VI using an Event structure and watch for which control gets clicked in to enter data, then disable the other one right away.

If this isn't what yo're tyring to do, provide a few more details and we'll get it worked out.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 6
(2,804 Views)
The information that they send it is not important to me, what is important is that the user should not be able to change the value of the first control if the second control is active (this control is a boolean one, active means it is set to TRUE).
 
But the main question is if it is possible to program all this in a subvi, and from the subvi change the properties of a control in the main vi.
I dont want to program anything in the main vi, I just want to place my block (subvi) and wire a couple of controls to it, and I want to manage these controls from the subvi.
0 Kudos
Message 3 of 6
(2,798 Views)
I think that you do not understand how a subvi works.  Once the subvi has received its data nothing that you change on the front panel of the main vi will affect the operation of the subvi unless you have passed references to the front panel objects and not the actual data.  If all of the programming is in the subvi why not make the subvi the main vi?
0 Kudos
Message 4 of 6
(2,791 Views)
OK,

You can create a reference to your main VI controls and wire these reference numbers into the subVI and use a property node in the subVI to operate on the main VI controls.

To create a control reference, right click on the control or it's diagram terminal and select "Create>Reference". You'll now have a new terminal that outputs that controls reference. You'll need to add a terminal to the connector pane of the subVI for each reference so you can pass it into the subVI.

In the subVI, drop a property node from the "Application Control" palette and connect the references to the property nodes.

Let me know of you need more info.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 5 of 6
(2,791 Views)
Thanks a lot Ed, that was exactly what I was looking for.
0 Kudos
Message 6 of 6
(2,776 Views)