LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display Waveform Graph Plot Name in Cursor

Solved!
Go to solution

I want to have a cursor on my waveform graph that will display the X and Y values as well as the Plot that it is retrieving the values from.  Attached is a vi that almost works.  It gets the values and displays them correctly.  The problem is the plot name.  It is shown the section of code at the bottom of the vi that is getting the active plot name.  The issue is that when you run the vi the name sometimes has the correct name and other times it is empty.  It depends upon moving the cursor somehow.  The empty ones are why I have the 2 traps after the active plot.  I notice that in the cursors legend that the name is always correct.  

How can I get a consistent name for the active plot to display?

 

 

0 Kudos
Message 1 of 5
(3,333 Views)

Hi Mick,

 

did you check why you have to replace "" by "None"? Did you do some basic debugging?

 

Your VI would greatly improve from using event structures: you could react on cursor moves instead of plain polling.

You can also use functions like FormatIntoString to clean up your VI. There are color constants to easy color selection…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,327 Views)

I must not have been clear.  I added the case statement you are mentioning to handle the problem I'm trying to avoid.  

The issue is that sometimes the Plot.Name result is blank ("").  I think it should always have a valid value of the plot it is pointing to.  I simply added the case statement to show "none" instead of the "".

If you move the cursor around while the vi is running you will see that the value for name sometime goes to "none" instead of a valid plot name.

 

Mick 

0 Kudos
Message 3 of 5
(3,310 Views)
Solution
Accepted by topic author MickF

Hi Mick,

 

you were clear…

 

The issue is that sometimes the Plot.Name result is blank ("").

No, that's not the point. WHY is the plot name empty? Did you check that?

 

Did you try an event structure by now?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,295 Views)

I rewrote the vi with an event structure and it works as expected now.  Thanks for the advice.  

I attached the modified vi for reference.

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