LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

snap cursor to baseline

Hi:

I wrote some simple code to snap cursors to baseline (cursorY = 0) but works on one graph I have but not the other.  Can someone please try this for me.  Open and run 'frequency_band_dialog.'

Thanks,

Don
0 Kudos
Message 1 of 5
(2,606 Views)
When cursors are set to "Lock to Plot", if the Cursor.PosY value is not an exact match for a value in the array it will not move. Exact matches with dbls are pretty hard to come by. What you can do is first set the cursors to "Free", move them, and turn "Lock to Plot" back on. When you turn it back on, the cursors will then move to the nearest actual point on the plot. The other way to do it is to write to the cursor index property, then you can leave "Lock to Plot" on. This is the method I prefer.

Message Edited by Dennis Knutson on 06-08-2006 10:44 AM

Message 2 of 5
(2,602 Views)

Well here is what I did to attempt your scheme (your first one) and it did not seem to have any effect.  I don't see how I can use the 'cursor index' scheme becuase I need cursorX to stay put.  But still I tried it just substituting 'cursor index' for 'cursor.posY' in the image attached and still could not get the cursors to move.  Any thoughts?

 

Don

0 Kudos
Message 3 of 5
(2,591 Views)
Sorry, I misunderstood a little, tested it incorrectly, and forgot a basic principle. Actually, you are going to have to have the x move at least a little if you want to keep lock to plot on. Say the coordinates of the cursor are 1.35/2.67. If you change it to free and set the coordinates to 1.35/0 and then change it lock, it will lock the cursor's Y position at whatever the current x position is and you're back to where you started. So, the question is, where in the x direction do you want to place the cursor with lock turned on?
0 Kudos
Message 4 of 5
(2,585 Views)

X needs to stay where it is originally which is now what I see is creating the problem.  After all, if lock to plot is on, as you said, there is no way to snap the cursorY position to 0 while keeping cursorX position the same. What I decided to do as a workaround is unlock the plot and then during the first move of the cursors after that, relock them to the plot.  This will accomplish what I need.  My bad - a case of not seeing the forest thru the trees.  Thanks for helping me think thru the obvious.

Sincerely,

Don

0 Kudos
Message 5 of 5
(2,577 Views)