Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

read multiple counters

I'am using a DAQ E-series board and reading the two counters separately I can find the position and the speed of the X, Yaxes. But when I tried to the two couters at the same time, there was a problem and the results are ridiculous, why? Hoping your advice, thanks in advance!!!
0 Kudos
Message 1 of 8
(4,322 Views)
Please provide me more informations so that I can answer you accurately :
- What kind of signals do you want to acquire ?
- Is there a signal for your X coordinate and a signal for the Y coordinate ?
- Do you count edges or do you measure the signals frequency ?
- Are you a LabVIEW user or a LabWindows/CVI user?
- What kind of NI-DAQ API do you use ? DAQmx or Traditional NI-DAQ ? What is the version ?
- What is your card reference ?
- What is your operating system ?
- Why are saying that the results are ridiculous when you use two counters ?

Benjamin CHARLES
Applications Engineer
National Instrument France
0 Kudos
Message 2 of 8
(4,322 Views)
Thanks a lot, Benjamin,so I'd like to detail on my application:
I'am working at a robots with 3 axes(x,y,z) equiped with encoder,I need to collect the signals from the 3 encoders: sequences of pulses. I use the card SC-2345 in the environment of LabVIEW 7.0,NI,DAQ7, Windows NT . what I count to do is to use the two counters in the card to count the edges to find the positon(connection for counter0: PF18,DIO6, DGND), I need to mesure the frenquence to find out the velocity(the resolution is given: V= F(pulse/second)*Resolution(mm/pulse))=F*R(mm/pulse).
Actually I modified the count digital events.vi and it works with when I read only from one counter,When I tried to read from 2 counters at the same time, I can only get the results from one couter, in the
help document it says: to read from multiple counter simutaneously, use a separate task for each counter. but I don't understand well how to creat a separate task for each counter.
so I'am asking for help here for this kind of application.
0 Kudos
Message 3 of 8
(4,322 Views)
Thanks a lot, Benjamin,so I'd like to detail on my application:
I'am working at a robots with 3 axes(x,y,z) equiped with encoder,I need to collect the signals from the 3 encoders: sequences of pulses. I use the card SC-2345 in the environment of LabVIEW 7.0,NI,DAQ7, Windows NT . what I count to do is to use the two counters in the card to count the edges to find the positon(connection for counter0: PF18,DIO6, DGND), I need to mesure the frenquence to find out the velocity(the resolution is given: V= F(pulse/second)*Resolution(mm/pulse))=F*R(mm/second).
Actually I modified the count digital events.vi and it works with when I read only from one counter,When I tried to read from 2 counters at the same time, I can only get the results from one couter, in th
e help document it says: to read from multiple counter simutaneously, use a separate task for each counter. but I don't understand well how to creat a separate task for each counter.
so I'am asking for help here for this kind of application.
0 Kudos
Message 4 of 8
(4,322 Views)
and the card is PCI-MIO-16E-1
0 Kudos
Message 5 of 8
(4,322 Views)
Hello,

You can create and run more than one task with DAQmx because the driver is multithread (it is not the case with DAQ Traditionnal).
You can duplicate the sample code in the Counter Events.vi example in the same diagram to run in parallel the different tasks.

Best Regards.
0 Kudos
Message 6 of 8
(4,322 Views)
Hello,
The way you will build your application depends on the type of encoder that is used. What type of encoder is it : absolute encoder, quadrature encoder, ... ?

B. CHARLES
Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(4,322 Views)
A quadrature encoder.
Thanks a lot, I have three motors to identify but I have only two counters, so I can only do the mesurment one by one ,that is: Use one counter to do edge count in order to find position, another to mesure the frequence to get the velocity(read N samples, otherwise il need to use DMA), after that I can do the system identification.
I think that will be ok.
0 Kudos
Message 8 of 8
(4,322 Views)