LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a cluster of data from one VI to another

Solved!
Go to solution

Hi all,

 

I've got a cluster of controls on my main application VI that I am using to accept data of various types from the user.Next I want to pass this cluster to the input cluster control of another VI perfectly on the generation of a user event. That is, if I have 3 numbers, 2 strings and 2 time stamps in the cluster on the main VI, I want to pass on that exact same data to the control input cluster of the second VI in the same sequence, having the same values.

 

How do I do this?

 

Here is a snapshot showing the cluster controls on my main VI and the code for my second VI.

 

1.JPG 

 

2.JPG 

 

I want to pass the data into the input cluster 'data'. I tried calling the second VI into my main VI and directly hardwiring the cluster and then using an 'Unbundle by Name function' to separate the data, as shown. But this doesn't seem to work properly.

 

Regards. 

 

 

0 Kudos
Message 1 of 8
(3,483 Views)

I tried calling the second VI into my main VI and directly hardwiring the cluster and then using an 'Unbundle by Name function' to separate the data, as shown. But this doesn't seem to work properly.
Why is it not working? Is the order mixed up? you use abundle array and input individual values to the cluster.
0 Kudos
Message 2 of 8
(3,478 Views)
Solution
Accepted by tdog

The 2 clusters much be identical, then it should work smoothly. To ensure that they are, make a type-def of the cluster and use for both. From what i can see of your code it's clean and correct and it really shouldn't cause a hassle. What's (not) happening?

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 8
(3,476 Views)
You state your approach "doesn't seem to work properly". That's a bit vague. To be sure, you can put a probe on the wire after the data cluster terminal. The probe should reflect what comes out from the first vi. Next you could put a probe on the wire that holds the database string (after the Format Into String function you use). Is that the string it should have been?
Bart Boshuizen,
www.morechemistry.com
0 Kudos
Message 4 of 8
(3,463 Views)

Thanks for your suggestion, Yamaeda. Using a type-def did the trick.

 

Cheers and thanks to all.

0 Kudos
Message 5 of 8
(3,457 Views)

this is an ancient post; I think you have already solved this issue. use the below method cluster or whatever you can pass data

 

Himasha_LV_0-1729675536547.png

 

0 Kudos
Message 6 of 8
(291 Views)

Hi Himasha,

 

can you explain your example?

 

  • Why did you use (lossy!) queues limited to one element? Why don't you use notifiers?
  • Why don't you use one cluster instead of 3 separate queues for 3 elements?
  • Why do you need to preview all those queues in two different loops?
  • Why do you think it's a good idea to show your example in this VERY old thread?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(282 Views)

Hi Knight of NI,

 

Yes you can use Cluster

this is the only example I had

below is another one like that

 

this is should be very old thread but someone can learn by seeing this

Himasha_LV_0-1729676540454.png

 

0 Kudos
Message 8 of 8
(274 Views)