02-22-2019 03:34 PM
I am using an NI-9401 module with a cDaq-9189. I am able to control the stepper motor relative position (both pos and neg direction), but am not able to register direction when measuring position using the counter input. I have set the counter input to count edges. I noticed there is functionality to set the direction to count up or count down. I have tried to use this, but whenever count down is selected, the daqmx read function doesn't work. I believe a negative number is being output and the function is internally setup to output a U32 (even though I selected DBL). I have attached a rough example. Any ideas on how I can accomplish my goal would be appreciated!
02-25-2019 02:35 AM
What is the physical signal that you are measuring on the CI task?
From a single pulse train you cannot determine direction, you simply count up or down on each rising or falling edge.
If the motor has a quadrature encoder output, there should be 2 pulse trains, A and B, 90 degrees out of phase with each other.
You can hook these up to the DAQ and make a task for Counter input->Position-> Angular Position .
0xDEAD