11-19-2014 09:36 PM
Hi all,
So I am trying to take multiple output strings and numerals from a sub-vi and pass them out of the sub-vi using the terminals and Bundle by name (that is instead of wiring up 10+ outputs to one sub-vi).
I have 10+ string Indicators, and 10+ Numerial Indicators. What I would like to do is create two clusters/bundles that I can use as two outputs for wiring up my sub-vi terminals for the purpose of passing that data out of the sub-vi.
So How can I use the indicators (w/ names) as my inputs to a bundle with names? I know that when I use the Sub-VI in another labview program, I am able to bundle with names the output terminals, but I would like to simplify everything to just two bundles.
Any help would be greatly appreciated!
11-19-2014 10:06 PM
It looks to me like you really have an array of sub-strings, or alternatively an array of numbers. It looks like each string you convert to a number -- instead of outputting both the string and its associated number, just output one (you can always convert to the other if you need it). Why not output a single array of all the values, instead of 10 separate values? It looks like the parsing of the string is similarly repetitive -- if you are doing the same thing over and over, that also suggests a (While) Loop.
BS
11-20-2014 06:37 AM
@Bob_Schor wrote:
It looks like the parsing of the string is similarly repetitive -- if you are doing the same thing over and over, that also suggests a (While) Loop.
In this case, a While loop with a shift register to hold the string and then autoindex the number. In the end, you have an array of numbers!
11-20-2014 08:48 AM - edited 11-20-2014 08:48 AM
If i did that how would I still have the Label with each value. For example (see picture), I am using this sub-vi to remove most of the code needed in the main VI so that it just comes down to how you want to display the data. So How would I both create the bundle (like seen in the picture) and have it just be a simple bundle with name output terminal on the sub-vi?
Simply; Is there a way to bundle with name the indicators (w/ their labels?) and if so how? or create label strings, create an array of those numbers, and bundle them together so I can Unbundle With Names?
A
11-20-2014 09:04 AM - edited 11-20-2014 09:05 AM
Hi abirkel,
you can change the label of all indicators in your cluster (on the subVI frontpanel), so they will show the name as you like to…
Other options:
- use an array of cluster of (name-string, value-number)
- use key-value-pairs as offered by variant attributes
- use any CVT implementation, there are several offered on NI website…
11-20-2014 10:07 AM
I know that you can change the Label names.
What I am trying to get at is this:
When you wire up the terminals to the indicators, the output from the sub-vi is (Indicator Name) Associated with (Value output of Indicator). In your VI you can use that instantly to Bundle which allows you to use UnBundle with names. This is an important issue for me because I would like to select which strings/numerals I want to read-out of the bundle by their name (the label I gave to the Indicators in my sub-vi).
All I want to know is if there is a way to have the Bundle With names, of the Indicators in the sub-vi, Then be able to Wire that bundle with a terminal Output of the VI. So in the End I would have 1 Terminal output, instead of the 10+ terminals for each individual output string (Indicators).
I understand giving advice on optimizing my code, I know my current code is not optimizied... I am currenlty JUST trying to solve the "Using too many terminals outputs".
TL;DR -
I want to have 1 Terminal output from my VI that is an array/bundle/set of data, How do I go about doing that so that when I take that data out of the VI, I can actually have Labels on each data point. So for my code; The ability to know the difference between Cell 1 and Cell 2.
11-20-2014 10:16 AM
If you insist on using a cluster, then make a cluster with the labels that you want. MAKE IT A TYPE DEF CONTROL. Make a constant of that cluster type and wire it into the type input for a Bundle By Name. When you go to unbundle, use the Unbundle By Name.
10-09-2023 08:21 PM
Hi, it has been many years, but no one above provided simple enough solution to what the starter trying to get.
It's simple like this: only control and constant will carry name (label) to bundle, so if want indicators to be bundled with name, use either as a pseudo constant of the bundle to be replaced.
Of course you may remove the bundle without name one, that is just for comparison.
10-09-2023 08:42 PM
Why doesn't the Output Cluster resemble the TypeDef? Why is "Period [us]" on the TypeDef showing up as "Td [us] 4"?
Bob Schor
10-09-2023 08:56 PM
Oh, my bad, because they are captured at different time, it is unified now. Thank for noticing this.