04-01-2013 01:05 PM
I still having some problems with the VI. The VI is working but after some time it shows an error (it says that the string is not in the correct format, but when I monitor the serial port with the program tera term I can see that the data is shown properly). I don´t know whats hapenning. Can somebody help me? The VI is attached. Thanks
04-09-2013 07:50 AM - edited 04-09-2013 07:52 AM
The error is because the scan from string may not have values for each of the expected commas in the input string. That likely occurs when you did not fully read the serial port.
I would recommend that you have a routine (sub-vi) that reads the serial port. You would do this in a loop which keeps reading the port until you know that there is nothing more to read. |I have posted examples of such ocode on the forum. Then feed the input string of the "scan from string" function.