09-11-2005 01:05 PM
09-12-2005 03:01 PM
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));Regards,
DAQmxErrChk (DAQmxCreateCIAngEncoderChan(taskHandle,"Dev1/ctr0","",DAQmx_Val_X4,0,0.0,DAQmx_Val_AHighBHigh,DAQmx_Val_Degrees,24,0.0,""));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI9",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
/*********************************************/
/*/ DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
printf("Continuously reading. Press any key to interrupt\n");
while( !_kbhit() ) {
/*********************************************/
/*/ DAQmx Read Code
/*********************************************/
DAQmxErrChk (DAQmxReadCounterF64(taskHandle,1000,10.0,data,1000,&read,0));
printf("Acquired %d samples\n",read);
}
_getch();
09-13-2005 11:19 AM
09-14-2005 02:37 PM
09-14-2005
04:46 PM
- last edited on
02-11-2025
01:32 PM
by
Content Cleaner
Gerry,
Try taking a look at this KnowledgeBase for more information on how to get your Quadrature Encoder working.
Using Quadrature Encoders with E Series DAQ Boards
DAQ-STC based counters (E-Series boards)
Supports quadrature encoders, but not Z-indexing. The up/down pin is DIO6 for counter 0 and DIO7 for counter 1. Connect channel A to the source pin, channel B to the up/down pin, and the gating pulse to the gate. For information on using quadrature encoders with E-Series boards, refer to the Using Quadrature Encoders with E Series DAQ Boards document
There should not be a problem with using the PCI-6071E as opposed to any other device. Also there shouldn't be any problems associated with using C# versus any other language as all of the calls are to the same set of dlls.
Regards,
10-03-2005 12:40 AM
10-04-2005
12:31 PM
- last edited on
02-11-2025
01:33 PM
by
Content Cleaner
Hi Gerry,
Sorry about the confusion on this one, but I found out what is happening. Turns out that there were some differences between the E-Series and M-Series devices that I was unaware of until a fellow engineer pointed it out to me.
They helped me find the following KB that describes exactly the behavior that you are seeing and why it occurs. Looks like the real culprit is the board you are using uses the digital lines for direction rather than a PFI line. Unfortunately it is a hardware limitation and if you need faster rates than about 1000 Hz, then you will need a different board.
More details are below:
This problem is most likely due to the data transfer rate limitation of the DIO of the E-Series Board. When connecting a quadrature encoder to an E-Series board, you wire channel A output of the encoder to the PFI8 (SOURCE) and channel B output of the encoder to DIO6 (UP_DOWN) input. Since the data transfer method of the DIO channels of the E-Series boards are programmed I/O (the slowest data transfer method), your data transfer rate will be limited by the software timing.
Title:
Incorrect Count When Using a Quadrature Encoder on an E-Series BoardProblem:
I am trying to obtain the count of a quadrature encoder using an E-Series board. I have made the connections correctly, but the count is incorrect. What is the problem?Solution :
Depending on the system, the maximum data transfer rate for a programmed I/O is about 1KHz.
If you require a data transfer rate of greater than 1KHz or experience inaccurate readings from your quadrature encoder using an E-Series board, you will need to choose another option.
Here are two options:
- 6602 Counter/Timer: Ideal for counter timer applications. 8 Counter/Timers, 3 DMA channels. Simple to use with quadrature encoders. Refer to page 3-19 of the 6602 for detail on use with quadrature encoders (type X1, X2, X4)
- M Series 2 Counter/Timers, 32 hardware clocked DIO lines up to 1MHz, 6 DMA channels.
Major Differences Between E Series and M Series DAQ Devices
Using Quadrature Encoders with E Series DAQ Boards
Regards,
10-04-2005 04:12 PM
10-05-2005 06:35 PM
10-06-2005
04:40 PM
- last edited on
01-31-2024
12:18 PM
by
migration-bot
Hi Gerry,
You can connect 4 encoders with A, B, and Z inputs to the PCI-6601. Each counter has an auxiliary connection in addition to gate, source, and out that is used. The best place to look for this type of information for our counter/timer products is in the DAQmx Help. Under a search for "encoder" I found a pinout that shows where to connect the encoder inputs.
Yes, on an M Series, that is referring to single ended inputs so you would have 16 differential inputs.
The best place to learn about these concepts is in the different help files that install with the driver. If you go to Start >> Programs >> National Instruments >> NI-DAQ you will find a number of help files that will help you with these concepts. I do not see any general tutorials for these concepts on the website since they are normally more specific to a certain hardware setup or situation. You can also see the help files for the specific hardware you are using.
If you have any specific questions about these ideas, please let us know.
Thanks,
Laura