From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Affecting Component of Cluster in Different VI

Within my Project I have 2-VIs (One.vi and Two.vi) that have the same Cluster, containing a String and Numeric. I also have a Global with the same Cluster

I would like to cause an event in One.vi by changing the value of one component in Two.vi

i.e. if I change the Numeric in Two.vi, I expect the Numeric Event in One.vi to occur

Similarly, if I change the String in Two.vi I expect the String Event in One.vi to occur

 

That is not happening in my example

Please see the attached files.

They are in a single project

 

Keith

Download All
0 Kudos
Message 1 of 4
(903 Views)

One.vi doesn't capture ant events.  Changing values of the cluster in One.vi has no effect because there is no code in One.vi that does anything with changes in the cluster.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 4
(895 Views)

Actually, the Event in the Cluster.String Value Changed... always occurs in One.VI

 

0 Kudos
Message 3 of 4
(873 Views)

No. When you change the cluster in 2, the event fires, and makes the change in the cluster in #1 via the control reference point to the cluster in #1 that you saved in the global.

 

There is no code in 1.vi to detect when the cluster in 1.vi changes, and no mechanism to send that data to 2.vi to change the cluster there.

 

If you want to send messages or data between VI's, you should be using a queue to send data from 1 to 2.  And a second queue to send data from 2 to 1.  That or register for user events.

 

Actually register for a user event in 2.vi based on a value change on the cluster in 1.vi is probably the correct way to do this, but I rarely have a need for user events in the code I'm working with, so I'm not going to be able to state that for a fact or be able to suggest an example to demonstrate it.

0 Kudos
Message 4 of 4
(837 Views)