I'm currently trying to configure a digital output task where it define a pattern to be written. The card always throws an error -200077 "Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property. Property: DAQmx_SampTimingType. Requested Value: DAQmx_Val_SampClk. You Can Select: DAQmx_Val_OnDemand"
The same task runs properly if it's an analog task. But with AO the max frequency I can reach is 80kHz, the goal is 100kHz. So therefore I tried to convert the tasks to digital output with the hope for faster signalling
That's the pattern I want to write:
self._freq = 10000
self._sampFreq = 10
phi = np.pi
self._redP = 2.5 * signal.square(2.0 * np.pi * 1.0 * self._t, self._duty) + 2.5
self._greenP = 2.5 * signal.square(2.0 * np.pi * 1.0 * self._t + phi, self._duty) + 2.5
self._data = np.concatenate((self._redP, self._greenP, self._silence))
self._sig1 = 2.5 * 1.0 * signal.square(2.0 * np.pi * 1.0 * (self._t + 0.01), 0.009) + 2.5
self._sig2 = 2.5 * 1.0 * signal.square(2.0 * np.pi * 1.0 * (self._t + 0.01) + phi, 0.009) + 2.5
self._silence = self._sig1 + self._sig2
The trigger:
self.laser_pulse = Task()
self.laser_pulse.CreateCOPulseChanFreq("Dev1/ctr0", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, self._freq, 0.50)
self.laser_pulse.CfgImplicitTiming(DAQmx_Val_ContSamps, 10000)
self.laser_pulse = Task()
self.laser_pulse.CreateCOPulseChanFreq("Dev1/ctr0", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, self._freq, 0.50)
self.laser_pulse.CfgImplicitTiming(DAQmx_Val_ContSamps, 10000)
The AO tasks:
self.analog_output = Task()
self.analog_output.CreateAOVoltageChan("Dev1/ao0", " ", -10.0, 10.0, DAQmx_Val_Volts, None)
self.analog_output.CreateAOVoltageChan("Dev1/ao1", " ", -10.0, 10.0, DAQmx_Val_Volts, None)
self.analog_output.CreateAOVoltageChan("Dev1/ao2", " ", -10.0, 10.0, DAQmx_Val_Volts, None)
self.analog_output.CfgSampClkTiming(" ", self._freq * self._sampFreq, DAQmx_Val_Rising, DAQmx_Val_ContSamps, self._sampFreq)
self.analog_output.CfgDigEdgeStartTrig("/Dev1/ctr0out", DAQmx_Val_Rising)
self.analog_output.WriteAnalogF64(self._sampFreq, 0, -1, DAQmx_Val_GroupByChannel, self._data, byref(self.read), None)
self.laser_pulse.StartTask()
self.analog_output.StartTask()
I'm writing python, but i'm also happy with solutions in C. Please help!