Hi,
We have a problem with a simple solution. We are using two counters to generate two wave forms with a shift in it. The solution works perfect with the combination of the counters 0,1,3, 4, 5 and 6. But in a combination with counter 2 on the other hand, it just won't work. If we are using a combination of counter 0 and 2, ctr 0 out generates a wave while the out of ctr2 remains at 0 volt. Ctr1 out has the correct high status, while ctr 3 out remains also low.
FPI 0.7 is used as trigger.
This error occures on the two PXI-boards and a PCI-card with CVI 8.5.
There should be no broken board.
Are we missing some information about counter 2?
The part of the dll we created:
int DLLEXPORT DLLSTDCALL i32_NI6602_CreateDAQTaskPhaseShift (TaskHandle *taskOutPhaseShiftA,
TaskHandle *taskOutPhaseShiftB,
{
//Snip -- Definitions for the calculation for delay and frequency.
int32 DAQmxError = DAQmxSuccess;
TaskHandle taskOutA, taskOutB;
// Snip -- Calculations for the phases A and B, period a.s.o..
DAQmxErrChk(DAQmxCreateTask ("TaskOutA", &taskOutA));
DAQmxErrChk(DAQmxCreateTask ("TaskOutB", &taskOutB));
DAQmxErrChk(DAQmxCreateCOPulseChanTime (taskOutA, CounterA, "ChannelName0", DAQmx_Val_Seconds, DAQmx_Val_Low,
PhaseA, LowHighTime, LowHighTime));
DAQmxErrChk(DAQmxCreateCOPulseChanTime (taskOutB, CounterB, "ChannelName2", DAQmx_Val_Seconds, DAQmx_Val_Low,
PhaseB, LowHighTime, LowHighTime));
DAQmxErrChk(DAQmxCfgImplicitTiming (taskOutA, DAQmx_Val_FiniteSamps, NrPulses));
DAQmxErrChk(DAQmxCfgImplicitTiming (taskOutB, DAQmx_Val_FiniteSamps, NrPulses));
DAQmxErrChk(DAQmxCfgDigEdgeStartTrig (taskOutA, DigitalIO, DAQmx_Val_Rising));
DAQmxErrChk(DAQmxCfgDigEdgeStartTrig (taskOutB, DigitalIO, DAQmx_Val_Rising));
*taskOutPhaseShiftA = taskOutA;
*taskOutPhaseShiftB = taskOutB;
Error:
return DAQmxError;
}
Part of the GUI which is calling the function from the dll.
ChannelDIO = 7;
OnOff = 1;
i32_NI6602_CreateDAQTaskDigitalIO (&HandleDIO[0], DEVICE, ChannelDIO);
i32_NI6602_CreateDAQTaskPhaseShift (&HandleChannel[0], &HandleChannel[2], DEVICE, Frequency, NrOfPulses, UpDown);
DAQmxStartTask (HandleChannel[0]);
DAQmxStartTask (HandleChannel[2]);
//Generating the arming
Delay(0.1);
DAQmxWriteDigitalLines (HandleDIO[0], 1, 1, 1.0, DAQmx_Val_GroupByChannel, &OnOff, NULL, 0);
Delay(0.1);
OnOff = 0;
DAQmxWriteDigitalLines (HandleDIO[0], 1, 1, 1.0, DAQmx_Val_GroupByChannel, &OnOff, NULL, 0);
Delay(0.1);
//End trigger
DAQmxStopTask (HandleDIO[0]);
DAQmxClearTask (HandleDIO[0]);
Tanks for your attention.