03-18-2015 10:01 AM
hi,
first sorry for my english.
i want to make an experiment set-up. drawing of it is attached. i have stepper motor, sensors and usb-6008. stepper motor moves the sensor board into the pipeline.
(for exp.) i want to send 100 signal to the motor and every 100 signal i want to measure sensor voltages.but movement must be continously.does not interrupt.
so i must know the sensor's location and the voltage at the same time. (sensor is hall sensor. operates 0-5 V)
if you help me i would be happy. thank you
my program is attached.
03-18-2015 04:40 PM
My recommendation is that you need some training. You didn't mention what you native tongue is, but if yoiu don't feel comfortable in English you should check online or with your local NI office for tutorials. In terms of the code you posted, the logic is seems to be manipulating the individual digital io lines to step the motor. This will work, but you need to get rid of the express VIs, in this situation they are very inefficient and may have bad side effects.
First rather than manipulating 4 individual bits, modify the code so you are working with one 4-bit port. This change will be more efficient and make it easier for you to identify logical errors in your stepping logic. What you want to do is initialize the DAQ one time outside the loop, manipulate the port outputs as needed inside the loop and then close the DAQ task when the loop finishes.
How fast are you needing to step this motor? A PC will limit your speed and is very nondeterministic in terms of response time.
Mike...