LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I group a large logic circuit into a single icon that still allows for control of that VI's front panel?

I have a graphical representation of a P&ID made of LED lights that turns green or red depending on if that 

process line is open or closed. The coorisponding block diagram is a rather large logic circuit that controls 

these LED lights.

 

My problem is that I want to essentailly block that large piece of code into a "Sub VI" but I still want to use that 

code to control THAT VI's front panal. This would allow me to, in the future, make an automated sequence that can 

still use this light show without opening another VI's front panal.

 

If anyone has used Simulink this is the exact same thing as its grouping function...

0 Kudos
Message 1 of 5
(2,165 Views)

WIthout seeing your panel or code, it is hard to tell what you need.  If you can place the LEDs in an array or a cluster, it would be very simple to move the code to a subVI.  How many LEDs do you have and how are they arranged on the panel? Would the panel arrangement ever change?

 

Please post your code.

 

Lynn

0 Kudos
Message 2 of 5
(2,140 Views)

You can also try looking into subpanels. This allows you to display the front panel of a VI inside the front panel of another VI. There should probably be example in the example finder (Help>>Find Examples)

 

XControls are a more general option, but they are considerably more complicated and probably not relevant for what you want.


___________________
Try to take over the world!
0 Kudos
Message 3 of 5
(2,122 Views)

Sub-panels control references and dynamic event registration let me do this...

 

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,112 Views)

Are you asking how to control the front panel of one VI from the front panel of one of its subVIs (or another VI)?  Is so, check out VI server.  VI server functions are found on the Application Control palette.  For a short demo, right click on one of your controls and select Create»Reference.  You will be switched to the block diagram and have a reference node attached to your cursor.  Drop it.  Now go to the Application Control palette and select and drop a Property Node.  Connect the newly created reference to the Property Node top left terminal.  Click the Property Node's Property area and scroll down to the Value property and select it.  Right click on the Value and select Change to Write.  Wire a value to this input and it will change the value of the control.  You now have a method that allows you to change the value of a control from another VI.

 

Some caveats.  This can be slow.  It is synchronous, meaning that the function will not return until the front panel has been updated.  If you want to do a lot of controls at once, use the VI property Defer Panel Updates to turn updates of the front panel off while you are writing to it.  Don't forget to turn it back on.  If you can use a terminal or local variable, do not use the Value property.

 

My apologies if I have misinterpreted your request.  Let us know if you need more info.

0 Kudos
Message 5 of 5
(2,109 Views)