LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variable data type: Can I choose an array of a custom typedef, without making the array itself a typedef?

Solved!
Go to solution

Hi all,

 

I'd like to pass an array of a cluster across my network. My cluster is typedef'ed, but I'd like to avoid polluting my project with another redundant typedef.

 

Is it possible to use the shared variable's "From Custom Control..." option with an array, without saving the array as a new .ctl file?

Certified LabVIEW Developer
0 Kudos
Message 1 of 5
(2,489 Views)

You don't have to make the array itself a type def; it's unnecessary. Just put the typedef'd cluster as the element in the array. Put an array constant on the block diagram, then move your custom cluster into it. If your cluster changes, all arrays that are made with that cluster will update

0 Kudos
Message 2 of 5
(2,486 Views)

 

Thanks for replying, Greg.

 

How do I then get a shared variable to accept that array?

Certified LabVIEW Developer
0 Kudos
Message 3 of 5
(2,479 Views)
Solution
Accepted by topic author JKSH

Ah, I didn't realize you were using shared variables. I thought you were just considering it as another option along with TCP/IP or UDP or something like that. In this case, you would have to create a second custom control. This control would be an array with teh typedef cluster in it. No need to make this new control itself a typedef though. Sorry, I know you were hoping for a different answer. I doubt one file will really "clutter" your project though Smiley Wink

0 Kudos
Message 4 of 5
(2,477 Views)

Haha, thanks... I feared as much 😉

 

One more control isn't that big an issue, and it definitely doesn't stop my work. This was was mainly a matter of principle, as little things do add up. There are options for "Array of Int32", "Array of Double Waveform" etc., so it would've been nice to have "Array from Custom Control..." or similar.

 

Never mind, on to more important matters 🙂

Certified LabVIEW Developer
0 Kudos
Message 5 of 5
(2,469 Views)