01-04-2010 04:59 PM
Ok, I tried what you suggested but still can't work out all the details yet. So my understanding is that the idea is to keep building an array until the iteration count reaches 6, right? While I'm not completely sure of how exactly that example vi does it, I tried something similar. (if arraysize==6 is true, write it to a file. if false, keep collecting.) At least that's what I think it should do. However, it just is not working. Also, it now appends a mysterious character (appears like a square in notepad, or a square with a question mark inside in MS Word) in front of each data point, which is a problem, and I'm not sure what is causing it.
I need further help. (This task would be trivial for me in any other language, but Labview is supposed to be good for daq so I would rather get it to work here than start over in another language.) As of now it just writes a txt file with a jumble of numbers. I really need just six columns of strings. Any suggestions?
Once again, thank you so much for your help.
01-04-2010 07:21 PM
Your crazy character is a non-printable ASCII character. It is probably coming out of your GPIB reads. Try setting some of your string indicators to hex display or \codes display to see where it might be coming from. With one of the other display formats, you'll be able to see which ASCII character that is to figure out how to handle it.
The reason you are getting just a string of characters is that you are building your array that way. Try putting a carriage return or line feed at the end of each string that you are building into the array.
Something doesn't feel right to me about using reshape array in the first frame of your sequence structure. I'm thinking that a delete from array or array subset would be better. But I can't be sure whether that reshape array is working or not working for you since I don't have your device (or the missing subVI) to be able to try to run your code.
01-05-2010 04:21 AM
Your code has some strange constructs, for instance you check if the size of the array is 6, and if the size is 6 you will reshape (not trim) it to an array of 6 elements.
I think the 'strange' element is the size of the actual string element. Could you upload the created file?
I think it's better to use the Array to spreadsheet string function.
The false constant you used removed the size of the array, not the size of the strings inside the array.
Using binary write will include this info.
Before each element you should find 4 bytes that contain the length of the element, since the size is most likely smaller than 255, the first 3 will be zero (null).
With a hex-editor you could inspect this.
Ton
01-05-2010 10:47 AM
questiona3 wrote:Also, it now appends a mysterious character (appears like a square in notepad, or a square with a question mark inside in MS Word) in front of each data point, which is a problem, and I'm not sure what is causing it.
You initialize the array as an array containing an empty string as single element (array size=1). I would recommend to initialize with an empty string array instead (array size=0). Not the same!
Just delete the empty string constant and "built array" and make the output tunnel to "use default if unwired".