From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

step movement to continous movement

hi,

   In my project i am using a microscope and to move the stage which is attached to the microscope i am using boolean button with build array and arthimetic or to move one step each time we press the button of all the 3 axes,so now i want to change the step movement to continous movement. Untill i press a stop button the movement shouldnt get stopped. can anyone one give me an idea of how to proceed

0 Kudos
Message 1 of 8
(2,377 Views)

Just use a WHILE loop to send a command to the stage to move it.

0 Kudos
Message 2 of 8
(2,365 Views)

@nyc_(is_out_of_here) wrote:

Just use a WHILE loop to send a command to the stage to move it.


With an event structure inside the WHILE loop that detects a mouse down event on your move button.  Inside that event, send your command to move.  You may need to throttle the speed of the loop to prevent moving too fast and crashing your stage.

 

EDIT: I just noticed you want the stage to continue to move until you press a stop button.  That seems dangerous to the stage unless it has limit switches built in!  I thought you wanted buttons to move the stage while you held them down.  The event structure is perfect for such things.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 8
(2,363 Views)

hi,

 Thanks for the reply.Limit switches are in built  in it. For x-axis i have 2 directions and same with y-axis and z-axis. So if i have an event structure in a while loop,i have 3 different axis with 2 opposite directions for each.How can i use these 6 buttons in one event structure.Can u guide me in this

0 Kudos
Message 4 of 8
(2,349 Views)

Post the code you have to send the move command and I can show you how to set up an event structure that will monitor the buttons.  The event structure is very easy to use.  You place it in the loop and then right-click the selector at the top and "Add Event...".  Then you just select the control (whatever is on the Front Panel will show up) from the list and how you want it to respond (i.e.: Value Change, Mouse Down, etc...).

 

Try it out and see what you can come up with...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 5 of 8
(2,338 Views)

hi,

   I am posting my vi. Individually i want to run the buttons continously untill i give a stop button. For that how can i use event structure and for that how many cases should i create.Can you guide me

0 Kudos
Message 6 of 8
(2,322 Views)

OK, it appears you are VERY new at LabVIEW.  The use of multiple nested sequence structures makes your VI nearly impossible to understand.  You will hate yourself later if you ever have to modify or update your code if you continue this way. 

 

Let me see if I have your needs understood correctly.

You want to move an XYZ stage in three axes while you monitor an image provided by a camera pointed at some object on the stage, is that correct?

 

Why do you want to press a button and then have the stage move until you press another button?  Would it not be better to hold down a button and have the stage move until you let go?  This way you could even map some keyboard keys and use them to control the stage.  Quick taps on the buttons would "nudge" the stage, holding it down would move it smoothly.

 

You did not include the SubVIs so all I can see is the top-level code.  Even still, I don't see any code that would actually send a command to a servo motor.  What hardware are you using for motion control?

 

BTW, what version of LabVIEW are you using?  I have 8.5 and 2010.  Can you open version 2010 VIs?

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 7 of 8
(2,307 Views)

hi,

   Thank you for the reply. About the boolean buttons which i am using there,it is the client who needs that if he clicks on x+ button the x-axis has to move in the + direction untill they give a stop button. I am using labview 2010 version. I have used build array with 6 boolean buttons,if i have an event structure,the event structure starts the process when the command is given to it. Here i want to run each button till i give a stop command to it. Can you suggest any ideas.

0 Kudos
Message 8 of 8
(2,295 Views)