From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring digital output with external clock on PCI 6713

Solved!
Go to solution

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!

0 Kudos
Message 1 of 2
(2,669 Views)
Solution
Accepted by topic author kfriedl

So I could not get the DOChannel working, but found another solution with counters. Fortunately I could get hands on another card, the PCI 6602 which has several counter channels. On this card I split up my pattern in several PulseChanTime tasks and synchronized them by an edge trigger which is a PulseChanFreq task. So if anyone's got a similar problem with DO channels, this might be an alternative.

0 Kudos
Message 2 of 2
(2,633 Views)