12-03-2013 11:21 AM
Hello,
I have got the problem with read Rs232 buffer.
I am sending a frame to initiate an buffer from RAM of the external device. Everything looks correct, the device is answering, but during reading a feedback message i receive a strange marks(attached jpg). I wrote adequate software in c# to have sure the external equipment is available, it works. So i checked if in my .vi are any bytes in the received buffer of Rs232, yes they are...So the problem is in LABView. Does anyone have had the same situation?
I am wondering if there is no any problem with fonts or something?
Thanks for any tips.
Solved! Go to Solution.
12-03-2013 11:43 AM - edited 12-03-2013 11:45 AM
12-03-2013 11:44 AM - edited 12-03-2013 11:47 AM
What data do you expect to get back?
Is it binary data? In that case, you are seeing the ASCII characters of some of the bytes.
Do you have a flaky or noisy cable?
Do you know if you have the serial ports settings correct? (Baud rate, stop bits, data bits, parity)? If you have a device sending 7 data bits with some parity, and you read it as 8 data bits, then those parity bits are going to give you some odd looking data, and values that are from the upper half of the ASCII table.
EDIT:
As CrossRulz said, the configuration of the port should be outside the loop. Also, the Bytes at Port method of reading the serial port I find is wrong at least 90% of the time. Particularly when you don't leave any time between when you write the command and when you read the response.
12-03-2013 11:50 AM
Ah, just noticed something. Your "Bytes at Port" returned 70 characters, but you only read 5. That is a termination character issue. So as I asked before, is your device sending an End of Line character at the end of each transmission?
What type of data are you looking for? As RavensFan already stated, if you are sending/recieving binary data, you need to disable the Termination Character.
12-09-2013 06:24 AM
Problem solved.
The solution was as easy as possible.
Ive just added a Number to Hexadecimal Conversion....
Thanks for answers!
Best regards.