Jump to content

Long duration TTL pulse detection


Recommended Posts

I am looking for an efficient method to detect a long duration TTL pulse of varying occurance. (0.500 -> 160 seconds). This is an additional requirement for large application and we are very sensitive to CPU usage.

Although the time between pulses is varying and large, I need to detect them within about ~ 1msec. I am using a 6023 E-Series card. I can wire the signal to a PFI, counter or DI line (my choice). I don't need to acquire any data with the trigger only detect the transistion of the line.

What I have tried:

PFI Line: Creating a continuous analog acquistion triggered by the PFI line. To make this the most efficient, I created a DAQ occurance for this. Odd behavior: 1. If I set the timeout to 500msec - my timing sensitivity is +/- 500msec??? - (I though the occurance would timeout at 500msec - but would fire on the actual event immediately.??) The CPU loading is about 4% (good). Shorting the timeout (50msec) makes the latency better - but increases CPU usage to 50% (too high).

Using the "Easy DIO'with convential software polling at a high rate loads the CPU.

I see that there are DIO Occurances in the 'Advanced DIO' Palette. But I can't figure out or find any examples of how they work.

I called NI tech support and I was told software polling is the only way to do this. I got a blank stare when I mentioned the 'DIO Occurance' functions.

Any help is appreciated.

Jack Hamilton

714-542-1608 Office/Fax

jh@labuseful.com

www.HamiltonDesign-Consulting.com

2612 N Valencia Street

Santa Ana, CA, 92706

Link to comment
... a 6023 E-Series card ...

... the 'DIO Occurance' functions ...

I think that the DIO on the 6023 (being low cost) isn't as configurable as those on the special DIO cards (ie for HW buffering) so I don't think the DIO Occurrences will work. If you did have access to one of those cards (eg DIO-24, DIO-96) you can do what amounts to a continuous buffered acquisition on the digital lines and examine the buffers returned for your events. IOW, the DI is clocked/sampled at the rate you want.

However, could you use the 6023's counter? I don't have one to play with but I think you should be able to make the counter a 'countdown' type which will generate an occurrence (or similar) when it reaches zero (alternatively a 'countup' and it reaches 1). I haven't done this in a long time so I cannot remember all the details. This can be certainly be done on the CTR cards, and will probably depend on the counter on the 6023. On the CTR cards we used the CTR to count down a number of pulses generated by an encoder on a pump, setting another line high when the counts were complete (to (a) switch a relay to turn the pump off, and (b) notify the software that the task was done). These lines are GATE and SOURCE from memory and I worked this out from the counter examples.

Another thought, there is a frequency estimator (counter) example that might work too.

Link to comment

What do you want to do with the detected pulse? Are you trying to measure the time between pulses, counting the pulses or just triggering something?

If measurement and counting is the key here then the focus of your attention should be using the counters and the examples in LV surrounding them. Counters are excellent for that.

As far as the DAQ occurences, I see no reason why they shouldn't work actually. However this seems like an backward way of doing it since it fires an occurrence when certain amount of data is acquired not when the pulse arrives. If you look at the help for the DAQ Occurrence Config.vi, you will see an option called: set the occurrence every time the output of the counter specified in the channel string control changes state such that an interrupt is generated. This might work!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.