Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger two counters in order to count edges simultaneousely?

Hi,

I am trying to count the number of TTL pulses that are coming in from two photon counting PMTs using a PCI-6122 (S-series, DAQ STC).  I need the counting to start simultaneousely, via an external trigger (right now I am using an internal trigger just to test things out). 

 

To the best of my understanding, I need to use an outside clock source as the timebase for the counters' count edges application; I am using a 40kHz TTL signal from a function generator for this purpose, that I have hooked up to Ctr 0 Gate (PFI 9) and to Ctr 1 Gate (PFI 4).  The signals from the PMTs are attached to the Ctr 0 Source and Ctr 1 Source terminals.  

 

Without the DAQmx Trigger(Start Digital Edge).vi, the program runs fine.  But, whenever I use DAQmx Trigger(Start Digital Edge).vi I receive the following error:

 

Error - 200452 occured at Property Node DAQmx Trigger (arg1) in DAQmx Start Trigger (Digital Edge).vi

Measurements: Specified Property is not supported by the device or is not applicable to the task.

Property: Start.Trig Type 

 

Does anyone know why I am receiving this error, and more importantely, how can I simultaneousely start to count edges using the two counters on this board and a trigger (external or internal)?

 

Thank you very much for any help in advance.

 

P.S.  I have also attached a picture of the block diagram.  

0 Kudos
Message 1 of 9
(5,898 Views)
The S series card you are using does not have trigger capabilities on edge counting, its just not built into the STC chip.  I would recommend that you trigger the generation of your sample clock.  This will have the same effect as the counter will not count until the sample clock starts and the sample clock will not generate until your trigger is recieved.
Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 2 of 9
(5,846 Views)

Here is the knowledgebase article I found that addresses the triggers on the DAQ-STC chip

 

http://digital.ni.com/public.nsf/allkb/5D8913252908341786256CB0006A5B5F?OpenDocument

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 3 of 9
(5,845 Views)

Hi Doug,

Thanks for your reply.  I came across the Knowledgebase article that you have linked after I posted my original message.  Please tell me if I have understood your suggestion correctly: I would use an external clock source, which I would attach to each of the counters' "gate" pins.  I would connect the input signals (from each of the PMTs) to each of the counters' "source" pins.  Once I would start that external clock source (with a physical trigger), both counters would start simultaneousely? If this is the case, unfortunately I cannot implement it since my signal generator cannot be triggered 😞

 

Since I posted the original message, I have also found out that I can use an internal clock source, i.e. the onboard clock, for non-buffered acquisitions.  I still don't seem to be able to use an internal clock source for buffered acquisitions, though.  So, would I be able to do a triggered non-buffered acquisition in which I connect each of the input signals to the "source" pins of each of the counters, and connect a common TTL pulse to the "Gate" pins of each of the counters, to be used as Pause Trigger?  My logic is that with the TTL Gate signal/Pause Trigger, I can then synchronize the two counters.         

 

Also, I found the following article (http://zone.ni.com/devzone/cda/epd/p/id/3356) which seems to have found a way around the triggering issue while still doing a buffered acquisition, by first routing the onboard clock to the RTSI clock and then rerouting the onboard clock to itself(?).  I am trying to understand their vi, since it uses DAQ Legacy and I can't quite make sense of it (I am using DAQmx).  Could you, or any other good samaritan Smiley Wink, perhaps take a look at it as well to see if you can maybe "translate" it?  They are saying that they are using the same clock signal for both counters, which is the "source", and that we can choose different "gate" signals for the two counters, if we wanted to.  I am confused about this.  I thought that the "source" should be the input signal(s) whose edges we want to count, so they could be two different signals, and that the "gate" should be the sample clock, which would then ensure their synchronization.  This is what I understood based on the tables that are in "Counter Parts in NI-DAQmx">"NI-DAQmx Help">"NI DAQ">"National Instruments">"All Programs". 

 

I know these are a lot of questions/doubts that I have outline here, but I am in a bit of a pinch and appreciate any help you can provide me. 

Thanks again.

Message Edited by DanceWiz on 09-08-2009 04:37 PM
0 Kudos
Message 4 of 9
(5,836 Views)
I forgot to mention that because of timing issues I would prefer to use buffered acquisition rather than non-buffered.  Also, does anyone know if and how I can move this post to the Counters/Timers forum, where I think it is more relevant?
0 Kudos
Message 5 of 9
(5,797 Views)
Any ideas?
0 Kudos
Message 6 of 9
(5,768 Views)

I've talked with a few other people about this and that article is not really accurate because the sample clock cannot be changed after the DAQmx task has been started which is essentially what it is saying to do.  The only real solution that we were able to develop with your current hardware is to not start the edge counting until after both of your counters have had sufficient time to arm.

 

The other option is to get a card with Arm-Start enabling, any M or X series card, or anythign with the STC-II chip on it.

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 7 of 9
(5,762 Views)

Hi Doug,

Thank you very much for checking for me.  I thought I had been forgotten Smiley Very Happy If I don't start the edge counting until after both counters have armed, I would be able to synchronize both of them together, correct?  The problem is that I not only need to have the edge counting from both counters be done synchronousely, but also need to synchronize the said edge countings' start with an external trigger (coming from a shutter).  I have attached a conceptual schematic of what I am trying to achieve.  I apologize if I was not clear in my previous posts.  

 

I made a vi that I thought would achieve what I am trying to do.  I have attached a screen shot of the block diagram as well. The idea is to:

 

1.) Prepare both counters and wait.

2.) Once the external trigger is received (from Port0/line0), "internally connect/route" the terminal to which the external clock source is attached (PFI5) to the Gate of counter 1 (PFI 4).  Note: Gate 0 (PFI 9) and Gate 1 (PFI 4) have been physically connected together. 

3.) Start the edge counting with both counters at the same time.

 

I am running into the following error:

 

Error -89137 occurred at DAQmx Connect Terminals.vi

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Source Device: Dev1
Source Terminal: PFI5
Destination Device: Dev1
Destination Terminal: PFI9

Required Resources in Use by
Task Name: _unnamedTask<4E>
Source Device: Dev1
Source Terminal: PFI4
Destination Device: Dev1
Destination Terminal: Ctr0Gate

 

Is there a way to get around this?

 

Thanks. 

 

Message Edited by DanceWiz on 09-10-2009 05:01 PM
Download All
0 Kudos
Message 8 of 9
(5,752 Views)

I would propose you start the counters as in the attached file, then they should be well synchronised. Hope that helps you!

0 Kudos
Message 9 of 9
(5,106 Views)