Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting and Outputting In The Same Program

Hello Eveyone.

 

I'm using a Daq 6211 to count the pulses of two quadrature encoders. With this same Daq 6211, I now want to control two hobby servo motors which both use PWM as their control technique.

 

I have successfully created separate V.I's in which I can count the encoder values just fine and another to control the servo's. 

 

My problem arises when I want to use both in the same VI. I know there are only two counters on this DAQ 6211 and therefore one encoder and one servo are sharing the same clock. I also understand I can't output a PWM signal and count in from the encoders at the same time.

 

I'm using them in State Machine however and both will never be running simultaneously but rather in different states. When i transition from the encoder state to the servo state i get the error. 

 

"NI Platform Services: The specified resource is reserved. The operation could not be completed as specified."

 

I know why this is happening but does anbody know of a way to use counters in such a way, ie to count and to output in different parts of a VI??.

 

Thanks in advance.

0 Kudos
Message 1 of 2
(5,502 Views)

Hi Banjo_B,

 

I would think that this problem is due to incorrectly closing the references before changing the state.

Would you be able to put the code up that you are using? We might be able to implement a different way to write your code so that you can get this to work. 

However you must be aware that due to the non-deterministic nature of the USB-6211, it will never be able to completely accurately control servo motors as there is there is likely to be jitter.

 

Regards,

Nathan
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(5,491 Views)