NI Home > Community > NI Discussion Forums

Data Acquisition Idea Exchange

Showing results for 
Search instead for 
Do you mean 
Announcements
The NI Idea Exchange is a product feedback forum where NI R&D and users work together to submit ideas, collaborate on their development, and vote for the ones they like best. View all of the NI Idea Exchanges to post an idea or add your opinion on an existing one today!
Kevin_Price

Hardware-Triggered Count Reset

Status: Completed
by Active Participant Kevin_Price on ‎03-16-2010 03:13 PM

To save a bunch of typing, the following is copied verbatim from a post I made years ago: 

While the thread is fresh and FWIW, I'd like to add my own additions to a counter/timer wishlist:

1.  Hardware-reload of count register based on signal edge.  Currently, the only feature that's fairly close is the "Z-index reload" feature for encoder position measurement.  There are many limitations and at least one quirk as presently implemented.

 

A. It only works in "position measurement" (a.k.a. "encoder") mode.   At minimum, it should also be supported in edge-counting mode provided the other limitations/quirks are addressed.  I've done a lot of measurements with an encoder mounted to a step-and-dir stepper motor.  The step-and-dir motor must be measured as an edge-counting task with hw-controlled direction.  The encoder's z-index pulse CAN'T be used to hw-reload the count of the edge-counting task in sync with the encoder task.  It'd be GREAT if it could.  Hw-reload of count could also be useful in other counter tasks, especially pulse(train) generation.  I can imagine some clever tricks in the other modes (such as period measurement) as well.

 

B. It must be programmed to be "active" only during a specific 1 of the 4 possible states of encoder channels A & B -- LL, LH, HL, HH.  This works out fine for real-life encoders that supply their own z-index signal.   However, I've had numerous occasions where I would have logically preferred to reset the count value based on some other system pulse signal (can you say "Limit switch"?).   I'd have liked to say, "perform hw-reload on rising edge of Z-index signal regardless of A&B state".  But no such designation exists.  I'd rather have the choices {Low, High, Either} for both A & B config.

 

C. The Z-index signal must be hard-wired to the counter's default GATE pin on the 6602 board.  I *think* but haven't verified that it's user-selectable on the M-series.  Dunno if it supports just PFI inputs or also RTSI signals.  I would like to see a next-generation Counter/Timer allow user-programmable inputs for Z-index as well as encoder A & B channels.

 

D. At least on the 6602, the Z-index behavior is STATE-driven rather than EDGE-driven.  Z-index reload happens whenever A&B are in the programmed state and Z is High.  I tested by hard-wiring the Z-index signal to +5V and my X4 quadrature task counted 0,1,2,3,0,1,2,3,0,1...   I don't recall this being spelled out clearly in the documentation -- I remember expecting it to be sensitive to a rising edge rather than a high state.  I would very much like the option of making the hw-reload sensitive to an EDGE -- ideally {Rising, Falling, Either}.

Note: wishlist item "1C" has been fulfilled in M-series counters and probably also in X-series which I haven't yet tried.

 

-Kevin P

 

Status: Completed

Implemented in DAQmx 9.2.0 for X Series devices and 2nd generation cDAQ chassis (NOT the 9172).

Comments
by Member ZachHindes on ‎03-27-2010 10:56 PM

Very interesting; I like the idea a lot.  I was thinking, and you can get something close to this by doing an Implicit Period or Frequency measurement.  At that point, the behavior is almost what you describe.  The Gate pin causes the counter to latch the current value into the FIFO and reload from 0.  You can query the value by reading the Channel Property Counter Input:General:More:Count while the task is running.  This has the benefit of also preserving the count before reload in the FIFO which can be read with a DAQmx Read.  However, it doesn't have the Edge Counting benefits of a preset initial count or Up/Down counting or anything.  It does have me thinking, though, so I'll let it stew a bit.

 

 And yes, X Series has separate signals for A, B, and Z.

by Trusted Enthusiast ‎04-07-2010 01:35 PM - edited ‎04-07-2010 01:38 PM
Status changed to: In Development
We are working on adding this feature to the driver for X Series devices--X Series hardware already supports this so it's just a matter of implementing it in the driver. The proposed addition should affect Edge Count tasks and would allow you to set the counter to a user-defined value on the rising/falling edge of a PFI line.
Message Edited by John P on 04-07-2010 01:38 PM
by Trusted Enthusiast ‎10-12-2010 01:11 PM - edited ‎10-12-2010 01:12 PM
Status changed to: Completed

Implemented in DAQmx 9.2.0 for X Series devices and 2nd generation cDAQ chassis (NOT the 9172).

About Data Acquisition Idea Exchange

Have an idea for new DAQ hardware or DAQ software features?

  1. Browse by label or search in the Data Acquisition Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see implemented!
Idea Statuses
Top Kudoed Authors
User Kudos Count
3
1
1
1