Currently i am using the 6024e card to do quadrature counting from a rotary encoder to obtain the distance travelled when the encoder rotated.
However i need to obtain the velocity. How do i obtain time from the DAQ 6024e card?
Currently i use these functions to obtain and print the number of counts from the encoder.
/*ND_COUNTER_0 for right wheel*/
GPCTR_Control (1, ND_COUNTER_0, ND_RESET);
GPCTR_Set_Application (1, ND_COUNTER_0, ND_SIMPLE_EVENT_CNT);
GPCTR_Change_Parameter (1, ND_COUNTER_0, ND_UP_DOWN, ND_HARDWARE);
GPCTR_Change_Parameter (1, ND_COUNTER_0, ND_INITIAL_COUNT, 10000000);
GPCTR_Control (1, ND_COUNTER_0, ND_PROGRAM);
/*ND_COUNTER_1 for left wheel*/
GPCTR_Control (1, ND_COUNTER_1, ND_RESET);
GPCTR_Set_A
pplication (1, ND_COUNTER_1, ND_SIMPLE_EVENT_CNT);
GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_UP_DOWN, ND_HARDWARE);
GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_INITIAL_COUNT, 10000000);
GPCTR_Control (1, ND_COUNTER_1, ND_PROGRAM);
/*ND_COUNTER_0 for right wheel*/
GPCTR_Watch (1, ND_COUNTER_0, ND_COUNT, &counterValue1);
printf("The initial count for right wheel is %d\n", counterValue1);
/*ND_COUNTER_1 for left wheel*/
GPCTR_Watch (1, ND_COUNTER_1, ND_COUNT, &counterValue2);
printf("The initial count for left wheel is %d\n", counterValue2);
Now i need to obtain the a certain time interval for example 50ms. How do i do that?
regards,
Leroy