LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting plots using a ring control

I am trending historical data by reading the traces of Tags in the DSC module. I am trending 6 different plots but I would like to have one graph that trends one plot depending on the plot I select in my ring control (like a pick list). This will save having to show 6 different graphs on my front panel. I would also like to show the max, min, and average of the plots I selected for analysis. I have attached my vi which shows clearly what I’m trying to do.

I’m having trouble using the ring control to properly select my plots and analyse my data: Error 1077 at Property Node – invalid property value! If anyone can see a quick fix to this problem, I would be very grateful.

Thanks for the help,

Stuart

0 Kudos
Message 1 of 8
(3,707 Views)
Your problem is with your use of Number to Boolean Array. It will translate 5 into a an array of 16 elements (10100...) and not into 000010, as you want. This causes your loop to run 16 times and to try to select plots which don't exist. What you should do is control the number of iterations using the number of plots property, and inside the loop compare i to the the ring and feed the result into the Visible property.

___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(3,689 Views)
Thanks tst, could you elaborate on how i compare the number of plots to the ring in order to feed into the Visible property? I am still a little unsure on how to code this. Also, do you have any suggestions for my Value output property in order to get the right max/min/average analysis? Will this come automatically with the correct inputs? If you (or any reader) can offer an example to help me picture this a little clearer, I would be very grateful. Thanks for the continuing support, Stuart
0 Kudos
Message 3 of 8
(3,679 Views)
Here is a sample using graphs in 7.0 format.
0 Kudos
Message 4 of 8
(3,664 Views)
Your original VI might have implied that you only wanted to display the plot that was selected. In that case, you can use modified version of unclebump's VI below. You should do some initialization as to which plot gets displayed based on the initial ring's selected value. Otherwise unclebump's VI is the way to go.



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


@stuart wrote:
...  I am trending historical data by reading the traces of Tags in the DSC module. I am trending 6 different plots but I would like to have one graph that trends one plot depending on the plot I select in my ring control (like a pick list). This will save having to show 6 different graphs on my front panel. I would also like to show the max, min, and average of the plots I selected for analysis. ...

Stuart,

If you are interested in only plotting one trace at a time (without the option of adding an overlay), why read all 5 or 6 traces with Read Traces.vi and pick out the one ? Why not just read the 1 trace that is selected using Read Trace.vi. To do this, you'd just use the value of the ring selector to index out the tag of interest from your tag array. No need for the For loop, no need for a legend with 5 or 6 plots. The ring indicates what is plotted.

If you are actually interested in plotting one trace, but have the ability to add other traces, you're better off expanding on unclebump's example.

Other things:

1. The indicators for the max, min and mean have Datasocket connections to tags. That means they're getting values from two places. That can lead to confusion.

2. If your computer is ever going to be on continuously for 50 days, your use of Tick Count (ms) will lead to problems (it rolls over back to zero, check the detailed help).

3. With the code as is, it looks like every 5 seconds it's reading the Citadel database for a bunch of data. I don't know how much data is associated with your tags, don't know how fast a computer you have and Citadel may have improved in terms of speed of getting data between v6.1 and v7.1, but if you notice slowness with your HMI when this code is running you may want to do something like the following:

Do a full read from Start Tme to End Time only when either of "Select History to Plot" or "Show Previous x Days" changes value. Keep the last value of End Time in a shift register. Use that value as the Start Time for your next read. Concatenate the new times and data with the previously read. Occasionally slough off old times and data from the beginning.

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 6 of 8
(3,642 Views)
Excellent info Donald - thanks! Just one last question and then i'm sure i'll be clear... I'm going to go for the simplified option by introducing the read trace vi, and ditching the read traces vi. I'm sure this is very simple, but i can't work out how to use the value of the ring selector to index out the tag of interest from my tag array. For instance my tag array has ouput only, so too does my ring control, therefore how is this all wired together? What conversions are required? Thanks for all you help, Stuart
0 Kudos
Message 7 of 8
(3,622 Views)


Stuart wrote:
... my tag array has ouput only, so too does my ring control, therefore how is this all wired together?

Hi Stuart,

Use the 'Index Array' function with the value of the ring used as the index as per attached cheap mockup.

On a side note, I'm making some assumptions about how you're doing these "Day Avg" tags, but the following may apply:

"Get Trace Stats.vi" isn't always the best/correct choice to get the mean value of a trace. Read the detailed help for the VI.  It may have changed in v7.1, but in 6.1 "the average and standard deviation are weighted according to the time duration of each valid input point. The last point in the historical trend is not included in the average ...". Very useful for some traces but not for others (e.g. if you have one Day Avg value per day for a Mon-Fri operation and get the average for 30 days, values for Fridays will be overweighted).  Sometimes it's better just to unbundle the data array from the trace cluster and use 'Mean.vi'.

=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 8 of 8
(3,592 Views)