Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx CreatePulseChannelTimeMethod

Dear all,

 

I am trying to setup a digital counter using a NI-DAQmx card and using VS-C#. 

 

My question comes when I declare the GateTask. So, I do:

 

GateTask.COChannels.CreatePulseChannelTime("Dev1/ctr0", "Gate",

                    NationalInstruments.DAQmx.COPulseTimeUnits.Seconds,

                    NationalInstruments.DAQmx.COPulseIdleState.Low,

                    recycletime, endtime, realtime);

 

When starting this GateTask the output should be something like:

PulseChannelTime.png

 

When starting the Task it waits "recycletime" seconds low, during the "realtime" counts and in "end time" does not count because it is low again.

 

It seems, though, that it never enters the "endtime" zone, no matter which value I chose for it, it will never take it into account.

 

The question is what it is exactly this low time (endtime) value? Could I generate a Gate task with no initial delay, then a pulse and at the end some waiting time after the next high pulse?

 

Thanks in advance for the help,

 

 

 

 

0 Kudos
Message 1 of 4
(4,955 Views)

The terms you are using probably make sense to you, but it might be helpful to refer to them as their DAQmx names so other people can follow your post.  From how you have configured your output channel in C#, you are using the following:

 

recycle time => Initial Delay

real time => High Time

end time => Low Time

 

 

The way these are use depend on how you are configuring the task, and also what hardware you are using (if using retriggerable output).

 

 

Single Pulse:

 

The output will remain low after started (or triggered) for <Initial Delay>.  Then it will generate a pulse for <High Time>.

 

 

Pulse Train:

 

The output will remain low after started (or triggered) for <Initial Delay>.  Then it will generate a pulse for <High Time>.  Then it will remain low for <Low Time>.  It will continue to toggle state between <High Time> and <Low Time> until the desired number of pulses have been generated (or indefinitely if you specify the task to be continuous).  You should configure implicit timing if you want to generate a pulse train.

 

 

Retriggerable Pulses:

 

The <Initial Delay> is only used on the first trigger on older hardware (e.g. M Series).  Subsequent triggers will use <Low Time> instead.  By default, newer hardware (e.g. X Series) will use <Initial Delay> for every re-triggered pulse but can be configured to use <Low Time> instead if desired.

 

 

 

I don't know how your task is configured, but from what I can tell you would want to configure implicit timing so that your counter outputs multiple pulses.  Based on your diagram you want to set <Low Time> to be (recycle time + end time).  It is unclear if you need the initial delay at all or not (though there is a minimum intial delay of 2 timebase ticks).

 

 


Best Regards,

John Passiak
0 Kudos
Message 2 of 4
(4,945 Views)

Thanks for your reply, John.

 

I actually need a single pulse, so I can reset all counters before the next pulse occurs. But, you are right I do not need the initial delay but some low time after the pulse. As I understood, with the single pulse the low time is not used at all, thus the initial delay plays its role, right?

 

Regards,

0 Kudos
Message 3 of 4
(4,934 Views)

If you are generating a single pulse the low time after the pulse isn't used.  It wouldn't have any meaning--the output goes low after the pulse is generated and stays low until you do something else with the line.

 

Your requirements aren't really clear to me.

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 4
(4,929 Views)