05-08-2013 03:38 PM
Hi,
I am reading data thru a serial interface, as the data is received is concatenated in a data string. When I write this data in a listbox is not properly displayed line by line, meaning there is empty row or 2 rows make a complete line. This format issue is caused by the serial data received sporadically.
How could I fix this issue? How could I take the concatenated string look for the termination character send by the serial device and have properly displayed text in a listbox?
frn
05-08-2013 03:47 PM - edited 05-08-2013 03:49 PM
Hi frn,
there is empty row or 2 rows make a complete line. This format issue is caused by the serial data received sporadically.
You might avoid that "default if unwired" output of the case structure: they (can) cause empty rows in your listbox!
The "format issue" is not caused by how the data is received, it's caused by you not splitting that data at the correct points...
How could I take the concatenated string look for the termination character send by the serial device and have properly displayed text in a listbox?
Use that termchar in your serial communication to receive full strings from VISARead. Get rid of BytesAtPort!
And you might use BuildArray instead of your Rube-Goldberg-wise use of InsertIntoArray...
05-09-2013 12:37 PM
Thanks GerdW,
I made a few changes to the code and it is working. however, I have to write to a file and then read from the same file in order to make it work, which is a bad work around and I just wonder if I just missed something very simple to duplicate the function of writing and reading from same file. BTW, it need to use BytesAtPort, because other restrictions. Please advise. Thanks.
05-10-2013 01:45 AM
05-13-2013 11:55 AM
Thanks GerdW for your comments but I am working at another issue and come to this issue later.