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.
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.
08-30-2022 07:28 AM
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 Community, expandable 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
Solved! Go to Solution.
08-30-2022 08:25 AM
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
08-30-2022 08:57 AM
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.
08-30-2022 09:03 AM
@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.
08-30-2022 08:38 PM
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...
08-30-2022 08:48 PM
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
08-30-2022 09:26 PM - edited 08-30-2022 09:31 PM
So why don't you auto-index on an array of keys?
(Using a MAP example here, since I don't have your toolkit)
09-01-2022 04:50 AM
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.