LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control a VI (with a while loop and an event structure) from another VI

Solved!
Go to solution

Hello


I have the principal VI whose I want to control it from another VI. But I cannot do this and I do not know what is happening.


For example: In VI Principal I have a while loop with an event structure, there's a boolean controller that control a boolean LED, which is inside of event structure. And the other VI, there are just a boolean controller and the applications functions to open the Principal VI.

 

How can I control the boolean LED in Principal VI, changing the state of the boolean controller in another VI?

 

 

Thanks.

Download All
0 Kudos
Message 1 of 4
(2,519 Views)
Solution
Accepted by topic author guilhermeramalho

There are different options, but depending on what you want to do. For this example I cannot really give you a specific solution.

I do not understand why you do what you do. Why do you want to call your "Principle VI" dynamically? What is the benefit to do so? There are also other ways to call a VI dynamically, depending on the actual case (for example "call and forget" methode, etc...).

 

In you Principle VI, you Boolean control ("ABCABC") is outside of the corresponding Event case. This is not a good practice usually, keep it inside.

Also, why you try to communicate between the caller and the called VI via such twisted way? There are better ways to do it.

 

In one of my projects, I use User Event to fire commands in the Event case, from the caller VI.

 

some more related readings for you:

 

http://www.notatamelion.com/2015/03/23/how-to-make-dynamic-subvis/

http://forums.ni.com/t5/LabVIEW/Dr-Damien-s-Development-Event-Structures-III-Communicating-With/m-p/...

Message 2 of 4
(2,483 Views)

Thank you!

 

I want to control the Principal VI from another computer, for example. Like a central computer in a remote access. Then, I want to activate this Principal VI from another VI in another PC. 

The boolean "ABCABC" had to stay outside the event case, once it's initialize the event. But the "ABCABC" signal should come from the Other VI.

I cannot change the Principal VI, that's why I have to control in that way.

 

 

0 Kudos
Message 3 of 4
(2,474 Views)
Solution
Accepted by topic author guilhermeramalho

In the Real-Time world, we do this all the time.  Communication between computers usually involves TCP/IP in some form or other, either via Shared Variables, VI Server, or Network Streams.  You basically need for the two machines to "talk" to each other, which means you could (in principle) also use RS-232, USB, etc.  But it's not simply "reaching out" with Remote Access to the Front Panel ...

 

Bob Schor

0 Kudos
Message 4 of 4
(2,447 Views)