Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop /pause trigger on PCI 6602, DAQmx, C (Dev-C++)

Hi!

I'd like to use a 6602 to generate pulse trains on different channels with specified delay, frequency etc. For this, I'm using DAQmxCfgDigEdgeStartTrig which works just fine for starting the task. When I try to stop the task with DAQmxCfgDigEdgeRefTrig (using 0 samples as pretriggerSamples) I'm getting an error (Status code -200452, Specified property is not supported by device or is not applicable to the task. Property DAQmx_RefTrig_Type). Is there a way to use stop trigger correctly in this case?

Regarding pause trigger: In the Ansi C Example "Dig Pulse Train Cont-Pause Trig", DAQmxSetTrigAttribute is used. I can't find a reference to this command in the reference files. Where can I get information on it?

Thanks!
CU
CJ
0 Kudos
Message 1 of 9
(6,078 Views)
hi CJ,

for the first I found this link:

Why Does DAQmxCfgDigEdgeRefTrig() Return error

that isn't your exact error code, but inside this link there are different things explained. perhaps this will help you...



for DAQmxSetTrigAttribute I found the following in a help file (attached !you have to change the ending from .txt to .chm! ... .chm isn't allowed as attachement):

*****
"DAQmxSetTrigAttribute
int32 DAQmxSetTrigAttribute (TaskHandle taskHandle, int32 attribute, ...);

Purpose
Sets the value of the specified triggering attribute.

This function requires three parameters. If you do not pass the correct number of parameters, the behavior of this function is undefined.

Parameters
Input
Name Type Description
taskHandle TaskHandle The task used in this function.
attribute int32 The triggering attribute value to set.

In the function panel, when you click the control or press , , or , a dialog box appears containing a hierarchical list of the available attributes. Attributes whose values cannot be obtained are dimmed. Help text is shown for each attribute. To select an attribute, double-click it or select it and then press .
value any type (passed by value) The value to which to set the triggering attribute.

If the attribute shown in this control has named constants as valid values, you can open a list of them by pressing . The Attribute Values dialog box displays the values and value help for the constants.

Return Value
Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error."
*****


greets!
Message 2 of 9
(6,059 Views)
Hi Watermann!

Thank you for your help!



for the first I found this link:

Why Does DAQmxCfgDigEdgeRefTrig() Return error

that isn't your exact error code, but inside this link there are different things explained. perhaps this will help you...



I tried the advice but no effect, still getting the same error message.

DAQmxCfgDigEdgeRefTrig(taskHandle2,"/Dev1/Ctr0InternalOutput",DAQmx_Val_Falling,2);

The same parameters are working well with DAQmxCfgDigEdgeStartTrig so I don't think it's any of those. The prettriggersamples was set to higher integers than 2 as well.

Any other ideas?

For my task, I'll need a retriggerable pulse generator, if anyone can think of a way to implement it on this card please help.



for DAQmxSetTrigAttribute I found the following in a help file (attached !you have to change the ending from .txt to .chm! ... .chm isn't allowed as attachement): [snip]



I haven't got that file. It seems inside your .chm is a reference to daqmxcfunc.chm (which I have with no such command), CVIGetSetReset.chm and mxcviprop.chm (which I haven't). Could you send the two mentioned chm files?

Thank you!

CU
CJ

PS: @Moderator: I already tried to contact someone, this thread was accidentally posted to the wrong forum. Could someone please move it to Counter/Timer? Thanks!
0 Kudos
Message 3 of 9
(6,043 Views)
hi CJ,

here are the files zipped in an archiv.
sorry that I can't help you more...

greets!
Message 4 of 9
(6,038 Views)


@Watermann wrote:
hi CJ,

here are the files zipped in an archiv.
sorry that I can't help you more...

greets!




I think I got the retriggerable part with the help of your files. Will have to try that 🙂

Do you know in which paket / directory on your HD those files were?

Thank you very much, it might be already enough help 🙂

(Not to stop anyone from responding though 🙂 )

CU
CJ
0 Kudos
Message 5 of 9
(6,036 Views)
all three files where in the following directory:

c:\programme\national instruments\ni-daq\docs
0 Kudos
Message 6 of 9
(6,032 Views)

Hello CJ-

counters do not support reference triggers.  If you'd like to have a trigger that starts your pulse train generation and then another that stops it, there are a number of ways you can implement this with the counters on a 6602 device.  The first method that comes to my mind would be to use the armstart trigger to start your generation and then use a pause trigger to stop it.  The reason you'd want to use the Arm Start trigger as opposed to the start trigger is that you can only use either the start trigger or the pause trigger at the same time on a counter.  The arm start trigger on the other hand, can be used at the same time as either a start or pause trigger.  You will also somehow need to change your digital edge that you want to use as a stop trigger to a level trigger.  This can also be done with a counter if necessary. 

I hope this helps!
gus....
Message 7 of 9
(6,003 Views)
Thanks Gus,

I think I'll only need the pause trigger, without arm trigger. I thought I could start and stop the generation with start / ref trigger.

Thank you for your help 🙂

CU
CJ
0 Kudos
Message 8 of 9
(5,982 Views)
gus,
Your statement about counters not supporting reference triggers really helped.  Is this type of information documented anywhere?
Thanks a lot,
 
ZH
0 Kudos
Message 9 of 9
(5,374 Views)