LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Control From One VI To Another

Solved!
Go to solution

Hi There,

I know that there is a lot of information about Queues and Globals for achieving data transmission between VI's. I just think there's a simple way to do what I want but I can't quite seem to figure it out currently.

The current setup has two VIs called from the VI server with their respective Front Panels opened. One of the front panels is literally just a boolean control push button that controls a case structure (so how the VI behaves essentially). I want to combine the two front panels so that this boolean control is in the same front panel as the other one. I could use a global to move all the controls indicators from both VIs into one front panel but feel like that is over the top. I thought there must be something simpler that whenever this push button is pressed it would change case of the other VI.

Thanks

0 Kudos
Message 1 of 10
(4,852 Views)

Can you attach a simplified version of your code? Thanks.

0 Kudos
Message 2 of 10
(4,843 Views)

Capture1.PNG

Hi there,

This is basically the VI with which I want to move the Talk and Stop controls from this VI to the others Front Panel.
Hope it helps and let me know if not. Thanks

0 Kudos
Message 3 of 10
(4,835 Views)

@Treesus wrote:

This is basically the VI with which I want to move the Talk and Stop controls from this VI to the others Front Panel.
Hope it helps and let me know if not. Thanks


No this is just a picture. Where are the actual VIs?

Message 4 of 10
(4,825 Views)

If you just want to pass the state of those controls (I suspect not) when those VIs are called you can just pass the value as a wire to the sub-VIs.

 

If you want them to detect changes while running then creat control referernces for them and pass the referenc to the sub-VIs so they can use property node>>>Value to check for the value or Dynamic Event Registration to register for the value changes.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 10
(4,787 Views)
Solution
Accepted by topic author Treesus

@Treesus wrote:

The current setup has two VIs called from the VI server with their respective Front Panels opened. One of the front panels is literally just a boolean control push button that controls a case structure (so how the VI behaves essentially). I want to combine the two front panels so that this boolean control is in the same front panel as the other one. I could use a global to move all the controls indicators from both VIs into one front panel but feel like that is over the top. I thought there must be something simpler that whenever this push button is pressed it would change case of the other VI.


To reiterate my previous comments, you need to give us the full information in order for us to try to solve the problem. You need to attach simplified version of all code (caller, subVIs, etc.)

  • What is "called from the VI server"? Please define what you mean by that! What is calling what, how, and in what order?
  • If you say the other VI "literally contains only a button on the front panel", we would also need to know what's on the diagram. Is that button value polled in some way? How often? There has to be other functionality, e.g. how does that VI stop?
  • So far you showed us an incomplete(!) picture of a small part of the code, and it immediately tells us that you are very new to LabVIEW, because it is full of typical beginner mistakes (What is in the other case? What is the CPU use when "talk" is false? What determines the loop rate? Why is there a stack of two while loops? Why is there a "not" going to the inner loop termination instead of just changing the termination condition? All you need is a proper state machine (look it up!) with one loop total and a case structure. No local variables needed.

My advice would be to ...

  1. first start learning about proper code architecture, do all avaiable tutorials, look at the shipping examples and templates, etc.
  2. Attach ALL Vis (or simplified versions that still show the issue), tell us exactly how things are called and how you run it all.
0 Kudos
Message 6 of 10
(4,776 Views)

You can connect controls via datasockets.

"If you weren't supposed to push it, it wouldn't be a button."
Message 7 of 10
(4,768 Views)

The possibly simplest solution would be to use a subpanel.  Just insert your VI with the button into a subpanel on your other GUI VI.  Then you don't have to worry about passing the data around and it just looks like it is a single window.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 10
(4,759 Views)

Hi all,

Thanks for all the replies. Working through your options now and I believe one should work. I am relatively new to LabVIEW yes so I'll go through those beginner things and for future reference will be able to provide full code samples and more information. Thanks again everyone

0 Kudos
Message 9 of 10
(4,740 Views)

We were all beginners once.  And while this isn't a replacement for a menor, here are some of the free training links we share on the forums:

 

Here are some free training links if you are interested:

 

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide 

Learn NI Training Resource Videos

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required

Message 10 of 10
(4,734 Views)