02-11-2016 03:12 AM
I have to read data from an instrument that uses SSI RS422 communication. I must pulse the clock line N finite number of pulses (at any update rate) and on the rising edge of each pulse take a digital sample eventually compressing into a N size word. Pulsing is fine but I can't get my timing right for the read. Is there a way to trigger off the rising edge of that pulse? I have verified I do get reasonable data via a logic analyzer on an oscilliscope, so it's defintely my read approach.
I am using a PXI-6289 and pulsing via ctr 0 out.
Here is my configuration for the task
DAQmxErrChk (DAQmxCreateTask("",&readTaskHandle)); DAQmxErrChk (DAQmxCreateDIChan(readTaskHandle, "/PXI1Slot15/port0/line0", "", DAQmx_Val_ChanPerLine)); DAQmxErrChk (DAQmxSetTimingAttribute (readTaskHandle, DAQmx_SampClk_Rate, freq));
Here is the timer callback
DAQmxStartTask(taskHandle); DAQmxStartTask(readTaskHandle); DAQmxReadDigitalU32 (readTaskHandle, DAQmx_Val_Auto, 10.0, DAQmx_Val_GroupByChannel, data, num_samps, &samps_per_chan, 0); DAQmxWaitUntilTaskDone (taskHandle, 0.001); DAQmxStopTask(taskHandle); DAQmxStopTask(readTaskHandle);
Solved! Go to Solution.
02-11-2016 12:26 PM
I ended up solving this by connecting the output clock to a trigger line and calling DAQmxRegisterEveryNSamplesEvent. Did the trick.