LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cursor drag issue

Solved!
Go to solution

 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

0 Kudos
Message 1 of 9
(4,210 Views)

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)

Message Edited by altenbach on 01-09-2009 09:16 AM
Message 2 of 9
(4,181 Views)
Solution
Accepted by topic author LVCoder

Sorry, of course you should get the x directly from the event terminal. No need to unbundle. 🙂

 

Message Edited by altenbach on 01-09-2009 09:26 AM
Message 3 of 9
(4,177 Views)

Hi Altenbach,

Thanks alot for your reply. That did Help. :smileyhappy:

 

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. :smileyhappy:

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. :smileywink:

 

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

0 Kudos
Message 4 of 9
(4,131 Views)
Any Help!!
0 Kudos
Message 5 of 9
(4,113 Views)
Still waiting for your reply !! :smileysad:
0 Kudos
Message 6 of 9
(4,095 Views)

Some pointers:

  • Remove the '8' from the case structure wher you set the boolean.
  • Add descriptions to VI.
  • Put the items above the while loop in an initialization structure
  • In the short activation?  event you do a =1 check, just connect the integer to the case structure
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 7 of 9
(4,090 Views)

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

0 Kudos
Message 8 of 9
(4,086 Views)

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 9 of 9
(4,073 Views)