05-11-2016 09:15 AM
Hello
Here is an example that diplays a curve and epmploys 2 cursors.
The question is how to "attach" cursors to the curve in order to specify only X coordinate.
Thanks in advance.
05-11-2016 09:40 AM
On Front Panel it can be done by specifying "Single plot" option.
But how to do the same programmatically ?
05-11-2016 09:55 AM - edited 05-11-2016 09:57 AM
The cursors need to be locked to a plot. If you have free cursors, you can calculate Y by interpolating into the data. (or just applying the formula).
Some notes:
05-11-2016 10:07 AM
Thanks Altenbach
The curve generation staff is just for example ... cursor handling I use in my testbend, where data comes from experiment.
Concerning cursors, is it possible to lock them to a particular plot programmatically, or the only solution via Front Panel ?
05-11-2016
10:11 AM
- last edited on
05-20-2024
07:12 PM
by
Content Cleaner
Yes, use the "cursor.plot" property
05-11-2016
12:58 PM
- last edited on
05-20-2024
07:14 PM
by
Content Cleaner
Actually the Cursor.CursorMode does the job (please see the snippet below).
The value 1 corresponds to Single-plot mode (https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/properties-and-methods/vi-server/generic/c...
Also it should precede Cursor.Posx.
If I correctly understood, the Cursor.Plot selects to which plot cursor will be locked.
I've tried to check it by adding 2nd plot.
Surprisingly, the 2nd plot is displayed, but 1st is lost (please see screenshot below) !
Any ideas ?
Thanks
05-11-2016 01:06 PM - edited 05-11-2016 01:07 PM
You are not setting the Cursor.plot, so both cursors go to the same plot.
You are only seeing one plot because you are not autoindexing on the output tunnel of the first FOR loop. Only the plot from the last iteration is currently retained.
Also, once you set the cursor mode (via properties or property node) you don't need to call that property ever again, so why is it even in the loop
05-11-2016 01:09 PM
Your for loop executes twice, but there is no autoindex on output tunnel and first iteration is useless.
05-11-2016 01:13 PM - edited 05-11-2016 01:14 PM
05-11-2016 01:24 PM
Yes !
Tunneling mode resolves the issue with non-displaying of the 1st curve.
Concerning cursor handling, my results are different from yours (please, see the screenshot below)