LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to automaticaly move a linear stepper motor forwards and backwards?

Hi,

 

I am using a linear stepper motor to apply loadings on samples, I need:

1. The motor can go forward to apply loadings continuously;

2.  when the loading reaches a setting value e.g. 100 lbs, the motor move backwards to release the loading;

3. record the loading value during the whole process.

 

I can only realize the motor motions by sequence structure, but can not record data simutaneously.

 

I wonder if there is any way to realize this in one while loop.

 

Could anyone help me about this? Many many thanks!

0 Kudos
Message 1 of 4
(2,528 Views)

You can achieve this using 2 Digital Output and a single while loop. See this

 

 

Guru

Regards
Guru (CLA)
0 Kudos
Message 2 of 4
(2,499 Views)
A digital output only solves 1/3 of the task. We also need an Analog Read (for a strain gauge to read when 100 lbs occurs) and a file writing routine. Sounds like three parallel processes to me.
Richard






0 Kudos
Message 3 of 4
(2,481 Views)

Hi,

 

I'd recommend getting rid of the sequence structure--was there any particular reason for having this?  

 

For code structure, I would see some sort of state machine where you are loading the sample, and then checking the load value each iteration.  Once it hits 100lbs, you could move into the unloading state.  You could also incorporate the data acquisition into this.  You could do this all in one while loop.  

 

 There is a template for a State Machine in the New>VI from Templates; I would recommend starting here. 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 4 of 4
(2,458 Views)