Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Stepper Motor while Reading Encoder

Solved!
Go to solution

Hello,

 

I'm attempting to generater a pulse train to control a stepper motor driver, and in parallel read in the pulses from the encoder of the motor. I've been able to create two seperate vi's that accomplish these taks individually, but when I bring them into one program (as seen below) is where I'm running into resource issues. I beleive I'm having issues setting up my timers correctly and that is why I'm encountering these issues. I'm using a NI 9401 to generate the pulse train to the controller and a NI 9402 to read in the pulses from the encoder. If possible I would like to consolidate down to just using the NI 9401 for both inputs and outputs if possible. Both are plugged into a NU cDAQ 9172 backplane. Any help and/or suggestions would be greatly appreciated on what I'm doing wrong. 

 

 

Code

0 Kudos
Message 1 of 5
(7,847 Views)

Hi ee_hokie,

 

The cDAQ 9172 has two counters, try to use one for the Counter Output Task and the other one for Counter Input Task.  According to the diagram that you posted, you're using the same to generate and to count the pulse from the encoder so you will have reserved resources issues.

 

Best,

 

Carmen C.

 

 

0 Kudos
Message 2 of 5
(7,816 Views)
Solution
Accepted by ee_hokie

 

Thanks for the suggestion Carmen, but I was able to figure out what the issue was with a little help from NI. The finite number of pulses timing function requires 2 counters, therefore when I tried to read in the encoder data there where no more counters left on the backplane. Changing the pulses to continuous solved my issue. I'm going to grab a newer backplane with 4 counters from the lab which should allow me to run the finite number of pulses and read the encoder data in at the same time.

 

 

Thanks again,

Doug

0 Kudos
Message 3 of 5
(7,810 Views)

CAN U PLS SEND ME THE CORRECT  VI FOR ME SO THAT IT WILL BE HELPFUL FOR ME AS I M DEALING WITH  THE SAME PROBLEM

0 Kudos
Message 4 of 5
(7,339 Views)

Hello,

 

It appears that you are posting on a thread that was answered about a year ago.  In order to allow for better visibility from our engineers, as well as help us document the types and volume of support questions we take, we request that you create a new post on the front of the forums asking your question.  You are still encouraged to link this thread as a reference for your questions on your new post.

 

Thank you!

 

Nick A

Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(7,316 Views)