From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create vi which has variable input output connections like index array, build array

Solved!
Go to solution

I am using Open G Dictionary library, but calling vi is very stressful every time get value from dictionary

I just want to get many data from only one VI call

 

I found similar posts Expandable Vis - NI Communityexpandable vi - NI Community

They said there is no way to do in 2010 or 2008

But now it is 2022 year.. Is there any technique to solve this problem?

 

> I am using Labview 2017

> In terms of Express VI, I think that I have to manually add input and output like i1, i2, o1, o2, ... . It is not what I want

0 Kudos
Message 1 of 8
(1,289 Views)

I'm not sure what it is you want to do, but a number of mechanisms have been added to LabVIEW, some perhaps after LabVIEW 2017.  Go on the Web and look up "Polymorphic VIs", "Malleable VIs", and LabVIEW Map and Set functions (also called LabVIEW Collection functions).

 

Bob Schor

Message 2 of 8
(1,274 Views)

The only thing which is really expandable is XNodes, which have never been officially supported, and which require some tricks to create.

 

I don't know how you're measuring your "stress" but I would suggest replacing the call to the dictionary VIs with calls to get/set variant attributes, which provide the same functionality, but should be more efficient. That is the only advice I think I can give without knowing more details.

 

I'm not sure if this will actually help you or not (if you really have performance issues, then it seems unlikely this would be enough to solve them), but it should be relatively easy to check. Just note that the unlike the wire you would get from the dictionary VIs, the variant is by value, so splitting the wire would create two separate copies. If you want a single copy, either chain it or wrap it in a DVR.

 

As Bob points out, LV does also have the map primitives, which would be better, but those didn't exist in LV 2017.


___________________
Try to take over the world!
Message 3 of 8
(1,258 Views)

@usan_ wrote:

How to create vi which has variable input output connections like index array, build array 


You can "in principle" create resizable nodes using xnodes but that's not officially supported.

 


@usan_ wrote:

I am using Open G Dictionary library, but calling vi is very stressful every time get value from dictionary

I just want to get many data from only one VI call


LabVIEW introduced MAPS in version 2019, which are very useful. Once you upgrade, that might be all you need.

 

Can you explain your use of the term "stressful"? Maybe show an example of what you are currently doing? LabVIEW has loops and arrays, so it would be trivial to create a subVI that takes an array of keys and outputs an array of values, for example. And if you make it into a malleable VI, you can eve re-use it for a variety of datatypes without having to rewrite anything.

 

My best guess is that you are currently doing things the wrong way and are looking for a solution in the wrong place. Tell us what you want to do, not how you want to do it and we can probably point you to an elegant solution.

Message 4 of 8
(1,253 Views)

The description was too bad, I apologize

 

The "stress" means that vi calls take up too many spaces compared to cluster.

I  often get 20 data from dictionary at once then I have to call vi 20 times... 

187573106-bc04b4f6-0021-4413-8af5-d4e1b801ec9e

0 Kudos
Message 5 of 8
(1,216 Views)

Thank you for reply,

 

I load some data from excel file and use it via cluster

Whenever the data field or structure changes in excel file I have to modify the cluster either

It`s double job.

 

So I want to replace cluster to dictionary

 

Loading data is well done using dictionary, but as you can see my reply when get multiple data at once I need to call too many vis

 

I have to check xnode first

0 Kudos
Message 6 of 8
(1,211 Views)
Solution
Accepted by topic author usan_

So why don't you auto-index on an array of keys?

 

 

altenbach_1-1661913067252.png

 

(Using a MAP example here, since I don't have your toolkit)

Message 7 of 8
(1,197 Views)

Actually I don`t use array to output in real situation so I thought it was bad

But adding index array vi is pretty good and simple solution so I just do as you replied

Thank you.

 

 

0 Kudos
Message 8 of 8
(1,145 Views)