11-03-2015 06:37 AM
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.
Solved! Go to Solution.
11-03-2015 07:12 AM
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…
11-03-2015 07:15 AM
Hi GerdW,
I have never done something like that. Do you perhaps have an example, please?
Or a link to a tutorial?
11-03-2015 07:26 AM - edited 11-03-2015 07:27 AM
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 !
11-03-2015 07:41 AM - edited 11-03-2015 07:50 AM
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.
11-11-2015 03:55 AM
I used value signaling property nodes and now it works. Thanks guys!
11-11-2015 06:59 AM
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!
11-11-2015 07:23 AM
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.
11-11-2015 08:29 AM
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?
11-11-2015 08:51 AM
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.