Digital I/O

Showing results for 
Search instead for 
Did you mean: 

How can a DIO card generate SPI data

I wish to control a digital potentiometer via DIO (6507 DAQ) using LabView. It seems most potentiometers use the 3 wire SPI compatible serial data input.
Does anyone know how to achieve this?
0 Kudos
Message 1 of 7
Hi Steve,
I am currently working on a project where I had to do what you are asking. The card I am using is a HS-6533 because I needed to be able to clock data at 375KHz. My application requires both transmitting and receiving a serial bit stream. In my app the transmitted words are 11 bits.
What you need to do is set your DIO card to write to 1 line. There are some examples under Hardware Input output/Traditional DAQ (LabVIEW Examples). They may not be much help (they were not for me).
Next format your data into a string of 1's and 0's which represents the correct data format for your application. This is then converted to a numeric array or you could skip the first part and just create the numeric data array. Next pass this numeric array to the DIO Write VI. There is more to it than this but I wanted to present the basic concept.
I can send you my custom solution if you are interested. You should be able to build your own by using mine as an example.

0 Kudos
Message 2 of 7
I am trying to simulate a manual variable potentiometer on a front panel using LabView, and using a digital potentiometer via a DIO card, hence speed is not a problem. If you could send me your solution then it may solve part of the solution.

0 Kudos
Message 3 of 7
Hi Steve,

Thanks for your post.

It sounds like Pat may have a solution that you can use, but if you get stuck later on then please let us know, I'll be glad to assist too.

National Instruments | Northern California
0 Kudos
Message 4 of 7
Hi Steve,

Here is the VI I said I had. I have tested it in my application and it works OK. It should work with any I/O card.
Port list is a value of 0 or 1 or 2 (if you have three ports). Set it to the port you are using. You do not have to specify a line. Do that in MAX. Make sure you set the direction to output. The string data should be an even count. Pad with zeros if necessary. If the count is odd the I/O will error out.

You could try setting this up with DAQmx. Try using the wizard. You will be surprised at how easy it is.

Hope this works for you and solves your problem.

0 Kudos
Message 5 of 7
Hello Pat,

I also want  to do this SPI communication using 6509.Is there  any options for giving clock using 6507?
Or can i use 6251 for doing the same operation.I was not able to open the attached vi properly.some vi's are given as question marks.I am using labview 8.5.Is your Vi will support DAQmx functions?

Thanks for your help
0 Kudos
Message 6 of 7

Hi Techiess,

I believe I wrote that vi in LabVIEW 7.1. It uses the 'Legacy' DIO vi's, not DAQ-MX. If you have your 'Device Drivers for Data Acquisition' CD's, then you can add the 'Legacy drivers'.

Hope this helps.


0 Kudos
Message 7 of 7