LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remote controlling VI through other VIs

Solved!
Go to solution

Hi guys,

 

I'm trying to remote control the following VI (let's call it the slave VI "B"). It has a simple button that controls the text in a text box.

Now I want to have another VI (master VI "A")  that controls this button as if it were toggled in the original VI "B".

VIs "A" and "B" should run concurrently until VI "A" tells VI "B" to terminate.

 

Is that possible and if so, how? I'd be thankful for a solution.

receiving vi.PNG

0 Kudos
Message 1 of 17
(4,220 Views)
Solution
Accepted by joptimus

Hi joptimus,

 

use a "value signalling" property node to set the button state.

 

While this approach might work it will be a hazzle. Better use user-defined events or even "real" queues to send commands from one VI to another…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(4,201 Views)

Hi GerdW,

 

I have never done something like that. Do you perhaps have an example, please?

Or a link to a tutorial?

0 Kudos
Message 3 of 17
(4,190 Views)

Hi joptimus,

 

LabVIEW comes with a lot of examples - and with a tool named "example finder"…

 

NI offers a lot of tutorials on their website. One entry point might be www.learnni.com !

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(4,179 Views)

As Gerd suggested, you may want to use some of the training resources.

That Constant "0" wired to the event timeout is probably a mistake (I do have a reputation for understatement on the forums...I'll maintain my reputation)  a Zero TIMEOUT is "Polling."   So, let us understand what your issue is!

 

Why did you think that wireing a constant with a value of 0 to the timeout of an event structure was what you should do?  NOTE: there is "Null Code" in the Timeout Case.

 

Are you just "giving the CPU exercise?"- it won't work.  In other words; if you want your application to do nothing when the user does not take any action, that code in the timeout case will do it all of the time!   ????What were you thinking? Your thought process will help US to correct the documentation and prevent others from making the same mistake.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 17
(4,162 Views)

I used value signaling property nodes and now it works. Thanks guys!

0 Kudos
Message 6 of 17
(4,070 Views)

Okay, that was premature...

It works, but only in my simple test vi. With the target application (control of a linear actuator) it doesn't.

 

Now I tried some user defined events and it works, but not every time. For starters I only implemented the power button. Sometimes it works and the button is triggered, but sometimes it is not. I have no idea how to solve that. It seems like a timing problem?

 

Here's the three VIs in question as attachment. One creates an event (the master VI if you will), then the VI with the event itself and finally the VI that controls the actuator. You will not be able to run that one, but it should suffice to show what it does and to hopefully find a solution.

 

Thanks in advance!

 

Download All
0 Kudos
Message 7 of 17
(4,048 Views)
Solution
Accepted by joptimus

The registration for the loop should only need to happen once.  So move the registration to before your loop with the Event Structure.  You should also Unregister and close the event after your loop is complete.


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
0 Kudos
Message 8 of 17
(4,033 Views)

Thanks, perfect!

 

Can I register multiple user events for my event structure like adding entries or do I have to copy the whole user event registration?

0 Kudos
Message 9 of 17
(4,018 Views)

joptimus wrote:

Can I register multiple user events for my event structure like adding entries or do I have to copy the whole user event registration?


There are a few ways to do this.  You can bundle your User Event references into a cluster and feed that into your Register Event or you can extend the Register Event to register more events.


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
0 Kudos
Message 10 of 17
(4,008 Views)