07-05-2010 07:02 PM
Hey guys,
I was wondering if there is a method of uploading an *.ASC or *.DAT file to convert into a 2-D boolean array.
For example, I would create an .asc or .dat file composed of strings using MATLAB to generate
1 1 0 1 1 0 1 1
0 1 0 0 1 0 0 1
1 0 0 1 0 0 1 0
and it would convert the string to a 2-D boolean array of
T T F T T F T T
F T F F T F F T
T F F T F F T F
so that I can ultimately use it to create a modified Digital waveform graph like this:
The purpose is because I will be using sample rates of 0.1 second intervals that spans to 2-5 minutes.
So to sum it up:
1. upload a *.ASC or *.DAT file with a 2-D array strings
2. convert the file to create a 2-D boolean array for use to create the digital waveform
Any help will be appreciated. I know it isn't much but I've uploaded the 2-D array to waveform *.VI for testing purposes.
Solved! Go to Solution.
07-05-2010 07:26 PM
Use the Read From Spreadsheet set for integer and wire the 2D output to Nor Equal Zero function.
07-05-2010 07:45 PM
Dennis,
Thanks for the help so far,
However, when I tried that first, it doesn't know how to separate each column of the *.asc file
1 0 0 1 0 0
0 1 1 0 1 1
turns out just to read the first column
T
F
therefore, I've been trying to find a way to work around so I posted here on a clean slate so I don't confuse people. If there is a way to fix this problem then that will be awesome 🙂
07-05-2010 08:39 PM - edited 07-05-2010 08:41 PM
@sdkpark wrote:
However, when I tried that first, it doesn't know how to separate each column of the *.asc file
1 0 0 1 0 0
0 1 1 0 1 1
turns out just to read the first column
Please attach your VI instead of a meaningless picture.
Read from spreadsheet file will read all 2D data if used correctly. The defined delimiter is separating items, and linefeed separating rows. For example if you don't wire the delimiter, it will assume "tab" and only one value will get read per line if it is actually a space character. Try a delimiter of "space".
07-05-2010 08:45 PM
oh wow thanks very much. didn't know you can use space as delimiters.
thanks again.