01-09-2009 05:52 AM
Dear all,
I have some problems playing around with dragging of cursors.
In my application i have a graph with 2 cursors. There is 1 Primary Cursor(Black Color) which can be moved anwhere on the graph. And another one(in Green) cannot go to the left of Black.
On "Cursor move" event(for green), whenever the X value of the cursor is less than the Black, i make the value of Allow Drag to False. But its not working,
Could you pls have a look at my Vi and suggest me some alternative.
Thanks,
Ritesh
Solved! Go to Solution.
01-09-2009 11:16 AM - edited 01-09-2009 11:16 AM
Here's one possible solution.
(Of course you can still drag the black cursor above the green, so you would need more code to disallow that too).
( Often a better solution is to just use two cursors of the same color and let the code determine which one has the smaller x, e.g. to operate on the data between the cursors)
01-09-2009 11:26 AM - edited 01-09-2009 11:26 AM
Sorry, of course you should get the x directly from the event terminal. No need to unbundle. 🙂

01-15-2009 08:42 AM
Hi Altenbach,
Thanks alot for your reply. That did Help. 
I am almost done with that mini VI that i was asked to do.
It would be really great if anyone of you could have a look at it and comment on my Programming. 
See if there's any place where i could make it more professional/robust/efficient. I have tried alot not to use Local variables much. But as i dived into the world of LabVIEW not more than 4 months ago, i couldn't resist myself of using it. 
Any sort of Help on improving the VI will he Helpful.
I am attaching the .rar file. FWave.vi is the main VI.
Thanks,
Ritesh
01-16-2009 01:31 AM
01-17-2009 05:17 AM
01-17-2009 06:10 AM
Some pointers:
01-17-2009 06:46 AM
Hi TonP,
Thanks alot for taking your time out to look at my code.
I implement the suggetions you posted except the 3rd one.
What is this "initialization structure"?
I looked into the Functions Pallete and cudnt find any structure by that name .
I am using LabVIEW 8.5
Thanks,
Ritesh
01-17-2009 09:09 AM
I am a big fan of state machines. In such a state machine you would have an intialize state that is executed first before everything else.
One easy way to create state machines is the State Diagram Toolkit (only available for LabVIEW 7.x) that let you draw the state diagram.
Optional you could download JKI State Machine.
Ton