LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trouble with VI for drawing an arbitrary shape using mouse control.

Solved!
Go to solution

I have attached the vi which i am really struggling with. Basically, i want to select n points using the mouse clicks and then draw a shape connecting those points by using 

a boolean LED to move smothely through points in order and back to the first point. i have noticed that when the gradient between two is negative the LED goes in opposite direction unexpectedly.

I really dont know how to fix this.

 

Any help will be appreciated.

0 Kudos
Message 1 of 9
(3,164 Views)

Hello gurucode

 

 

i changed the code to the best of my understanding

let me know if this helps i added a case structure where you were moving the boolean

 

 

Derick Mathew
Message 2 of 9
(3,138 Views)

thanks a lot Derick, i really appreciate your help.

as you have noticed, when you run the vi and select number of points

it doest move through the points when you finish selecting them. 

I have to turn off the 'new shape' button and

run it again for the LED to start moving.

i want it to start moving as soon as the number of points have finished being selected.

 

I attach the clearly labeled vi.

 

thanks

0 Kudos
Message 3 of 9
(3,129 Views)
-Looks interesting, i can't open your vi.
-Can you post for LV12. By File>>Save for previous version.
Thanks
uday
0 Kudos
Message 4 of 9
(3,119 Views)

here is the vi in the previoius version. L12

0 Kudos
Message 5 of 9
(3,102 Views)
Solution
Accepted by gurucode

Hello gurucode

 

I have made the changes in the VI, once again to the best of my understanding. Smiley Happy

 

Problems with the code (if you have a straight line parallel to the y axis the movement is super fast)

i've left that one for you to play around with set to your liking 

 

PS. If you have some free time, you may want to look into design patterns, they are pretty cool and help manage your code better 

 

Links :

 

http://www.ni.com/white-paper/7595/en/

http://www.ni.com/white-paper/3023/en/

Derick Mathew
Message 6 of 9
(3,083 Views)

Hello udka,

 

Im sorry i saw your messgae relatively late, i see gurucode has submitted the old code in 2012.

I have submitted my latest solution in 2012 as well 🙂

Derick Mathew
0 Kudos
Message 7 of 9
(3,081 Views)

Thank you so much Derrick, that really solves the problem.:smileyhappy Smiley Happy

I will definitely look into the  design patterns. Thanks for the link.

0 Kudos
Message 8 of 9
(3,051 Views)

Glad i could help 🙂

Derick Mathew
0 Kudos
Message 9 of 9
(3,044 Views)