03-26-2015 04:40 AM - edited 03-26-2015 05:06 AM
Hello eveyone,
I know about the "Controls[]" property of the cluster, which allow to read and write algorithmically element in the cluster.
But when I want to make the same for the array of such cluster, I get a problem.
Target: I have a array of cluster in my project in main VI and have lots of VIs which uses this array via reference as global variable. I want to have an option to change this array of cluster (for ex., change number of elements in cluster) at any time and not to spend lots of time while correcting addressing to this array (VIs wants old array of cluster, but gets not what they want).
For example, in Table form vi I try to avoid this partly by using "UI helper".
Using "IndexVals" property on whole array + "Controls[]" on cluster is not an option because in my case it will result in fast switching of array's index on front panel of Main VI.
Please help. In attachment part of my project.
Thanks, Gregory.
PS. I don't need a correction of my VIs. Just provide please general solution of the problem.
03-26-2015 05:12 AM
Hi,
Can't read your VI's. Using LabVIEW 2013 SP1.
BR,
Vincent
03-26-2015 05:24 AM
Sorry. Here is a variant for Labview 9.
03-26-2015 05:41 AM - edited 03-26-2015 05:41 AM
Hi dimitriev,
Target: I have a array of cluster in my project in main VI and have lots of VIs which uses this array via reference as global variable.
When accessing that array from a lot of locations simultanously you will get RACE CONDITIONS. Easily and fast…
Use a FGV aka AE instead to encapsulate your "data object"!
03-26-2015 05:56 AM - edited 03-26-2015 06:00 AM
Slight example please.
03-26-2015 06:19 AM
Had a look at your code and it is very very difficult to follow. It does not help that you have a load of hidden controls and poorly laid out code, and no comments (please look at the LabView Style Guidelines). In the end I gave up trying to work out what you were trying to actually do. However, I am fairly sure that whatever it is you are trying to achieve, you are trying to do so in the most complicated way imaginable!
It might help us to help you if you can give a clear and concise explanation of what you are trying to achieve. Then we might be able to suggest an easier way of doing that than trying to change the number of elements in a cluster on the fly, which you can't do!
Stu.
03-26-2015 10:44 AM
@GerdW wrote:
Hi dimitriev,
Target: I have a array of cluster in my project in main VI and have lots of VIs which uses this array via reference as global variable.
When accessing that array from a lot of locations simultanously you will get RACE CONDITIONS. Easily and fast…
Use a FGV aka AE instead to encapsulate your "data object"!
Another good option sounds like the Data Value Reference. Those work really well if you want to keep a reference to pass around to everybody.