12-01-2005 10:33 AM - edited 12-01-2005 10:33 AM
OK, I'll try to explain but at some point you may want to work through the free on-line LabVIEW course offered here so that you can better understand this stuff...
I have taken the AWG_MakeWaveformData.vi and cleaned it up so that it is easy to see everything that is going on, annotated it and attached it. See it that makes it any clearer and if you still have questions ask them (being very specific about what parts you do not understand).
Message Edited by Warren Massey on 12-01-2005 08:40 AM
12-01-2005 10:46 AM
12-01-2005 12:31 PM
I've attached a zip file that contains a couple of VIs that will convert a properly-formatted TXT file into a WFM file. I've also included a properly-formatted TXT file. You can use the previously-posted READ FILE II.vi to prove that the process is reversable.
 
I’ll leave it up to you to deal with data files that are not properly formatted.
After all, I can’t have all the fun now can I?
 
If it were up to me, I’d rewrite the AWG_MakeWaveformData II.vi, turning it into a state machine that first recognised the data file format and then extracted the pertinent data from the file and then formatted the data into a proper output data stream. I don’t know what you are going to do about generating the value for the CLOCK parameter if it is not in the file since it cannot be determined by looking at the file data if it is missing from the file.
 
Just a hint – it is easy to convert a file like your “waveform.txt” into a file like your “sine.txt” just using the “speadsheet string to array” and “array to spreadsheet string” VIs and a couple of constants. But then if you really do use a state machine to do all this then it may actually be easier to just use the “speadsheet string to array” VI only to convert both file types to a common array type and then process the array of string data (rather than a string of data) into the properly-formatted output string.
And, if you do much with state machines, here is a tool that makes wiring them as they evolve much easier.