Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using all 8 counters on the 6602.

It's my understanding that you'd need to set up a single task that captures several Digital Input bits (not necessarily the entire port) whenever one of the bits of interest changes.  Change detection is considered a hw-timed task, and you can only perform 1 hw-timed DI task at a time.

However, the DAQmx Read vi allows multiple options for how you retrieve the data.  You can read it in port format (either U8 or U32 values, depending on the board's native port width), or you can read it as an array of Booleans.  The array of Booleans would be pretty easy to treat like your 2nd illustration.

There's also an option to read the data as a digital waveform.  This may be useful for graphing purposes, but I've personally found it to make bit-wise and logical operations on the DI data into kind of a pain in the neck.  It's just a wee bit like the feeling I've often gotten using Windows XP -- I'm being punished for understanding what I'm trying to accomplish.  Smiley Sad

-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.
Message 31 of 41
(3,559 Views)
Thanks for the reply.
What I want to do is do change detection on the entire port, since I can only preform one hw-clocked operation at a time, that way my one change detection setup will be looking at all the digital inputs on that port.  Then I can read the data in as an array of booleans, and do my data analysis from there.  I think this will work just as planned, thanks! 
0 Kudos
Message 32 of 41
(3,555 Views)
Kevin,

You are absolutely correct on your explanation of the change detection tasks.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 33 of 41
(3,552 Views)
Kevin,

My apologies for not getting back with you sooner. I wanted to be absolutely sure of the change detection pulse width. I measured it with one of the M Series counters running at 80MHz and got a value of 150ns, or 12 cycles of the 80MHz timebase. I have confirmed this with our ASIC designers. You are correct on your understanding of the first two points. The diagram in the M Series User Manual, however, is a simplification of the actual hardware. I'm guessing that there is a very small counter designed to produce a 12 cycle pulse on the rising edge of the "Change Detection Event" pictured. The output of this counter is the actual change detection event. The fact that the pulse width is longer than the minimum change detection period (100ns) does bring up some interesting questions. I'll see if I can find an explanation of this.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 34 of 41
(3,550 Views)
Kevin,

After some further investigation, I've found that there is a difference between the signal which latches data into the device, and the user-accesible change detection event. The card will buffer changes at a rate up to 10MHz. The change detection event, however, will occur at a maximum rate of around 5MHz, even if changes are occuring faster than that.

In my setup, I was generating a pulse train into digital port 0 line 0 (external wiring), and performing rising and falling edge change detection. Then, I measured the frequency of the change detection event with another counter. I was able to successfully generate signals up to around 2.5MHz, measuring the frequency of the change detection event at 5MHz (both rising and falling edges of the input signal generate change detection pulses). Moving up to a 4MHz pulse train, I measured a frequency of 4MHz (rising edges generate event, but falling edges don't as the pulse is not yet complete). I verified these measurements with the data latched by the digital input. Finally, I was able to buffer accurate data all the way up to a 16MHz pulse train, or 32MHz change detection. Of course, this is well out of the specification. Please let me know if you would like any additional details.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
Message 35 of 41
(3,540 Views)

Ryan,

Thanks for the detailed info & investigation.  At this point I don't think I've got any further questions.  It *is* worthy of note that the change detection event is limited to a lower rate than the DI buffering.  In a case where DI is captured based on edge detection and a counter is timestamping edge detection events, it'd be possible for the # samples acquired in the 2 tasks to get out of sync.  Not sure if/when this'll affect me but I'll file it away in the back of my mind as something to watch out for in future apps...

Thanks again!

-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.
Message 36 of 41
(3,530 Views)

When I attempt to read the counter, timed by a change detection on my digital port, I get an error telling me that I am unable to use change detect with the counter.

 

Should I be using the change detect to time a loop which records the digital and counter?  I am still a little confused on how to set up labview to do my data recording. 

 

Also, should I not be able to get this going as expected, does anyone know any good resources for hiring someone to do labview development?  My project is probably pretty simple, probably only a couple hours tops for someone who knows what they are doing.

 

Thanks all

Garrett

0 Kudos
Message 37 of 41
(3,503 Views)
I am still a little confused on how to set up labview to do my data recording.

I'm attaching a screenshot of code that allowed me to create and start a DI and a counter task that were both clocked by change detection.  I wasn't able to connect real signals up, but no DAQmx errors were generated.

Also, should I not be able to get this going as expected, does anyone know any good resources for hiring someone to do labview development?  My project is probably pretty simple, probably only a couple hours tops for someone who knows what they are doing.

There are a few ways.  Talk to your local NI tech rep -- they'll very likely be able to give you some good pointers.  There's a forum here on ni.com for such postings as well.  Heck, as long as it isn't something you need yesterday or earlier Smiley Tongue, I'll offer myself up as a candidate -- just post back with some contact info. 

-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 38 of 41
(3,481 Views)

Kevin,

You seem to be able to put this stuff togeather pretty quickly.  I would be interested in having you with me on this.  Send me an email at gkaste@phoenixamerica.com, or call at 1-888-801-1422 (ext. 225 or ask for Garrett), let me know your rate and some contact info for you and I can give you some more details on the project.

 

Thanks,

Garrett

 

 

0 Kudos
Message 39 of 41
(3,476 Views)

Could anyone please help with this VI?  I think I have applied change detection properly, but the digital and counter values dont seem to match up.  The digital reads in more data than the counter.  Its like some data just goes missing.  Should I be using a timed loop on this, with change detect as the time source?

 

Thanks

Garrett

0 Kudos
Message 40 of 41
(3,454 Views)