Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

measuring encoders using PXI-6602 in LabVIEW Continuous Measurement Sample Project

i'm trying to read position data from 4 linear encoders connected to a PXI-6602. i'm also trying to use the LabVIEW "Continuous Measurement" sample project. i have been trying to use a dummy analog input task to start the timing. i keep getting errors like Error -200216 which says that i cannot used interrupts or DMA for the data transfer mechanism. i also get error -200557. but i think that i know how to solve this error. i can provide a copy of the sample project that i have modified or just the counter vi's that i have developed.

0 Kudos
Message 1 of 4
(164 Views)

Please share your code, preferably in version 2019 as most forum users don't have access to the latest version.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 4
(148 Views)

attached is current version as LV 2019 version

0 Kudos
Message 3 of 4
(120 Views)

This is a much-delayed response.   Dunno if the OP still needs help with this stuff so I'll keep it brief for now.

 

1.  I looked up the error codes you mentioned.  -200216 doesn't appear that it should apply to the code you posted, unless *possibly* it's a side effect of explicitly setting up DMA or Interrupt transfer *before* configuring the task to have a sample clock and buffer.  I'm not real hopeful, but you can *try* making the call to DAQmx Timing *before* setting up your DMA or Interrupt transfer method.

 

2.  The 6602 only has 3 total DMA channels available for counter tasks so unfortunately, you *will* be stuck manually configuring at least one of your encoder tasks for Interrupts.  The other 3 should try to use DMA by default and shouldn't need to be configured manually.

    If you can change hardware, a newer 6612 counter device or most any X-series 63xx device would support DMA for all 4 counter tasks.  This would be much preferred if possible.

 

3. When you configure Arm Start triggers, you generally need to specify 3 properties, not just 1.

Trigger Type = Digital Edge

Source = terminal of triggering signal (this is the one you *did* specify)

Edge = either rising or falling as needed.

 

Note: once upon a long time ago (probably ~10ish years?), I found that it seemed to matter that Trigger Type needed to be above the Source and Edge designations.  I adopted the habit back then and haven't re-checked whether it's still necessary in more recent DAQmx versions.

 

There are some other things, but that's enough for now.  Meanwhile, I strongly urge you to put effort into neatening your diagram -- both for our sake and your own.  A very useful convention is to keep all the DAQmx task/error wires for a particular task in a straight horizontal line.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(32 Views)