LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic cluster member selection and output selected values to analog output.

I have a large program with a large complex cluster with tens of sub clusters and hundreds of variables.
 
What is the best way to select some of these member variables (16 at maximum) and send these values to an analog output?
 
I think a list with sublist and a variable list should be the nicest solution.
 
Just send me some propositions.
 
Wouter Smiley Mad
Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 1 of 18
(4,065 Views)
Huge clusters could give you some serious memory headaches. However, if you still want to keep them, you might wish to take a look at the OpenG data tools package (in the Advanced palette after you install it). They include VIs which allow you to break down a cluster and get its elements by name.

___________________
Try to take over the world!
0 Kudos
Message 2 of 18
(4,049 Views)

What is your best solution to keep hundreds of variables in tens of control blocks under control?

I use a main cluster that holds clusters from each of the controlblocks I build my simulator with.

It is a real-time simulator 10msec calculations step, simulating 4 powerplants with its main transformer coupled to a power station and local loads. This powerstation is connected by two powerlines to the European grid.

For now, ths simulation works fine, but I should be able to select in real-time each variable separately and put it on one of the 16 analog outputs.

Selection should be Powerstation 1-4, or grid. When one selected, from a list with all variables the selection should be kept (as a pointer I gess) into an array with sixteen places, from wich later on the values should be retrieved and outputted to the DA. The recalculation should be done in less than one millisec.

With the cluster concept I can save/read the state of the simulation in one single operation.

 

Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 3 of 18
(4,043 Views)
For a great number of variables with the same type I prefer to keep them in a single 1D array and assign each of them a specified index.
If you want to keep your documentation in the diagram, you can either use a label for each number or use a type def ring.
 
However, if the cluster approach works for you, you can use it. My line about memory problems is usually if you use large clusters to save data. If you're only keeping this for configuration, you should probably be OK.

___________________
Try to take over the world!
0 Kudos
Message 4 of 18
(4,038 Views)
Did a small benchmark,
 
saving large cluster and rereading it from a storing vi takes only 10µsec on my portable pc.
Converting it to XML takes 1.5 msec. I can use it after initialisation or for storing states at runtime. Datastorage takes the same amount of time.
If I could use this xml text to fill in my list it should help me.
 
A better solution should be to build an array, one with the caption of the members of the cluster, a second with the values, a thirth with the references.
Once build a list should be filled with the names. When selecting a name, the reference should be filled into the an array holding the references for outputting the values.
 
Could someone give me a clue?
 
Wouter
Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 5 of 18
(4,036 Views)

I don't understand your suggestion. Why take the data from the clusters and then duplicate it in the array (and why the references?)? Also, you should trust caption because they can be duplicate.

If you want to know how to get all this from a cluster, use the Controls[] property and go over each element in a for loop. To do nesting, use To More Specific Class to cast the elements to a cluster, and take the Controls[] property from those which don't return an error.

Did you try my original suggestion? Is the variant overhead too much?
And how about using the array?


___________________
Try to take over the world!
0 Kudos
Message 6 of 18
(4,027 Views)

I tried the OpenG ogl_lvdata toolkit. The functioning is correct but the speed is to slow. The bottleneck is in the conversion to the variant data type. To simply search a value of a named control from a cluster containing twenty controls took 2 msec.

In the same time I do all the calculation of my powerplant and the very complex calculation of the powergrid. So I need another solution.

Working with references isn't an option because this also uses the variant as data platform.

Using the control array from the cluster takes 100msec to find all id's from the cluster controls.

The cpu doesn't use cpu time up so I don't see where is the bottleneck here. Is it messagebased?

I have used the tree control to show all members of the cluster. When selecting a member I know which one to output. Now I need a technique to tell it the control loop what to sent on the output.

Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 7 of 18
(4,009 Views)

So again, why not work with a single array for each data type instead of the clusters?

Clusters are apparently just not built to be used in this fashion at these speeds.


___________________
Try to take over the world!
0 Kudos
Message 8 of 18
(4,005 Views)

Hi Woutert,

tst has been doing a nice job of trying to help you but you are limiting our usefulness by not posting any code.

Could you please post your cluster (at the least) and how you are interacting with it?

It sounds like a properly designed action engine that uses an integral look up table and an array of clusters will work nicely....

BUT lacking the details, I can only guess.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 18
(3,983 Views)
Hi,
 
Here you can find a sample of a cluster.
This is one of a classical powerplant in development.
The simulator will be build around these clusters that can be from classical, nuclear, gasturbine, powergrid, OPC connections, simulink etc.
This vi is a simple storage for parameters used in ths simulation.
Ths IO is handled in a separate cluster that is common for the four parallel running turbines.
 
The idea is to show a listbox where the first selection is powerplant 1-4 or grid.
The second selection shows the names of the subclusters and the thirth selection the final member of the subcluster.
It should fill a table holding the selection that can be used later on to put the selected values into the io array.
 
I hope it can be done very fast. I can only spend 1 msec to do the selection/filling the array/ putting the values into to IO-array.
1 msec to do the input/output of this io-array.
 
For the moment the cluster passes through each vi that picks the needed vars and put the results back into the same cluster.
 
Saving the whole cluster in xml or storage space is done in one single instruction. 
 
 
Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 10 of 18
(3,960 Views)