LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single-plot cursor tree -- how to programmatically collapse it?

How do you programmatically collapse a single-plot cursor tree?

 

I am saving and restoring waveforms to a waveform graph. Sometimes loading the waveform causes the cursor tree to display collapsed (Example 1), which is desired so the coordinates for both cursors are visible in the legend. However, some waveforms cause the cursor tree to display expanded (Example 2), hiding the lower cursor. I can't even figure out how to collapse it manually. Clicking the minus sign has no effect.

 

Example 1.

cursors collapsed.JPG

 

Example 2.

cursors expanded.JPG

0 Kudos
Message 1 of 4
(2,593 Views)

To programmatically expand/collapse the tree, use the "Open/Close.Item" method shown below. Unfortunately, I don't know why you can't change them manually...

 

tree.JPG

 

------

Matt Kirk

Inventor of ImageJVI

0 Kudos
Message 2 of 4
(2,579 Views)

Thanks so much Matt. I'm back on this project on Thursday. I'll give it a shot then.

 

Regarding operating the trees manually, I've tried opening a new VI, dropping in a waveform graph, making the cursor control visible and creating a single-plot cursor. Even with nothing else in the VI and not even running in a while structure, the cursor is created expanded and the collapse button doesn't work.

 

I'm running LV2010 with the latest fixes (not SP1). Do you see this behavior?

0 Kudos
Message 3 of 4
(2,571 Views)

I've made a mistake!

 

I assumed the cursor-legend was really just a tree, but as it turns out NI has removed our ability to grab the cursor-legend reference since LabVIEW 7.1. Without a reference to the cursor-legend, we can't really do anything like what youre asking. Unless you can find a better answer, I'd recommend circumventing the cursor legend like suggested in this article:

 

https://decibel.ni.com/content/docs/DOC-6495

 

(you may want to rearrange the data into a tree control instead of a cluster array, in which case you'll be able to use my posted code, and you'll be able to manually expand/contract the nodes).

 

------

Matt Kirk

Inventor of ImageJVI

0 Kudos
Message 4 of 4
(2,557 Views)