Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQMX continuously buffered period measurement

I am in transition from traditional DAQ to DAQ-MX, I've closely studied some nice posts on this board such as http://forums.ni.com/ni/board/message?board.id=40&message.id=2714&view=by_date_ascending&page=1, and http://forums.ni.com/ni/board/message?board.id=40&message.id=1974&view=by_date_ascending&page=1.

What I am trying to accomplish is to measure random photon TTL pulses in specified time bins, which I can do successfully using DAQ-STC based continously buffered period measurement. Somehow I have quite some trouble converting it to work in DAQ-MX. Attached please find my code named MX period.vi, when I execute the vi, it wouldn't start reading counts. Also, I couldn't add the Duplicate Count Prevention property node, it will give me an error saying device or the task not supporting it. I am using 6052E, LabVIEW 7 express, DAQ-MX 8.

Another function that I'd like to incorporate is re-triggerable pulse generation, as shown in the diagram of MX edge.png. Here I could start edge measurement and use shift-register to log the difference counts to graph/file, this is not ideal, since I am worrying about count rollover for long recordings. In DAQ-STC, continous pulse generation can be gated, such as PFI0. In DAQ-MX, I tried to add a trigger node to pause the pulse generation at digtial level low, but it doesn't seem to do the job. Any suggestions or comments?

Message Edited by SHGfun on 03-20-2006 05:15 PM

Download All
0 Kudos
Message 1 of 8
(5,635 Views)
Further testing: I realized for period measurement, the timing property node didn't do anything. If I used the continous pulse generated from the other counter as the source and start counting, I will get counts as if the gate is the internal 20 MHz timebase. How can do the gating correctly?

Any help is greatly appreciated.

Thank you.

JJ
0 Kudos
Message 2 of 8
(5,599 Views)
JJ,

You'll want to set the CI.Period.Term property to be your other counter's internal output.  Then, you'll set your counter timebase source (CI.CtrTimebaseSrc) to be the line on which you are counting pulses. Think of it like this: In basic period measurement, the source is implicitly the internal timebase of the card. The gate (or sample clock) is the signal whose period you are measuring. When you select "ticks" instead of "Seconds," you get "ticks of the internal timebase," which is really no different. In this case, each rising edge of the gate latches in a new measurement, whether it be Seconds or ticks (it is all the same in HW). In your application, you want some periodic signal (generated by your other counter) to latch these new measurements, therefore it should be the gate, or sample clock, or other counter's internal output. Then, you'll want the "timebase source" to be the signal that you are measuring. I won't tell DAQmx that this isn't some periodic clock with a known frequency if you don't Smiley Wink. This is where duplicate count prevention comes in. As your device is not TIO-based, it does not support this property. This means that for any gate period which does not recieve source pulses, you will not buffer a data point. Will this likely be an issue for you (in other words, will you ever get no photons for 1 ms)?

Finally, as a retriggerable, finite, pulse generation requires 2 counters, you will not be able to perform this at the same time as your event counting task. In order to do this, you would need to upgrade to a board with at least 3 counters. Coincidentally, these boards (660x Series) also have duplicate count prevention. Please let us know if you have any more questions.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
Message 3 of 8
(5,585 Views)
Hi Ryan,

Thank you very much for your clear explanation, now I understand the nomenclature much better now. I've tried to change the way I was wiring the terminals, and now it sort of works. However, I am getting error message when I use a fast gate sigal (10 kHz):

Error -200140 occurred at DAQmx Read (Counter 1D U32 1Chan NSamp).vi
Possible reason(s):
Two consecutive active edges of the input signal occurred without a counter timebase edge.
Use a faster counter timebase.
Task Name: _unnamedTask<15>

Since the time base is my unknown photon source, and it could be no photon coming in many milliseconds (not counting dark counts, which is at a rate of ~200/second). Since I didn't encounter any similar problem in DAQ-STC, did I miss any proper wiring in my DAQ-MX program?

Thanks for your input and help.

JJ
0 Kudos
Message 4 of 8
(5,572 Views)
JJ,

My apologies... Looks like I am confusing my counters / properties here. Because we are doing a period measurement, the driver will complain if we don't have any "timebase pulses" against which to measure the period. I would suggest going to a buffered event counting application and simply finding the difference between subsequent reads. This will not give you the specified error. In this application, the source will still be your photon TTL signal, and now your sample clock will be the pulse train generated by your other counter. Let us know if this works!

Regards,


Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 5 of 8
(5,566 Views)
Just to continue from the last post. In LabVIEW help file, it stated "If no source edges are present between two consecutive gate edges, then the previously saved counter value is saved again", and that is exactly what I am observing in my experiments using DAQ-STC based counter program. Unfortunately I didn't finish reading the setence saying "For NI-TIO-based devices, you can set the counter to count in a synchronous mode". I was 'dreaming' of using duplicate count prevention in MX to correct this on my E board. Smiley Sad

Regarding again about the 'retriggerable' issue, I guess I was not using the right terminology. In DAQ-STC continous pulse generation program, it can be gated by a terminal such as PFI0 of the device, and I found that in my experiment, it will only output pulse train if TTL trigger to PFI0 stays high, thus, indirectly, I can set a retriggerable counting scheme for my photon counting using this gate pulse train. That is why I put trigger property node value of 'pause when low' in the pulse train generation part. But, apparently this doesn't work as I hoped.

Is there any method that I can use in DAQ-MX to achieve the 'retriggerable' pulse train?

Thanks for help!

JJ


Message Edited by SHGfun on 03-22-2006 04:36 PM

0 Kudos
Message 6 of 8
(5,568 Views)

What you are describing for "retriggerable" is a Pause trigger in DAQmx, which cannot be used at the same time as the Start trigger.  From your original diagram, what you'd want to do is remove the start trigger VI and add the "Pause Trigger Type" property to your trigger property node (the pause trigger type should be digital level).  That should do the trick for you.

gus....

Message 7 of 8
(5,546 Views)
Thanks, Gus. I got it.
0 Kudos
Message 8 of 8
(5,531 Views)