LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing refnum and number of plots in a waveform chart

Hi everyone,

 

I'm new to LabVIEW, I have version 7.1.

 

I have two questions:

1) In "1.vi" (please see attached) I have 5 stacked plots, but I would like there to be 8. What is the proper way to change this?
2) I found one way to change it, but in "vi.2", when I do change the number of plots to anything other than 5, the connection to
"PowerCharts References" breaks. I assume this is because it expects an array of 3 control references to
1D arrays with 5 elements. How do I stop the write from breaking when I make 8 plots, i.e. let
"PowerCharts References" accept an array of 3 Waveform Chart Refnums each with 8 plots?

 

Thanks for any help

Download All
0 Kudos
Message 1 of 13
(5,186 Views)
Sorry for typos, should read "2.vi" and "stop the wire from breaking"
0 Kudos
Message 2 of 13
(5,176 Views)

If you feed your chart with an array of plots (see below), you can wire in any number without breaking the wire. The number of stacked plots displayed can only be changed in the editor (not while the VI is running), so you'll have to size your chart to hold the greatest number of plots you'll ever need (which wastes the space allocated to currently unneeded plots).

 

Untitled-1.gif

SULLutions.com
...when a single discipline is not enough
0 Kudos
Message 3 of 13
(5,151 Views)

Hey SULLutions,

 

Thanks a lot for the answer. If I send in an array, then I get any number of plots. I've modified

1.vi to 1b.vi (attached) and now it shows six. I'll be more clear with what I meant in question (2).  

 

If I take the reference to this new plot now in 1b.vi, with 6 instead of 5, then when I cluster the

references together in 2b.vi and send to "PowerCharts References" the wire breaks. If you see 2.vi,

all three inputs are references to charts with 5 plots, and the wire is not broken. In 2b.vi

however, just by sending the new plot with 6 instead of 5, the wire breaks.

 

How do I stop this wire from breaking when I don't want to use 5 plots, i.e. how can I let
"PowerCharts References" accept an array of 3 Waveform Chart Refnums each without 5 plots?

 

Thanks again

Download All
0 Kudos
Message 4 of 13
(5,135 Views)
Right click on the array indicator of Waveform chart refnums.  Unselect "Include Data Type".  That takes the "(strict)" out of the definition and causes the wire to no longer be broken.
0 Kudos
Message 5 of 13
(5,123 Views)

Thanks for the help. Is there a way to keep the class strict, so instead of it expecting references to

charts with 5 plots have it expect refences to charts with 8? I don't see why 5 is the magic number

or where 5 was set in the code.

0 Kudos
Message 6 of 13
(5,113 Views)

I have no idea what would make 5 special and 8 not.

 

But the question is, is there a reason you need to keep the references strict?

 

Waveform charts are such a special type of control with so much more complexity in their definition when compared to other datatypes, I'm not surprised you'd have issues with the strict definition.

0 Kudos
Message 7 of 13
(5,101 Views)

Hey,

 

I've been uploading only an example of what is in the code that I'm working with.
The entire program is very complex and there are far too many SubVIs for posting
it to be useful. Instead I'll attach screenshots.

 

First please see image 1. This is a subVI in my program which takes, among other inputs,
"AmpAlarm References" shown in 2.vi and 2b.vi I posted above. You see that right at
the start of this SubVI, each of the 5 elements of this array are separated and sent
to other SubVIs.

 

Now look at image 1b. If I make this not strict, the wires break because obviously
it wants to separate the indices of an array.

 

However my goal is to change the program so that, instead of having 5 plots, it has 8.

 

Further down in this same subVI, you can see in image 2 that I cluster together 5 doubles
and send this to "Value". Because this is a strict class, we know that Value is a cluster
of 5 elements - it has to be 5 (see the help window). Obviously then if I make one of them
have 8 (image 2b) there is an error. I can remove this by making the class not strict
(image 2c) but as I showed earlier it must be strict in this program.

 

I hope this explains my situation more clearly. Perhaps there is also an alternate solution?

 

Download All
0 Kudos
Message 8 of 13
(5,073 Views)
Here are the other 2.
Download All
0 Kudos
Message 9 of 13
(5,072 Views)

I can't see exactly what you're trying to do, but it seems to me you're making a lot of things more difficult than they need to be.

 

To start with, according to the detailed help:

Index Array Details

... By default, if you do not wire any index input terminals, the first sub-array indexes row 0, the second sub-array indexes row 1, and so on.

 

That means that you can eliminate the clutter of trying to squeeze all those indices onto the multiple copies of Index Array. (The help doesn't say so  explicitly, but I believe that you can use this shortcut with an offset as well: if you wire n to the first index terminal and leave the next three unwired, you'll get items n, n+1, n+2, and n+3. But all your array building starts with item 0, so this doesn't matter for now.)

 

 

Secondly, you seem to be doing the same thing to each element of the array and arraying the the various processed outputs. If that is the case, you can make your code much more explicit, much more compact, and much more flexible by using a self-indexed For Loop as indicated in the drawing below. (Without your VI it was too much of a challenge to fake all the connections, but you get the idea.)

 

 

Finally, if you intialize all your waveform charts with 2-D arrays, then you can wire 5-trace or 8-trace data into any of them without breaking wires, as you can easily demonstrate with my earlier example. The drawing below shows that this array approach can work just as well (with references) as the cluster approach you took and it allows for the multiple inputs you need.

 

Simple.gif

SULLutions.com
...when a single discipline is not enough
0 Kudos
Message 10 of 13
(5,051 Views)