LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turning loca variable into reference

Hi,
 
is there an element in Labview 8.0.1 where I can connect a local variable as input and get a reference as output? Or is there a possibility to create a reference to an array element?
 
What I want to do is the following: We have a program for testing four of our units in parallel at four testing places. At the moment we have for all input and output parameters four front panel elements (e.g: system number 1, system number 2, system number 3, system number 4; system type 1 ... system type 4). What I want to do is to make an array, put in a cluster and put in all front panel elements - then I can have the needed frontpanel elements just by increasing the shown array.
 
To access the front panel elements I want to use references.
What I would like to do is to connect the array to an autoindexed For-loop, unbundle the cluster, change all the values to references, change all the references to higher class, put them all in an array and bring them out of the for-loop with an autoindex. Then I have a two dimensional array where one array is giving me the number of the testing place and one giving me the frontpanel element.
 
The other possibility would be to create the references to the frontpanel elements manually and then put them together in an array. But if I create a reference to an element in the array, I just get a reference to the last value - what I would need, would be an array of references. How can I create those?
 
I hope my problem is clear - would be great, if anyone has a solution.
 
Regards,
Frank
0 Kudos
Message 1 of 8
(3,285 Views)

As for references to array elements, we have tried something:

http://forums.ni.com/ni/board/message?board.id=170&message.id=213030

0 Kudos
Message 2 of 8
(3,258 Views)

Hi - i attached you here a screenshot about the attached SetClusterArrayElement.vi - where you see how connected property node to the array of cluster of the frontpanel - you set a new property node from blockdiagramm pallett -> applications control menu and rightclick to property node, then connect/link to and then select here the cluster element/reference like in screenshot. Run the SetClusterElement.vi and you see how yout set the new values programmatically...

Hope this help you. Please let me know if it solve your problem

Best Regards AE Munich

 

0 Kudos
Message 3 of 8
(3,258 Views)

Hi,

thanks for the help. The problem is: You use a cluster and put in arrays. What I would like to do is to use an array and put in a cluster with different frontpanelelements.

But your help brought me on the right track.

 I attached my example.  The problem is: as long as the cursor is in the first array element it works fine (e.g. if I set the cursor in the first numeric field in the first array element, or in the string element of the first array element)) - if i set the cursor in the last element, I only get the value of the last element.

Do you have an idee, how I can solve this problem?

Kind regards,

Frank

0 Kudos
Message 4 of 8
(3,252 Views)

In the discussion i linked above, we have solved the problem by making the array 1 element wide (only 1 element is shown at a time). This way the cursor is always there!

If you need to show the array, then create a copy of it. Make the original array (the one you write to) invisible, and after every update copy its content to the other array (the visible one).

0 Kudos
Message 5 of 8
(3,249 Views)

Hi,

thanks! That sould do it! Perfect!!

 

Kind regards,

 

Frank

0 Kudos
Message 6 of 8
(3,243 Views)
Hi all, this is the solution. Run the programm and you see that the Cluster with index in inner element of "Indexwerte" is set in the "Array" - set the index of "array" to 0 and see that your Cluster is set with values of "cluster" on the right side
0 Kudos
Message 7 of 8
(3,238 Views)

Ahem, no, that's not the solution Smiley Tongue

Focus stays on the last slot you clicked. Try to click the 3rd visible element, and it will always update the 3rd visible element, no matter how you shift the array. ArrElem.KeyFocus does not do the trick, that's why we needed the 1-slot array

0 Kudos
Message 8 of 8
(3,214 Views)