LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remote controlling VI through other VIs

Solved!
Go to solution

Thanks, but I don't know how to do this.

I have made a cluster with 2 elements like this:

 

user events cluster.PNG

 

My calling VI looks like this:

calling vi.PNG

Now I don't know what to do in the receiving VI with the event structure:

receiving vi.PNG

I know I'm close with this, but somehow I just don't see the obvious solution 😞

0 Kudos
Message 11 of 17
(1,599 Views)

Just to illustrate:

I want this structure to be less cluttered, to work with clusters. Because there will be many user events in the final version. Also, why does it only say "user event" under the "Reg events" function and doesn't show my events by name?

multiple events.PNG

0 Kudos
Message 12 of 17
(1,591 Views)

Hi joptimus,

 

You can bundle the User Event Refnums into a cluster and pass this to your caller(s).

In the caller, select the required event.

 

To further clean things up, you could make a subvi out of the Create User Events (and bundle).

 

UE cluster.png

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 13 of 17
(1,559 Views)

Thanks. Can I have a cluster input for the "create user event" VI and use just one of those? I tried that and I cannot connect the resulting output to the "register user event(s)" function.

0 Kudos
Message 14 of 17
(1,550 Views)

> Can I have a cluster input for the "create user event" VI [?]

 

Yes.

 

> I tried that and I cannot connect the resulting output to the "register user event(s)" function

 

Did you give the cluster a label?

 

User Events can certainly be clusters (or arrays, or combos), but you should not combine User Events.

In this case, you would have one event (Registered in the Receiver) that has two functions.

How would the "Receiver" know which one you wanted to change?

 

steve

 

 

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 15 of 17
(1,528 Views)

Thanks, steve.

 

I have one final question please:

I now have moved the event creation into the calling VI. In the receiving/consumer VI, I'm reading the created and generated event into the register function and wire its output to my dynamic event registration:

receiving vi_2.PNG

 

The problem is, that in the event data node, I can only select those 4 items and not the value itself. I think this is a bug, because in another VI which built in the exact same way it works (although I'm not sure why it says "emergency", I never named any variable/function like that):

receiving vi_3.PNG

0 Kudos
Message 16 of 17
(1,484 Views)

Do you ensure that the Globals are written to before they are read?

Dataflow must be incorporated that forces the definition of the Global to occur before you use it.

 

What is the default value of the Power on/off Global?

You might try running the program and then saving the Global (Right Click, "Make Current Value Default").

See if that fixes the "Emergency" label.

 

steve

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 17 of 17
(1,454 Views)