LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control stepper motor with buttons

Hi,

I am quite new to labview (have been using it for about a week) and am charged with the task of writing a program to control 2 stepper motors (eventually 3 in an x,y,z config).  I have searched this forum and found little tidbits to help me on my way but am now at a bit of a loss as to how to solve my new problem.

What I want the program to do is: be able to move the 2 stepper motors to a 'loading' position, perform a 2D scan, move back to the home position, and abort the 2D scan.  So far I have written a program that moves the stepper motors to the defined 'loading' position, perform the 2D scan, and move to the home position.  My problem is that if I click the button to move the motors to the home position, the button that moves the motors to the 'loading' position no longer works.  I want to be able to perform any of the mentioned operations at any point in time (i.e. move back and forth from 'loading' to home)  which is just not happening. 

Also the stop button I have just doesn't work or ends up stopping the entire VI, which is not what I want.

As I've said I'm very new to labview and am learning it as I'm trying to program.  I have attached the best version of my program for others to look at and give advice/pointers/etc...

Thanks

RJ

PS the program was written in labview 8.2 if that helps
0 Kudos
Message 1 of 7
(3,280 Views)
ok, would just like to say that I've fixed my problem with being unable to move from 'home' to 'load' and back again by changing the architecture to event handlers, but am still looking for help on breaking my while loop for the scan...i.e. I want to be able to abort the scan with a separate button.

cheers
0 Kudos
Message 2 of 7
(3,259 Views)

I'm no expert, but perhaps you can move the Stop button terminal on your block diagram to the 4th frame of your Stacked Sequence, inside the (outmost) "Perform 2D scan" While loop.  And wire it to the conditional terminal (red stop sign).

Andrew

0 Kudos
Message 3 of 7
(3,253 Views)
Like I said, I ended up changing the structure to event structures and have the buttons working well but am having some trouble working in a 'stop scan' button into the scan event - I want to be able to abort the scan while it is in process.  Have posted my most up-to-date version of the program incase anyone wants to take a look and give some pointers.

cheers

RJ
0 Kudos
Message 4 of 7
(3,231 Views)
I would suggest you put another boolean "or" into your while loops to stop them also with the button press.
0 Kudos
Message 5 of 7
(3,228 Views)
Blanky

I think I did what you suggested properly however I am unable to do anything on the front panel until the scan is completed...so evidently the button doesn't work still.
0 Kudos
Message 6 of 7
(3,214 Views)
ah ok, I misunderstood you in that, sry.
 
I think our problem could be similar to my current problem, where I also cant do something on the interface during the loop process.
 
If you want you can follow the thread, maybe we can find a solution.
 
0 Kudos
Message 7 of 7
(3,210 Views)