LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Digital Waveform with PXI 6552

Solved!
Go to solution

I am currently trying to follow the following tutorial regarding the PXI 6552: http://www.ni.com/white-paper/3671/en

 

This is the example I am referring to:

 

You can also use the Data Active event to control the relative delay between the response data and the active edge of the Sample clock. For example, you can export the Data Active event on PFI 1 and route it to PFI 2, which can be configured as the acquisition Start trigger source, as shown in Figure 8. You can export the generation Sample clock to DDC CLK OUT and set the acquisition Sample clock to STROBE.

Figure 9 shows a LabVIEW program that configures and externally routes the Data Active event and the Sample clock. The functions marked with an arrow perform the additional configuration required.


Figure 9. Using the Data Active event and Exported Sample Clock to Synchronize Generation and Acquisition


The acquisition operation must be started before the generation, as shown in Figure 10, to ensure that the acquisition is armed and ready to receive the Start trigger before generation begins. The final optional step is the analysis of the acquired data, which you can use to make a simple pass/fail decision. Rather than go into the software analysis of the acquired response data in more detail, the following section looks at how to use the real-time hardware compare feature to do this analysis more efficiently then can be done in software.


Figure 10. Ensure the Acquisition Is Ready for a Start Trigger Before the Generation Begins
 
My VI trying to mimic the example is below.  My question is:  how do I create the "digital data" control that they refer to by using the SPI Digital Waveform Reference Library?
 
My VI:
 
VI.JPG
 
I could only find one example regarding the SPI library, and it wasn't very descriptive.  It simply runs.  It is also attached and found below:
 
frontpanel.JPG
 
 
VI2.JPG
 
Does anyone know where I can find more information on this or could better explain what the SPI example is doing in relationship to what I am trying to do with the PXI 6552?


**Additionally, if I just try to run my VI as-is, it throws the following error and I have absolutely no idea what is causing it.  Perhaps this is related to by waveform just being empty for now?  If not, what am I doing wrong? 

Error.JPG
 
Thanks in advance for anyone who spends some time trying to assist me! 😄
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Download All
0 Kudos
Message 1 of 5
(3,399 Views)
Solution
Accepted by MrHappyAsthma

Hello MrHappyAsthma,

 

I'm looking at your code and I see that you have two acquisition sessions while the example has one acquisition and one generation sessions. This could be the reason behind the error.

 

The Digital Data control can be found by right clicking on the front panel and going to Modern>I/O>Digital Data.

 

Hope this helps.

Tarek B
Applications Engineer
National Instruments
Message 2 of 5
(3,364 Views)

Hi MrHappy,

 

I re-read your post and I would like to clarify something. The SPI library is responsible for creating the SPI data using the slave address, the MOSI data, sample rate, CS and SCLK information. This information will constitute the data that the HSDIO will write to the specified channels, which is the data control you circled in your screenshot. If your SPI data is not varying, you can simply copy the "SPI Waveform" indicator from the SPI Library example, paste it into your code and change it to a control that will replace the "data" control you have. If your SPI data will be changing, then you can incorporate both pieces of code (the SPI Library VI and your VI) and have the SPI Waveform output connect straight in to the Write Data: WDT block.

 

In other words, the SPI Library creates the waveform in software and the HSDIO code creates those waveforms in hardware.

 

Hope this clarifies things a bit.

 

Tarek B
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(3,328 Views)

Hello,

Can any one point me to where I can find examples of basic SPI Read waveform VIs using SDW toolkit? (In half duplex)

Thanks!

 

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

Morben,

 

An example VI is installed by the SPI Digital Waveform Reference Library. To open it using the NI Example Finder, select "Browse according to Directory Structure" and navigate to the SPI Digital Waveform folder. It can also be found at the installation path <lvdir>/examples/SPI Digital Waveform.

0 Kudos
Message 5 of 5
(3,104 Views)