09-23-2013 02:32 AM
Hi, i'm using the NI PCI 6534 and i'm looking to start a generation on a start trigger from PFI6, the generation works fine. But my problem is when i wait the trigger, the first data of the buffer is load on the lines. For exemple on a generation using DAQmxWriteDigitalU32 if my first buffer's value is 2 my line 2 will get a positive value even if no trigger is detected.
So my question is : how to force lines at value 0 while the trigger isn't detected?
Here is my code :
private void armTrigger() throws DAQmxException {
Sequence sequence = getSequence();
int [] writeArray;
int duration = sequence.getDuration();
sequence.setBufferSize(duration);
sequence.calculateAllLines(duration, getNbPeriod());
writeArray = sequence.getBuffer();
DAQmxErrChk(DAQmxStopTask(sendingTask));
DAQmxCfgSampClkTiming(sendingTask, "", SAMPLING_RATE, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, duration);
DAQmxCfgDigEdgeStartTrig(sendingTask, "/Dev1/PFI6", DAQmx_Val_Rising);
DAQmxErrChk(DAQmxWriteDigitalU32(sendingTask, duration, false, 0, DAQmx_Val_GroupByChannel, writeArray, null, null));
DAQmxStartTask(sendingTask);
}
Thank you for your help.
Alexandre.
10-01-2013 02:53 AM
Hi AlexxP,
Have you ever try to reset your NI PCI 6534 ?
Did you stop and clear your Task at the end of your application ?
Best regards.
Aurélien Corbin
National Instruments France
10-01-2013 07:46 AM
Hi Aurel.Co and thank you for your reply.
Yes i do stop and clear the task at the end of the application.
Is it not "normal" that the first value of the buffer is read on the line while the trigger isn't arrived?
For now, I found one solution, it is to put the first value of the buffer to 0. But that gave me a 1ms delay which i would like to avoid.
I hope someone could help me with this, i can't find any other solution.
Thank you for any help.
Best regards,
AlexxP