06-07-2010 07:32 AM
As I woke this morning, the likely answer to this question occurred to me:
I bet that, at the time that you created the reference, the specific chart from which you created it was configured for 5 plots (e.g., had a five-element cluster wired to it). If you wire an eight-element cluster instead and then create the reference, that reference will make broken wires with any of your 5-element clusters but intact wires with the 8-element one. Let me know if that is the case.
If you have ever created a polymorphic VI, you know that you have to create a regular VI for each type of input you want to handle. You subsume all these specific VIs under one polymorphic envelope, which you use on your diagrams. At compile time, the compiler checks the inputs to the polymorphic VI and inserts the code for the correct specific input VI. The compiled code is no longer polymorphic and will not run with any other input type. NI's polymorphic functions and controls behave similarly. A strict reference captures the "type" of the specific code that exists when it (the reference) is created, hence your problems (I think).
I still think using data arrays (for increased flexibiity) rather than clusters (for tighter type definition) is the better way to go in general, though I find LabVIEW's strict typing one of its prime advantages..
06-07-2010 07:38 AM
JJ2112 wrote:Thanks for the help. Is there a way to keep the class strict, so instead of it expecting references to
charts with 5 plots have it expect refences to charts with 8? I don't see why 5 is the magic number
or where 5 was set in the code.
06-08-2010 03:55 PM
Hey,
Sorry for the delay, your solution worked!
The plots weren't the only instance of this problem (needing to change something
from 5 channels to 😎 and I wanted to see if I could solve them all before responding.
Most have similar solutions - changing the control on the front panel and then
recreating the reference on the block diagram. A few issues require different solutions
and I will attempt to solve these, but I'll leave this thread open in case I have another
question.
Thanks again