Components

cancel
Showing results for 
Search instead for 
Did you mean: 

[Deprecated] SPI Digital Waveform Library

Hi David,

 

After I download the SPI Digital Waveform Reference Library in the link:http://zone.ni.com/devzone/cda/epd/p/id/6163 and install it, I get a install error, it says:"InstallerError 11005 Fatal Error. Unable to find initialization file."  Why is that?

Software information of my computer: windows 7, LabVIEW 2011 and LabVIEW 2012.

 

Thanks very much!

 

Pengyu Zhou

Guangzhou, China.

0 Kudos
Message 131 of 200
(2,089 Views)

Hello Dear.

I have NI 6009 usb Daq card and I want to acquire analyze abd control signals from multiple sensors. Problem is that despite of analog sensors I have got two digital sensors, and for getting signals from them I have to do serial Communication and I want to do it with SPI. Is it possible to do it or any other solution ?????  Urgent Help needed.

 

Thanks in Advance.

 

Naseem Abbas Solangi.

0 Kudos
Message 132 of 200
(1,967 Views)

Hay Naseem,

 

You probably should have started a new thread. Regardless, you aren't going to be able to do SPI communication with the 6009, as the digital lines are static (not clocked).
 If you want to use the SPI digital Waveform Library you would need a DAQ card with clocked digital lines, like the NI USB-6341. A cheaper option, and perhaps easier if you simply want to add functionality to a system already using the 6009 would be to get a NI USB-8452.

Regards,
Dan King

Message 133 of 200
(1,961 Views)

Thanks Dan;

Since I am bit new to Labview and Daqs, can you sujjest me any solution for doing Serial Communication via NI 6009 without buying any device ??? The thing that I am trying to ask is that Serial Communication is possible via NI 6009 or not. Thanks

 

With Kind Regards

Naseem Abbas Solangi.

0 Kudos
Message 134 of 200
(1,945 Views)

Hello Naseem,

 

The problem is that serial communication generally requires a clock signal; SPI requires a clock signal. The 6009 doesn't have clocked digital lines. It may be possible to software time your lines if you could run at around 100 Hz, but that's not even going to be close to where you need to run a SPI bus.

In short, the 6009 will not work as part of a SPI solution. You need to get another device if you want to perform SPI communication.

Regards,
Dan King

0 Kudos
Message 135 of 200
(1,942 Views)
I've been using this Library along with a HSDIO card(6551)to do SPI Writes and Reads. In my Read VI, I have a waveform display showing all the four SPI lines, Is there any way I can output this info to a file(text or excel)? I'm especially interested in capturing the state of MISO on every clock edge in the SPI Read routine and saving it as a file. Can someone with more experience shed light on how to do this. Thanks in advance.

Regards,
Priyatham.
0 Kudos
Message 136 of 200
(1,890 Views)

Hello Priyatham,

 

Without seeing the code in question that question is a little more difficult. You could try the Write to Measurement File Express VI as a quick solution, with lower level VIs as a backup if you need a very particular format to your file. If that doesn't work, post either your code or a small VI that simulates the specific sction of code that you want to add functionality to.

Regards,
Dan King

0 Kudos
Message 137 of 200
(1,881 Views)

Hi Dan

 

Thanks a lot for the reply. I'm attaching my SPI Read code here. I remember starting off with an example that was posted in this forum and only modifying it slightly. So you might be very familiar with this. Please let me know if you need something else.

 

Regards,

Priyatham.

0 Kudos
Message 138 of 200
(1,875 Views)

Hello Priyatham,

 

I took a look at your code. It looks like you want to decode your returned data and save the decoded bitstream. The truth is, once the binary data is decoded, saving to a file is as easy as using the Write to Spreadsheet VI or creating your own custom file I/O subVI.

As for decoding the bit stream, I think the following bit of code is close to what you need:

Screen Shot 2013-07-24 at 3.34.36 PM.png

 

  1. I'm just trying to simulate your data using the Digital Pattern Generator VI.
  2. You seem to be uninterested in t0 or dt, so pulling out the Y values before displaying the data seems like the best bet. This is also necessary in order to get to the raw data.
  3. Strangely, the array is indexed in reverse line order, with Line 0 being the 4th column (or column index 3). This is what I am treating as the clock, depending on what line your clock actually is, you would need to change the value of this index.
  4. This probably should have been done outside of the for loop, so this could be improved. Basically indexing out the current sample on the desired data line for decode.
  5. This is some neat logic. The check for zero sets up the condition for a future transition, with the logic only coming out true if the value of the clock in the previous iteration was 0 while the value of the clock in the current iteration is non-zero (or 1).
  6. The conditional index is a neat feature in LabVIEW 2012 which makes this whole thing a lot cleaner, only returning the values from the data line when there is actually a low-high transition.

This should get you past the hard part. In terms of File I/O I would check out the File I/O shipping examples that come with LabVIEW for pointers on that aspect of your code.

Regards,
Dan King

Message 139 of 200
(1,866 Views)

Hi Dan

 

Thanks a lot for the help, that worked!!! I deleted the first few elements of the decoded array(until it has valid output data on MISO) and used Write to Spreadsheet file VI to output the data into an excel file.

 

The only thing is that in my excel file information is displayed bitwise and I would like to have them displayed as bytes. For example the excel file looks like(I used the Transpose True in Write to Spreadsheet VI):

 

1

0

0

1

1

0

0

1

1

0

1

0

0

1

0

1

 

And I would like it to look like:

 

10011001

10100101

 

Basically I would like to convert the bit wise array into bytes. I have been looking into different functions, but haven't found a way to do it so far. Is there any function in Labview I can use to do this?

 

Regards,

Priyatham.

0 Kudos
Message 140 of 200
(1,858 Views)