LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change multiple plot names

G'day Guys & Gals,

I am displaying a waveform chart with four plots and a legend
which by default says Plot 0, Plot1, Plot 2, Plot 3 along with the
colors of the plots.

I can change the name associated with the first one using by
connecting a string up to the waveform chart's Plot.Name property.

However, I cannot see a way of connecting to the plot name
properties of the other 3 plots. I want to connect strings to all the
plot names. Can anybody help me?

Thanks
Alf Katz
Message 1 of 7
(4,706 Views)
On Wed, 10 Jan 2001 00:27:34 GMT, alfk@removethis.cfcl.com.au (Alf
Katz) wrote:

>G'day Guys & Gals,
>
> I am displaying a waveform chart with four plots and a legend
>which by default says Plot 0, Plot1, Plot 2, Plot 3 along with the
>colors of the plots.
>
> I can change the name associated with the first one using by
>connecting a string up to the waveform chart's Plot.Name property.
>
> However, I cannot see a way of connecting to the plot name
>properties of the other 3 plots. I want to connect strings to all the
>plot names. Can anybody help me?
>
>Thanks
>Alf Katz

Found it,
For those that are interested, you must set the active plot
property to the plot number of the legend you wihs to change, then
change the string. This is done by connecting to the
active plot
property above the plot name property within the same group of
property nodes (which are evaluated top to bottom)
Regards
Alf Katz
Message 2 of 7
(4,708 Views)
Nicely done.  Your entry saved me who knows how much time...
 
I ended up using a For Loop to implement your solution and it works great with N = number of plots and a separate Plot Name in each Loop Instance. 
 
Little tricks save time and $.  Thanks!!  
0 Kudos
Message 3 of 7
(4,519 Views)

If you're using the names elsewhere, also, try this:

 

1. Create an array of Plot Names (strings)

2. Connect the array to a For Loop with indexing enabled

3. Put the Waveform Chart (in my case) Property Node Plot.Name in the loop and wire it to the indexed terminal (make sure it's set to Write)

4. Put the Waveform Chart Property Node ActPlot in the loop and wire it to the Iteration Terminal through a To Unsigned Long Integer.

John

"Praise the Lord and pass the ammunition."- Lt. (j.g.) Howell Forgy, Sky Pilot, USS New Orleans, 12/7/41
0 Kudos
Message 4 of 7
(3,564 Views)

@HK45acp wrote:

If you're using the names elsewhere, also, try this:

 

1. Create an array of Plot Names (strings)

2. Connect the array to a For Loop with indexing enabled

3. Put the Waveform Chart (in my case) Property Node Plot.Name in the loop and wire it to the indexed terminal (make sure it's set to Write)

4. Put the Waveform Chart Property Node ActPlot in the loop and wire it to the Iteration Terminal through a To Unsigned Long Integer.


You can drag the property node to expand it.  Then you can have a single property node handle multiple properties.  Just make sure the Active Plot is being set first (they do execute in order, top to bottom).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 7
(3,558 Views)

You're right, of course.  I realized why my Plot Names were in the wrong order in the program I'm currently writing and tried to edit my message that I had just posted.  For some reason I wasn't able to edit it, so thanks for correcting it for me! ;o)

John

"Praise the Lord and pass the ammunition."- Lt. (j.g.) Howell Forgy, Sky Pilot, USS New Orleans, 12/7/41
0 Kudos
Message 6 of 7
(3,555 Views)

@HK45acp wrote:

If you're using the names elsewhere, also, try this:

 

1. Create an array of Plot Names (strings)

2. Connect the array to a For Loop with indexing enabled

3. Put the Waveform Chart (in my case) Property Node Plot.Name in the loop and wire it to the indexed terminal (make sure it's set to Write)

4. Put the Waveform Chart Property Node ActPlot in the loop and wire it to the Iteration Terminal through a To Unsigned Long Integer.


 

There is another approach that you can use with Waveform data types that was added after this post was started.

 

Spoiler
Working from memory so correct me where I am wrong!

 

On the Waveform palette you will find a function that will let you set attributes of a waveform. One of the predefined attributes of a Waveform is NI_Channel_Name.

 

Spoiler
Look at the help for the set Waveform attribute function for correct syntax!

 

If you establish the channel name in the Waveform itself, the plot legend will automatically adapt when the chart is updated.

 

I like that technique because;

I do not have fiddle with property nodes

When I present a different set of channels to the chart, the chart will reset and start charting the new set of channels.

 

Please note the Chart property "Ignore Waveform attributes" should NOT be enabled for the above to work.

 

Option:

You can establish the channel names when a task is created and the array of waveforms returned by a DAQmx Read will include the channel names and we can skip the "Waveform Attribute".

 

Just sharing ideas,

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(3,536 Views)