some problem in RS-232 
Author Message
 some problem in RS-232

Quote:

> hello~ all

> i'm trying to comunicate with a balance of mettler.
> i configured the baud rate, data bit, stop bit, etc. except
> flow control.

> then the type of received data is correct, but the starting point is
> irregular.
> for example, if it is correct (st +34.45345), the data i received is (st
> +34.45345
>                                         st +35.35345
> +35.35345 st
>                                         st +36.45455
> .45455 st +37
>                                         st +37.45336
> 4336

> what is the problem?

> regard

> y.s yi

#################

Hi y.s. yi,
I also had problems like yours in the past, as I wasn't to familiar with the
RS-232.
First, you don't mention in your posting, if you use VISA, or the regular
(old) VIs.
If you use the old ones, like I do it should work, if:
- you first flush the serial input buffer before sending the data request to
the Mettler weighing Instrument, because there may be some bad data
(distortion) in the buffer.
- second, you should know and specify how many databytes you want to read
from the input buffer, or you determine how many bytes there are in the
input buffer and then read them all. (Bytes at serial port.vi and serial
port read.vi)
If you are good at programming and the Mettler sends allways the same
termination Character after replying, you may write a VI which determines
the amount of bytes in the input buffer, then read the input buffer and
store the contains in a string. If the termination character occurs in the
string, then use part of the string from the beginning to the termination
character. If the terminator does not occur, wait some milliseconds, and
repeat from determining the bytes in the buffer again and concatenate the
second portion of bytes to the first one. Then search for the terminator
again. Do this until you find the terminator in the complete concatenated
string, or break with an error because of timeout, whatever occurs first.
Dont forget to close the serial port, if you are finished using the serial
port.
Oh, btw. Because I myself use RS-485, I don't have to care about
handshaking. I can't say if this is importend in your case.

Good luck,
Rainer



Fri, 09 Jul 2004 19:07:19 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. some problem in RS-232

2. Problems with RS 232

3. RS-232 Problem

4. RS-232 problems

5. RS-232 problems

6. Visibility of an RS 232 converter on USB

7. VisualAge Smalltalk RS 232 Communication

8. Placing RS-232 Data into the Keyboard Buffer?

9. simple RS-232 advice for labview novice

10. push botton for RS 232 serial bus

11. ASCII AND RS 232

12. RS-232

 

 
Powered by phpBB® Forum Software