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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Need example source for SPI design with NiDAQ

Hi,

 

I'm trying to use the PXIe-6363 as a SPI master. My Python software framework does not allow for a bit-banging approach. I need to output the waveforms for the CLK, MOSI, and SS lines while capturing the MISO data. I'm controlling the equipment through VISA and am having problems loading the waveforms and triggering all four lines at the same time. I found a post related to this (http://www.ni.com/example/31200/en/#toc3) but it doesn't have any source code. I would like a source code example of how I can do this. For example,

 

active_task = PyDAQmx.TaskHandle()
PyDAQmx.DAQmxCreateTask("", ctypes.byref(active_task))

DAQmxCreateDOChan(active_task, CLK_Channel, "", PyDAQmx.DAQmx_Val_ChanPerLine)

DAQmxCfgSampClkTiming(...)

DAQmxWriteDigitalLines(...)

...

# Set up other lines

...

DAQmxSendSoftwareTrigger(...)

 

I would also like to know if I could do this across multiple PXIe-6363 cards. Let's say I have three cards that control the three lines. How would I do this?

 

Thanks,

Jenny

0 Kudos
Message 1 of 3
(3,936 Views)