Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I generate pulse trains on more than one counter output at the same time?

I have a PCI 6601 card with a BNC 2121 to connect the signals to two devices. The card is used as a trigger for both devices and I want to be able to generate pulse trains on two output channels at the same time, with a time delay between the two. How do I do that in Labview 7.1 Development with DAQmx?
0 Kudos
Message 1 of 6
(4,240 Views)
You will want to take a look at the examples in LabVIEW that deal with pulse train generation. As long as you have the driver and LabVIEW installed correctly, the examples should be located in the Example Finder under Hardware Input and Output >> DAQmx >> Generate Digital Pulses. You will want to select the example that fits your most desired operation (i.e. triggering, continuous, fininte, train, or pulse).

These examples are written for a single counter output. If you want to take advantage of using multiple counters, you will have to change the examples to do so. Use your good programming skills to setup both counters to begin on the same digital trigger, and then assign one of them an initial delay, as is possible by setting the input parameter on the CO Pul
se Freq VI.

The examples also come with excellent instructions. If you open your Context Help Window and hover your mouse over the VI's icon in the top-right corner, the Context Help Window will be populated with the directions.

Jared A
0 Kudos
Message 2 of 6
(4,240 Views)
Thank you for this answer. I already tried the examples and programmed two counters to generate a pulse train on the same trigger. It doesn't work however and I keep getting the same error message (-50103). I have some experience in programming in Labview, but not with DAQ or DAQmx so I don't know what the problem is exactly. Attached is the VI I used.

Sanneke
0 Kudos
Message 3 of 6
(4,240 Views)
You have your counters set up to do finite pulse generation. You need both counters to do finite pulse train generation. One counter generates the pulse train, and the other counter generates a pulse that acts as a gate for the first counter. If you change the pulse train to generate continuously or only generate one pulse, both run at the same time without error.

Jared
0 Kudos
Message 4 of 6
(4,240 Views)
I feel foolish for not being able to figure this out, but it still doesn't work. Attached is the VI I use now. Counter 0 generates a finite pulse train and I programmed Counter 1 to generate a retriggerable single pulse triggered by CtrOinternaloutput. I still get the same error message: -50103 The specified resource is reserved. The operation could not be completed as specified.

The same happens if I set the trigger for counter 1 at PFI36 (default output of counter 0) or any other PFI line. If I try a pulse train generation on only one of the counters, both work fine.
If I try the example in traditional DAQ for multiple counter outputs with phase delay, it works fine.
Can you tell me what I'm doing wrong?
0 Kudos
Message 5 of 6
(4,240 Views)
Ok never mind! I already found out what the problem was: if I program Counter0 to do a finite pulse train, it uses Counter1 as a "gate" so Counter1 is busy setting the work time for Counter0 and cannot be programmed to do anything else!
0 Kudos
Message 6 of 6
(4,240 Views)