LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Bus Read Problem on NI 8452 using Labview

Solved!
Go to solution

Hi Guys,

Thanks for your help as usual.

Please see the attached clip of a SPI Write / Read sequence.

Hardware 8452.

VI shown is  sub-VI

The function works perfectly in write mode... writing to a DAC, DAC responds correctly.

However, I'm trying to read back the data I'm writing out, as a confirmation that the system is powered up and working.

I get nothing but 0's back on the read.

If I connect the array directly to the write array, the data will be shown correctly.

Can you help??

 

Thanks

Mike

0 Kudos
Message 1 of 3
(2,256 Views)
Solution
Accepted by topic author Mike-san

I am not familiar with the SPI write/read function, but I can ask some general questions:

 

You are performing a write and the instrument responds properly. You want to read data in the buffer and get only 0's. Are you expecting there to be data in the buffer to read?

 

The read may need to be performed repeatedly, in a while loop for example for you to receive the data you want.

 

Also, are you sure your insert subarray is behaving exactly as you expect? Is this aiming to be a buffer of the data out? Probing the output of the write read might give you a clue.

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 2 of 3
(2,233 Views)
Solution
Accepted by topic author Mike-san

Hi Max,

 

Thanks for your reply.

 

Yes, I am expecting data in the buffer after the write and it's a good idea to probe the device and confirm.

The subarray and read back seems to be working correctly if I connect it to the array thats driving the write... so I'm expecting the same mechanism will read data out of the SPI Write/Read function.

 

Just wondering if I'm missing something with the Labview function.  I'll probe the device to see if it is reading back as advertised.

 

Thanks again!

Mike

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