LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change properties inside dynamic stack plots

Is there any way in LabView 8.2 now to change the properties of indicators inside an array or cluster?  I want to change the properties of the waveforms inside DynamicStackPlots (http://zone.ni.com/devzone/cda/epd/p/id/3024).  I see on this forum back in 2005 this was last discussed.  I have also tried making a cluster of waveforms (instead of an array of clusters) from which you can at least separately access properties (allowing you to make specific waveforms not visible, yielding dynamic stack plot functionality).  But you STILL cannot modify, say, the plot min range, label, scale... etc.

All ideas welcome!
Thanks,
Adam
0 Kudos
Message 1 of 5
(3,193 Views)
Hi, Adam.

This question seems to pop up every once in a while. The answers are different for arrays and clusters:

Clusters
You can access the properties using an explicitly-linked property node (IE, one that takes a control reference as an input). You can obtain a reference to the controls in one of two ways:
  - Right-click on the control (inside the cluster) and select Create»Reference.
  - Create a property node for the cluster and access the Controls[ ] property. This will give you an array of references to the controls inside the cluster, and you can pass that into the explicitly-linked property node. (You may have to use a To More Specific Class VI if you want to access properties that apply to only graphs.)



Arrays
Since arrays are for holding a large quantity of indentical data types, the properties for all elements of the array must be the same. If you really want to sidestep this functionality, however, you can always create an array of references to controls. If you wanted to do that, you'd have to create all your controls individually and then create references for them one by one. Once the references are created you can pass them into a Build Array VI. To alter the properties of any particular control, you'd use an explicitly-linked property node and pass in the appropriate reference.

Let me know if any part of this isn't clear. Have a nice evening!

Message Edited by sarahk on 10-25-2006 04:35 PM

Sarah K.
Search PME
National Instruments
Message 2 of 5
(3,174 Views)
Your explanation is superb - thank you!  I had tried to do this with clusters, but got caught not knowing I would need to use 'to more specific class'.

Now that I am rolling, I can do all sorts of wonderful things by writing to a subvi which contains a cluster of waveform charts.  This brings up further questions:
1) This subVI is not 'running' - it just sets up some plot colors and scaling.  The main VI writes to the waveforms via refnums.  If I try to do things in the subVI programatically (by adding things to the block diagram), the programs hang up (depending on what you add to the subVI block diagram, they hang up for good, as you can imagine!)  Should it be possible to have the subVI running at the same time? (see also next questions regarding execution)
2) Should I use reentrant execution here? I do not think so because I want the data in the waveforms to stay the same - I do not want multiple instances of the subVI.  I don't think the subVI is running continuously after it is first called - but I really do not understand what I've done here (obviously) !
3) Can I just continuously call the subVI in the main program's while loop (rather than just once while "setting up"), instead of using refnums?

My ultimate goal here is to actually have partly array functionality (e.g. I want the x-scale on all waveforms to be the same) but also partly cluster functionality (e.g. different colors and scaling on different waveforms)  Should I be approaching this problem differently? 

Note: I am using a subVI because I want my main VI (which is doing data acquisition) to be in a separate window from my sub VI (which displays the acquired data).

Thanks so much for the help!
Adam
0 Kudos
Message 3 of 5
(3,157 Views)
I read your answer to Adams problem with great interest, because it is- except of one difference- the same of mine.
 
The program that I am actually programming works with dynamic stack plots. Even after I integrated your solution, I couldn't solve my problem which is described below:
 
The program shows data the user has selected in different diagrams (I realized this with a waveform chart in an array of clusters). I want to programmatically change the range of the y- scales. Could the fact that I use LabVIEW 7.1.1 be the reason why I couldn't solve the problem? Although I changed my VI like it was shown in the given example for clusters, nothing changed concerning the scale ranges.
 
Thanks in advance for any help,
 
Jingizu
0 Kudos
Message 4 of 5
(3,041 Views)

Hi Jingizu,

The element of an array or array of cluster cannot be a waveform chart. However you can create an array of cluster with a waveform graph. Attached is a sample VI in 7.1 that programmatically changes the range of the y-scale for a waveform graph in an array of cluster.

Tunde

0 Kudos
Message 5 of 5
(3,010 Views)