Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize trigger the start and stop of 4 timer/counter(with different duty cycle) ?

Hi, every Sir :

 

I am using cDAQ 9174 + NI 9402 to generate some relate triggers for instruments controls.

To generate the 4 DO wave with 4 counters, like this:

 

mcounter.gif

 

For the delay between channels, should be adjustable in us level.  like this:

 

mcounterSpulse.gif

 

 

But for default setting with interlock, 4 channels are not synchronized, the time uncertain in ms level.

 

So how to synchronize trigger the start and stop of  4 timer/counter(with different duty cycle)?

 

I noted the related topics, for examples thise use arm start trigger somethings.

 

but  cDAQ 9174 + NI 9402 maybe not have those ai/ao start trigger.

 

Is any triggers internal to control the start and stop of  4 timer/counter?

 

for example, an another counter inner-directed to trigger this start and stop?

 

 

Any suggestions are welcome, VI, DAQmx.....

 

 

 

 

0 Kudos
Message 1 of 6
(6,419 Views)

The first image you posted shows the first channel outputting at twice the frequency of the others, but the second image seems to indicate that all channels should output at the same frequency.

 

If you need behavior like the first image, I would configure all 4 channels as continuous counter outputs with the desired frequency and duty cycle.  Each channel would have a variable initial delay.  Channels 2-4 should be configured to use a digital start trigger, the source of the start trigger should be channel 1's counter internal output.  Once triggered however, you wouldn't be able to make adjustments to the delay values while the outputs are running.

 

If you need behavior like the 2nd image (with all channels at the same frequency), you could do what I mentioned above, OR you could configure channels 2-4 as single retriggerable pulses with channel 1 as a continuous counter output.  Channel 2 would be triggered from channel 1's counter internal output, channel 3 would be triggered from channel 2's counter internal output, and channel 4 would be triggered from channel 3's counter internal output.  Doing this would allow you to change the delay values while the outputs are running without losing synchronization (it's not clear if you need to do this or not).

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 6
(6,414 Views)

Thanks.

I am sorry to not clearfy the relation of graphs.

In fact , the 2nd graph is the enlarge of part of  1st graph like below:

 

20131209110351.jpg

 

 

would be triggered from channel 1's counter internal output,

 

This is helpfull information!  All  other  channells can be setted delay time relative channel 1's counter internal output.

 

But Where to get counter internal output?   In Signalexpress, tirgger-source only can be selected from implicit  or external signal like PFI0~2

 

How to set counter internal output as trigger for this in vi or DAQmx?

 

and how to stop(or finish) this set of signals with something like the count number of the 4th pulses signal ?

 

 

 

0 Kudos
Message 3 of 6
(6,404 Views)

Well, in SignalExpress your options are a bit more limited.  I haven't really used SignalExpress much (and it's been a long time), but I believe you can only trigger the task off of a signal on a PFI line.  If this is true, you could always just wire the ctr0 output back into another PFI line and use the PFI line instead (there would be a slightly larger delay but it would be on the order of 10s of ns and likely not noticeable, if it is a problem you could calibrate it out).

 

In LabVIEW you just need to call something like this when setting up your counter output tasks (but the internal outputs won't show up in the dropdown by default as they are considered advanced terminals😞

 

Gen Dig Pulse-Dig Start.vi Block Diagram on Triggered_AI_Acquisition.png

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 6
(6,387 Views)

Thanks John !

You are great!  I am first know that  the "Advanced" DAQmx Terminals.

Yes, which can be used internal,  which must be used reback from external, how to arrange triggers and time orders, are very import for constructing complex system.

 

using PFI0~2, these signals can be received, though I still do not konw how to stop them with the slowest signal's N counts.

 

CtroInternalOutpu can not be used as trigger since I need them in different dyty cycle (or in proportion mode).

 

I will try use one of those counters in cDAQ 9174 chassis.

0 Kudos
Message 5 of 6
(6,377 Views)

Oh, on the cDAQ chassis the terminal will be something like /<Chassis name>/CtrXInternalOutput.  If you don't have an extra line anywhere (i.e. you are using all 4 PFIs on a single 9402 for routing the counter outputs) then you'll have to use the internal terminal (which you can do in LabVIEW, C, CVI, .NET, etc. but I don't *think* you can do it in SignalExpress).

 

As far as stopping the signals, just make your master task run in finite mode and so it will stop after N pulses are generated.  The other channels will no longer receiver triggers either and everything will stop together.

 

I'm not sure what you mean about proportion mode, but you can configure each counter with a different duty cycle and still have them use a start trigger.

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 6
(6,372 Views)