LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous pulse generating for step motor controlling and hardware switch reading used as a home switch

Hello,
My task is to write a program for controling a monolayer trough for a physical-chemistry experiment.
The system has a step motor who move a barrier across the trough. The motor has a NormalClose switch at one end which is intended as a home switch. At one end of the trough is a pressure sensor mounted who read the surface pressure. The experiment consist in forming an layer on the surface of the trough and compressed by moving the barrier, simultaneous with pressure reading.
The motor has his own driver that accept digital puses for control. One line is for clock, one clock pulse advance the motor with one step, and the other line control the step direction. The signals are TTL type.

Generating the clock is done. Is one VI.
Reading the home switch and toggling the direction pin is done. Another VI.
Reading the pressure sensor it is done. Another VI.

Now the problem(s):
At one button click i should have the following sequence:
a) toggle the direction pin to HI level;
b) generating pulses until the home switch is pressed;
c) toggle the direction pin to LOW level;
d) generating a given number of pulses;
e) for each pulse to read the preasure sensor and plot the value.
f) save the preasure values.

The available hardware is PCI-6251.

Best regards,
Gabriel
0 Kudos
Message 1 of 2
(1,965 Views)
Hello cfratz,
a) toggle the direction pin to HI level;
you could use a event-structure to start the task

b) generating pulses until the home switch is pressed;
that could be difficult. You could  use a switch that is switched until released.
That could be configured in the property's of the button

d) generating a given number of pulses;
when you let a counter count the time of the pushed home button. While loop with a delay of 1 second and a shiftregister that add 1 erverytime.

e) for each pulse to read the preasure sensor and plot the value.
That could be realized in a waveform chart that get the parameter from the whileloop.

f) save the preasure values.
save the values in a spreadsheet.

Hope that helps

regards
Arsala
National Instruments
0 Kudos
Message 2 of 2
(1,926 Views)