07-15-2009 11:23 AM
Interesting... That makes sense. However, when I was coding the replace element function, it wouldn't un-break the wires unless i had the array of cluster typedef indicator wired to the shift register output. not sure why i was havign this problem. But followign your steps gave me teh correct behavior. because of what i was experiencing, it made ti seem like the indicator typedef had to be wired to the shift register (input or output) for the replace array element function to know what it was populating.
I'm suprised that the function wouldn't let you take an empty array and populate a specific index of it and have anything from the zeroith index up to but not including that index default to zero. LabView likes the variable length arrays... it just surprises me i can't do that.
Either way, the first call? function is probably the best solution. Thanks for your help.
07-15-2009 04:23 PM - edited 07-15-2009 04:24 PM
PhilipJoeP wrote:Either way, the first call? function is probably the best solution.
You should really use a globally initialzed feedback node for the following reasons:
Here's how the code could look like:
07-15-2009 05:42 PM
To PhilipJoeP: Note that what altenbach is showing you is the use of the Feeback Node which was introduced in LabVIEW 8.5. It can be used to replace shift registers (though I still prefer shift registers). Everything I was talking about was so you'd understand about the difference between types and values with shift registers. The construct shown by altenbach is the same as if you had a functional global with an "init" case (which could be triggered by a First Call?) that would initialize the shift register with data. The Feedback Node provides more compact code (though some, such as me, would argue that it's sometimes less readable). Also note that with altenbach's example if you did not have the array constant connected to the initializer terminal you'd have the same exact situation as what you were seeing with the uninitialized shift register.
Bottom line: the concept is the same, but the implementation is more compact with the Feedback Node.