03-22-2008 05:23 PM
03-22-2008 07:36 PM - edited 03-22-2008 07:37 PM
You should be able to just run your data straight in to the digital write function as long as you select the correct port width of your hardware.

If you want to do it with a digital waveform it's a bit trickier, the digital waveform data type is a surprisingly complex animal.
There might be a better way to do it, but this is what I've had to do in the past...
The "build digital data" function needs a 2D array in, so convert your 1D array into a 2D.
Then the digital data can be input into a Build Digital Waveform.
Then the digital waveform can be output with the write digital waveform.

03-22-2008 08:10 PM - edited 03-22-2008 08:20 PM
I've made a few assumptions in my 1st reply...
1. That you've read your data in as an integer array and...
2. That you only want to output 1 line of digital data (as opposed to a whole ports worth) and...
3. That the following vi doesn't do what you want it to...
In the 'Programming' >> 'Waveform' >> 'Digital Waveform' >> 'Digital Conversion' palette there is a 'Spreadsheet String to Digital.vi'
This would be the easiest way to do it (you may have to manipulate your string a bit depending on how you want your output to work).
So instead of using the 'Read from Spreadsheet.vi', you could use the 'Read from Text File.vi' and feed the string into the 'Spreadsheet String to Digital.vi' as shown above.
03-25-2008 09:45 AM
Thanks Troy K, I think one of my main problems was I was still using LabView 7.1 (I have since installed a newer version)
The Spreadsheet String to Digital.vi seems to do what I wanted... however I have run into another problem to do with writing the data to the digital output...
I'm using DAQmx write (Digital Wfm 1Chan NSamp) in order to output my data but this seems to ignore the timing of the input waveform.
In the The Spreadsheet String to Digital.vi I have set the sample rate to 1 and when I output this waveform to a digital graph I see the 1's and 0's spaced out by a second each. However, when I look at the output from my DAQmx write it seems to be doing it as fast as possible and not following the waveform correctly as a result. I expected the DAQmx write.vi to output the data with the same timing as the input waveform, what am I doing wrong?
Thanks.
03-25-2008 05:54 PM
03-25-2008 06:35 PM
03-25-2008 07:21 PM - edited 03-25-2008 07:22 PM
03-26-2008 07:36 PM - edited 03-26-2008 07:40 PM

03-26-2008 08:11 PM