PCI-MIO-16E-1 --> DAQ-STC --> see paragraphs concerning DAQ-STC in this
fileUnfortunately I have never used a SC-2345. But after a short overview of its specifications, it seems that you will need one SCC-FT01 to connect the A channel to the counter source and the other to connect B to the auxiliary line that will set the direction. See schematic in the file mentionned above. So your hardware will allow you to take this measurement.
See this
example to see how to configure a DAQ-STC counter for position measurement.
1) Simple event counting
2) Up/down counting. Direction is given by hardware --> auxiliary line of the counter (DIO6 for counter 0 and DIO7 for counter 1)
3) Start the counter
4) Read periodically the counter value
5) Reset the task when finished
Don't be troubled by the BNC-2120. Use your SC-2345 instead. Obviously you will need to adapt the number of encoder pulses/rev to suit your encoder.
Add a shift register to store the position from one iteration to the other and compute the difference to determine the direction.
If you want to add the velocity, than you have two options :
1) If the accuracy must not be very high, then you can compute it (delta position / loop time).
2) If you need high accuracy, then it will necessary to use the second counter to measure the frequency of channel A. In order to avoid errors due to vibrations it is recommended to use the LS7084 in this case.
As you can see
here, there are 3 methods to measure a frequency.
Obviously, the examples will not work with your DAQ-card because the 660X is a NI-TIO type counter.
If you want to measure the velocity at the same time than the position, then you will need to use the first method (Inverse period measurement) because the others will need 2 counters. (your card has only 2 counters and one is already used for the position measurement).
There is an example of period measurement for DAQ-STC that ships with LV (Measure Period (DAQ-STC).vi).
1) Single period measurement
2) Source specification --> internal timebase
3) Gate specification --> channel A
4) Start task
5) Wait for one pulse on Gate. I recommend to add a timeout to not enter in an endless wait if there is no pulse.
6) Read number of pulses of the internal timebase.
7) Check if counter overflow
😎 Reset task
You will need to combine both examples in one vi.
I hope this is clear enough to help you.