LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange marks during reading Rs232 buffer

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 5
(3,622 Views)
  1. You should only be configuring your port once.  That should be done before this loop.  By configuring the port inside of the loop, you are reinitializing that port with every call.  That could cause weird things while the configuring is happening.
  2. You should probably have a wait sometime between your write and your read to allow your device to respond.
  3. Is your device sending an End Of Line character at the end of each message?  If so, get rid of the "Bytes At Port" propery node.  Just tell the read to read something really large.  It will automatically stop reading when that End of Line character is found.  If it isn't sending that character, you should disable that with the Configure Serial Port (that you should have BEFORE that loop).

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,612 Views)

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.

0 Kudos
Message 3 of 5
(3,609 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,606 Views)
Solution
Accepted by topic author Mirasoul

Problem solved.

The solution was as easy as possible.

Ive just added a Number to Hexadecimal Conversion....

 

Thanks for answers!

Best regards.

0 Kudos
Message 5 of 5
(3,549 Views)