LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview - read data from file and converts to digital waveform

Hello

i am using Labview to perform hardware triggered digital read write for NI-PCI 6229 DAQ. i am using labview example at
C:\Program Files\National Instruments\LabVIEW 8.0\examples\DAQmx\Synchronization\Multi-Function.llb\
Multi-Function-Synch Dig Read Write With Counter.vi

In this example the data to be written to channels outputs are generated within a subvi and given as 2D array of size num. channels X num. samples
and converted the array to digital wave form. it uses a subvi "boolean array to digital".
i need to read the data from a file that would have data for each channel in columns (1 and 0s).  i tried to incorporate "Read from Text File.vi" example given in Labview which reads a files to an array. the function palette "Spreadsheet string to digital" converters string to digital waveform but not an array of numbers to digital waveform. "Boollean Array to digital" converts True/False array to digital  waveform but not numbers. one way to over come this is converts the array of numbers to array of boolean and then converts to digital waveform.

my question is what is the easier way to read from a file 1/0s and obtain teh corresponding digital waveforms. is there a example labview subvi for this.

thanks in advance.
regards
Ruwan
0 Kudos
Message 1 of 4
(3,799 Views)
The attached is assuming that the data is read from the file using "Read Characters From File.vi"
 
To see the file format, right click the string constant and select "\" Codes Display.
 
 
Best regards
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 2 of 4
(3,793 Views)
You should still be able to use the "Spreadsheet String to Digital" converter VIs, you just need to read the data from your text file as a text string. Then run the text string through the "Spreadsheet String to Digital" VI. You will then have a single Digital Waveform containing all of your channels. If you need one Digital Waveform per channel of data, then you can use the "Digital Signal Subset" VI in a for loop to create a 1D Array of Digital Waveforms with one channel of data in each waveform. See my included LabVIEW 8.0 example.
 
-Jared

Message Edited by JaredW on 05-15-2006 10:31 AM

0 Kudos
Message 3 of 4
(3,768 Views)
Thanks. that really helps.

-kind regards
Ruwan

0 Kudos
Message 4 of 4
(3,754 Views)