LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

References in LabView 5.1

Hi,
I am trying to build an array of graph indicators, so that I could traverse it in a loop and write data to each one of them. That way I dont have to write same code multiple times, for each graph. However, I cant successfully insert indicators into an array, I get a broken wire. Creating references to those graphs and inserting them into the array would be one way to accomplish this, but I cant find a way to create a reference in LabView 5.1 . Are there any other ways I can do this, or is there a way to create a reference for an indicator in LabView 5.1? Please Help. Thank you.
0 Kudos
Message 1 of 8
(3,487 Views)
Why not use a local variable of the graph and write that to the array?
(Right click terminal->create->local variable
Right click local variable and Change to Read.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 2 of 8
(3,487 Views)
Thanks for your answer. I have tried local variables, however, I want to write to the graphs in the loop. Which means that I have to create local writing varibales, and those cannot be put into array. (remember that I want to write to graphs in a loop to simplify code). Now, if somehow I could create a reference to a local writing variable and put those into array...but in that case it would be easier to create reference to graph itself, which I dont know how to do in LabView 5.1
0 Kudos
Message 3 of 8
(3,487 Views)
Hmmm, maybe if you uploaded an example it would help.

What about changing the graphs to controls, using them as array inputs and using the locals as Writes to serve as indicators?


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 4 of 8
(3,487 Views)
> I am trying to build an array of graph indicators, so that I
> could traverse it in a loop and write data to each one of them. That
> way I dont have to write same code multiple times, for each graph.
> However, I cant successfully insert indicators into an array, I get a
> broken wire. Creating references to those graphs and inserting them
> into the array would be one way to accomplish this, but I cant find a
> way to create a reference in LabView 5.1 . Are there any other ways I
> can do this, or is there a way to create a reference for an indicator
> in LabView 5.1?

The reason you can't put the graph in the array is that you can't
directly have an array of array datatype. The graph adapts to type, but
i
nitially starts out as an array of double. If the datatype for the
graph will be something not an array, wire that up first, then drop the
graph into the array. If it will be an array, put the graph into a
cluster and place that in the array. This will change the datatype, but
should be easy to match on the diagram.

Another thing that sounds a bit funny. If the indicator is an array,
you wont be updating them in the loop, but rather after the loop. Also
be aware that there will only be one set of attributes for the graph in
the array. Fixed scale or autoscaling work pretty well, but
programmatically setting attributes doesn't work well. A solution to
this is to make a cluster of graphs. You can easily convert array to
cluster on the diagram and use the cluster for the display.

Greg McKaskle
Message 5 of 8
(3,487 Views)
Actually, in retrospect, maybe I focused on the wrong part of the answer. One of the hot selling points of LV is the ability to create highly modular applications through the judicious use of sub-vis. If all this is just an effort to avoid redundant programming, just put the code you want to recycle into a sub vi and call multiple instances of it. This should be a standard approach to programming in Labview, as it makes programs easier to follow and to debug.
~j5


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 6 of 8
(3,487 Views)
You could open a VI-Server reference to the panel required, and from there reset all values to default.

Here is an example. Try changing the values of the controls before running, and observe how they are all reset when executed. Maybe this will suffice for your needs.

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 7 of 8
(3,487 Views)
Wrong post, sorry.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 8 of 8
(3,487 Views)