Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
RS485Master_Receive
341
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure RS485Master_Receive(var data_buffer: array[5] of byte);
Returns
Nothing.
Description
Receives messages from Slaves. Messages are multi-byte, so this routine must
be called for each byte received. 
Parameters : 
data_buffer
: 7 byte buffer for storing received data, in the following manner: 
data[0..2]
: message content 
data[3]
: number of message bytes received, 1–3 
data[4]
: is set to 255 when message is received 
data[5]
: is set to 255 if error has occurred 
data[6]
: address of the Slave which sent the message 
The function automatically adjusts data[4] and data[5] upon every received mes-
sage. These flags need to be cleared by software.
Requires
MCU must be initialized as a Master for RS-485 communication. See
RS485Master_Init.
Example
var msg : array[20] of byte;
...
RS485Master_Receive(msg);