Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I retrigger a finite digital output task with a NI6533 (PCI-DIO-32HS)?

Hi. I'm sorry, because I'm sure this has been asked and answered before, but I can't seem to find a definitive answer. I have a NI 6533 that I'm trying to use to regenerate the same buffer of data everytime a start trigger is received. I have seen some indications that this may not be possible with this card, but on the other hand, when I query the trigger properties (with DAQmxGetStartTrigRetriggerable), the task is identified as retriggerable. I'm using the NiDaqMx API in a C++ program for Windows XP. Here are the relevant portions of the code:

DAQmxCreateTask("",&writeTask);
DAQmxCreateDOChan(writeTask,writePort.c_str(),"",DAQmx_Val_ChanForAllLines);
DAQmxCfgDigEdgeStartTrig (writeTask, triggerTerminal..c_str(), DAQmx_Val_Rising);
DAQmxCfgSampClkTiming (writeTask, NULL, s.frequency(),
                DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, sampCnt);
DAQmxWriteDigitalU32(writeTask,s.bufferSize(),false,10.0,
            DAQmx_Val_GroupByChannel,data,&written,NULL);
DAQmxStartTask(writeTask);

The result is that the output is triggered once and never again. Querying the task properties (with DAQmxGetTaskComplete) indicates that the task is completed.

Am I setting this up incorrectly or is it not possible with this card? What does the "retriggerable" property actually indicate?

Thank you very much for any help you can provide.

Best regards,
Roy
0 Kudos
Message 1 of 4
(3,519 Views)
Hi Roy,

The NI 6533 will not be able to perform a retriggerable digital output by itself. You could get this functionality by having a retriggerable clock source, which we can create using both E series and M series device counters.  There are also other counter timer boards that can provide this functionality.

I am curious about the calls you made that gave you the task being identified as retriggerable. The code in your post did not show where the DAQmxGetStartTrigRetriggerable call was made. When you say the task is identified as retriggerable did that command return a true?

According to the DAQmx help the retriggerable property is defined as

"Specifies whether to enable retriggerable counter pulse generation. When you set this property to TRUE, the device generates pulses each time it receives a trigger. The device ignores a trigger if it is in the process of generating pulses."

Please let me know where in your code you call the DAQmxGetStartTrigRetriggerable command and what it returned, and let me know if you need any help setting up a retriggerable clock source.

Have a great weekend,

Michael

0 Kudos
Message 2 of 4
(3,505 Views)
Michael:

Thank you very much for gettting back to me. In fact, it seems that whenever I query the retriggerable property (with DAQmxGetStartTrigRetriggerable) it returns "true." So, if I check after task creation

DAQmxCreateTask("",&writeTask);
DAQmxGetStartTrigRetriggerable(writeTask,&data);

I get "true." And so on, after any line in this sequence:

DAQmxCreateTask("",&writeTask);
DAQmxCreateDOChan(writeTask,writePort.c_str(),"",DAQmx_Val_ChanForAllLines);
DAQmxCfgDigEdgeStartTrig (writeTask, triggerTerminal..c_str(), DAQmx_Val_Rising);
DAQmxCfgSampClkTiming (writeTask, NULL, s.frequency(),
                DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, sampCnt);
DAQmxWriteDigitalU32(writeTask,s.bufferSize(),false,10.0,
            DAQmx_Val_GroupByChannel,data,&written,NULL);
DAQmxStartTask(writeTask);

I also get "true" after stopping the task. Perhaps, this is a bug?

In any case, in my current application, I can live with handling this in software (starting and stoping in a loop).

Best regards,
Roy
0 Kudos
Message 3 of 4
(3,487 Views)

Hi Roy,

Thanks for getting back to me explaining what you were seeing. The C call actually affects the task instead of the channel, which means that it would not prevent the task from being retriggerable, but the channel you have defined is not retriggerable. I have seen the behavior you are describing though and have described it to RD. I am not sure if this is expected behavior or not yet, but when I find out I will let you know and keep you updated to any further action.

I am glad to have answered your question and that your application will be able to work with software timing.

Have a great weekend,

Michael

 

 

Message Edited by Mike_D on 10-19-2006 02:38 PM

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