10-27-2015 02:38 PM
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?
Solved! Go to Solution.
10-27-2015 02:52 PM - edited 10-27-2015 02:57 PM
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…
10-27-2015 03:27 PM
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
10-27-2015 04:06 PM
10-28-2015 04:44 PM
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.