12-25-2005 04:55 PM
12-26-2005 01:20 AM
12-26-2005 03:04 AM
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.
12-26-2005 04:59 AM
12-26-2005 02:57 PM
12-26-2005 04:03 PM
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?
12-28-2005 01:50 PM
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.
12-28-2005 02:10 PM
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.
12-29-2005 12:00 PM
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
01-03-2006 01:17 PM