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.

Multifunction DAQ

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
Message 1 of 5
(4,530 Views)
0 Kudos
Message 2 of 5
(4,520 Views)

Hi,

 

I looked through the link and found many VI files which I don't understand... There were a lot of links so I could have missed something. I also don't have an Examples folder in my National Instruments\NI-DAQ\ install folder.

 

I don't specifically need a SPI design...I could live with an example that shows me how to output waveforms on multiple channels and capture on multiple channels simultaneously and upon a software trigger. I could then build my SPI master from there. The CHM files that come with the Ni-DAQ do not show you how to simultaneously control multiple channels.

 

Thanks,
Jenny

0 Kudos
Message 3 of 5
(4,506 Views)

Hi Jenny,

 

I found some documentation that covers physical channel syntax:

Physical Channel Syntax (I have the link set to open in a new page).

 

It also may be worth your time to browse through the LabWindows/CVI discussion forums: LabWindows/CVI (I have this set to open in a new page).

 

Let me know if this helps get you started.

 

Regards,

 

G-IV

 

 

0 Kudos
Message 4 of 5
(4,470 Views)

@Jennyatcypress wrote:

Hi,

 

I looked through the link and found many VI files which I don't understand... There were a lot of links so I could have missed something. I also don't have an Examples folder in my National Instruments\NI-DAQ\ install folder.

 

I don't specifically need a SPI design...I could live with an example that shows me how to output waveforms on multiple channels and capture on multiple channels simultaneously and upon a software trigger. I could then build my SPI master from there. The CHM files that come with the Ni-DAQ do not show you how to simultaneously control multiple channels.

 

Thanks,
Jenny


The examples for NI-DAQmx for C language are in C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C

 

 

0 Kudos
Message 5 of 5
(4,466 Views)