Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is Start Trigger Delay not applicable?

Hardware: PCI 6602
Driver: DAQmx 7.4
Programming Environment: ANSI C
 
Hello All,
 
I'm setting up a counter output pulse generation task which is to have a start trigger.  To be specific, it is a digital edge start trigger (not an arm start trigger) which I plan to use in retriggerable mode so as to get a single output pulse of specified width for every trigger edge.  Currently I'm baffled as to why the Start Trigger Delay and Start Trigger Delay Units properties do not seem to apply - whenever I try to access them I get an error message saying they're not applicable to the task.  The other properties of interest - Source Terminal, Active Edge, and Retriggerable - can be accessed and modified without any problems.  I don't actually need the delay but am curious to know why it doesn't apply in this case.  Thanks in advance.
 
Jeff
 
0 Kudos
Message 1 of 13
(6,720 Views)
Hi Jeff-
 
Those properties only apply to an analog input operation.  They refer to the configurable delay between the ai/StartTrigger signal and the first ai/SampleClock.  The easiest way to see which properties apply to which type of task is to check the NI-DAQmx C Reference Help under the DAQmx Properties section- they are arranged by type (channel, task, etc) and operation (AI, AO, etc).
 
Hopefully this helps-
Tom W
National Instruments
0 Kudos
Message 2 of 13
(6,712 Views)

Thanks for your response Tom.

Yes, I had looked at the DAQmx C-Properties listing, my confusion stemming from the fact that the Delay, Delay Units, and Retriggerable properties are under the "More" section of Start Trigger rather than under "Digital Edge", "Digital Pattern", "Analog Edge" or "Analog Window".  I therefore assumed that they applied to all of these cases, i.e. that they were general parameters for any type of Start Trigger.  From a logical point of view, I'm still unsure as to why the delay would apply only to analog start triggers and not digital.  Besides, the "Retriggerable" property is under the same heading ("More") and it seems to apply to digital start triggers.

0 Kudos
Message 3 of 13
(6,711 Views)

Hi Jeff-

Sorry for the confusion- I meant to say that this applies to analog input operations, not analog triggers only.  So, you can assign the start trigger delay for an analog input task for any trigger type.  However, the start trigger delay is not applicable to any type of trigger for any type of task other than analog input.  Let me know if this does not clear things up.

Thanks-

Tom W
National Instruments
0 Kudos
Message 4 of 13
(6,705 Views)

Ok, thanks again Tom.

Maybe you can help me a bit more, as I'm a bit confused about the application.  As I mentioned, I'm trying to generate a pulse of specified width in response to each rising edge of an existing signal.  I thought the proper way to do this was to create a counter output pulse generation task in single pulse mode (thus, I don't configure any timing), set up a start trigger, then set the retriggerable property to true.  This works for the first pulse (I get the first output pulse in response to existing signal edge as desired) but then the task stops.  So, it seems either the retriggerable option is not working or I'm misunderstanding how to use it.  Could it be that the retriggerable property must be set to true before creating the start trigger?  I've consulted the example C-code supplied with DAQmx and there are several pulse generation examples, but the only example for single pulse generation does not use the retriggerable option.

Jeff

0 Kudos
Message 5 of 13
(6,702 Views)

Hey Jeff-

You will need to make sure that you don't stop the task at any point after the first generation.  Most of the examples use DAQmxWaitUntilTaskDone() to wait for a single iteration, but in your case you want to run through several iterations of the task.  So, you will want to enter a loop after starting to ensure that the task continues to run in the background on the hardware.  I modified the single pulse DAQmx shipping example to include digital retriggerable start triggering.  The empty loop spinning is obviously not ideal, so I'll leave you the choice to implement that as necessary.

Since you're working with retriggerable single pulses, you may also want to be aware of the information in this KB.

Hopefully this helps-

Tom W
National Instruments
Message 6 of 13
(6,697 Views)
Tom,
 
As you thought, it was an explicit call to DAQmxStopTask which caused the task to respond only to the first trigger.  Avoiding this required the insertion of an ugly piece of code inside the Task Done Event callback function to identify this special case (or, I could simply not register the done event callback, but still it's ugly), but everything seems to be working.  Thanks again.
 
Jeff
0 Kudos
Message 7 of 13
(6,689 Views)
Hello,
I am trying to generate n pulses right after getting a trigger. The gen dig pulse train -retriggable gives me all the flexibilty i want however i cannot find a way of introducing a delay between the trigger and when my n finite pulses get triggered. As i understand the start option is only applicable for Analog I/P function . Is there any other way. Please advise.
Ams
0 Kudos
Message 8 of 13
(6,654 Views)

Hi Ams-

The Initial Delay parameter of the counter channel allows you to create a delay at the beginning of each generation.  See my earlier post with a KB link for more tips on how to use that feature.

Thanks-

Tom W
National Instruments
0 Kudos
Message 9 of 13
(6,649 Views)
Tom,
I read KB and tried it . In my case the low ticks/low time is different from initial delay ; in fact i have to generate a finite (>1) no of pulses for which low ticks/time would be an important parameter.  I need something like a repetitive delay parameter .
Also for some reason the low time does not go below 0.01 sec (however this is a lesser priority issue)
Kindly advise
Ams
0 Kudos
Message 10 of 13
(6,641 Views)