LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

functional variable with bundle by name

I want to know some technique to connect cluster element in functional variable.
Usually, I prefer to use "bundle by name" in manipulating cluster element for code readability.
For example, the attachment explains my prolem that only one component(array) should be replaced by new element.
But other components(Nummeasure& diff), which will be changed in other case routine, should not be changed in this "Write array" case.
 
How to define the name by "bundle by name" in functional variable?
or Where can I give a name information?
 
Lee

메시지가 10-08-2007 11:23 PM에 labmaster에 의해 편집되었음

0 Kudos
Message 1 of 4
(3,093 Views)
You just need an init case.  Especially if you are planning on using a replace array, you're going to have to init soemwhere.  If you don't need init, you can use a typecast in a case with your constant.  The problem you currently have is that none of your cases define the datatype.
Message 2 of 4
(3,070 Views)

I agree with Matthew. 

Either:

 an initialize case in your routine that you run from a higher level vi that has a constant of the same type as your cluster wired to the shift register, or

Place your cluster input into an initialize case or (data in?) case and wire it to the shift register -- this allows you to pass data into the function -- I assume you have another case that will pass the data back out!

You will always have to call your initialize case or (data in?) case first to "fill" the shift register with meaningful data before you call the cases that manipulate the array or other cluster data.

 

Tom

Message 3 of 4
(3,042 Views)

I have to echo Mathew's and Tom's comments.

In the interest of performance, I'd recomend keeping the array in a seperate SR so the bundle unbundle is not required.

For more info on Functional Variables you may want to look at my Action Engine Nugget.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(3,022 Views)