11-29-2012 10:27 PM
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?
Solved! Go to Solution.
11-30-2012 12:02 AM - edited 11-30-2012 12:04 AM
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
11-30-2012 12:42 AM
11-30-2012 12:47 AM - edited 11-30-2012 12:52 AM
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
11-30-2012 01:12 AM
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 🙂