LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SSI RS422: read finite digital samples off of rising edge for digital pulses

Solved!
Go to solution

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);

 

0 Kudos
Message 1 of 2
(3,558 Views)
Solution
Accepted by topic author Sneaker

I ended up solving this by connecting the output clock to a trigger line and calling DAQmxRegisterEveryNSamplesEvent. Did the trick.

0 Kudos
Message 2 of 2
(3,540 Views)