Ctrl Command rs232_config
Function
configures the RS232 interface for the specified baud rate.
Call
rs232_config( BaudRate )
Parameter
BaudRate
Comments
• The default value is 9600 baud.
• The other RS232 interface parameters cannot be altered (data bits: 8, start bits: 1, stop
bits: 1, parity: none).
• Also see
®
®
RTC
4 RTC
5 new command
rs232_write_data,
References
Ctrl Command rs232_read_data
Function
reads a value from the input buffer of the RS232 interface (see
Call
RS232Data = rs232_read_data()
Result
unsigned 32-bit value:
Bit #0 (LSB) ...
Bit #7
Bit #8
Bits #9...#15
Bits #16...#23
Bits #24...#31
Comments
• The RS232 interface is internally read every 10 µs (one character at a time). This char-
acter, if new, is stored in a 256-character ring buffer that can be transferred to the user
program via rs232_read_data (asynchronously to reading).
• Byte #0 (bits #0
• Byte #1 (bit #8) indicates if the character has already been read by the user program.
• Byte #2 (bits #16
haven't been read by the user program. If no unread characters are present (byte #2 =
0), then the most recently read character is transferred with "new bit" = 0.
• Byte #3 (bits #24
sponding number of characters were overwritten and therefore irretrievably lost). To
reset the overrun counter, call rs232_read_data that many times.
• Example: return value 459098 = 0x0007015A = (0, 7, 1, 90) means: character 90 ('Z')
was read and is new (1), 7 additional characters remain to be read, the buffer was never
overrun (0).
®
®
RTC
4 RTC
5 new command
Version info
Last change with version RBF 513
References
rs232_write_data
®
RTC
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
baud rate as an unsigned 32-bit value;
allowed value range: [300 ... +115200]
"RS232 Interface", page
51.
rs232_read_data
next (not yet read by the user program) value of the input buffer
"new" bit:
= 1:
The value is new (was not previously read).
= 0:
The value is old (was already read once by rs232_read_data).
0
Number of further (not yet read) characters
Number of buffer overruns
#7) returns only one character from the current reading position.
...
#23) indicates the number of characters in the input buffer that still
...
#31) indicates the number of overruns of the input buffer (a corre-
...
page
208).
394
Need help?
Do you have a question about the RTC 5 PC Interface Board and is the answer not in the manual?