Download mikroPascal PRO - MikroElektronika
Transcript
mikoPascal PRO for dsPIC30/33 and PIC24 RS485Slave_Receive Prototype procedure RS485Slave_Receive(var data_buffer : array[20] of byte); Description Receives messages from Master. If Slave address and Message address field don’t match then the message will be discarded. Messages are multi-byte, so this routine must be called for each byte received. Parameters - data_buffer: 6 byte buffer for storing received data, in the following manner: - data_buffer[0..2]: message content - data_buffer[3]: number of message bytes received, 1–3 - data_buffer[4]: is set to 255 when message is received - data_buffer[5]: is set to 255 if error has occurred The routine automatically adjusts data[4] and data[5] upon every received message. These flags need to be cleared by software. Returns Nothing. Requires MCU must be initialized as a Slave for RS-485 communication. See RS485Slave_Init. Example var msg : array[8] of byte; ... RS485Slave_Read(msg); Notes None RS485Slave_Send Prototype procedure RS485Slave_Send(var data : array[20] of byte; datalen : byte); Description Sends message to Master. Message format can be found at the bottom of this page. Parameters - data_buffer: data to be sent - datalen: number of bytes for transmition.` Valid values: 0...3. Returns Nothing. Requires MCU must be initialized as a Slave for RS-485 communication. See RS485Slave_Init. It is the user’s responsibility to ensure (by protocol) that only one device sends data via 485 bus at a time. Example var msg : array[8] of byte; ... // send 2 bytes of data to the Master RS485Slave_Send(msg, 2); Notes None MikroElektronika 443
Related documents
mikroC PRO for dsPIC User Manual
RealView Compilation Tools Compiler User Guide
mikroPascal PRO for PIC32 User Manual
User manual - MikroElektronika
Data Sheet - MikroElektronika
Design of a Hands-on Course in Networked Control Systems
LM1095E - topwaydisplay.com
Manual - Digi-Key
mikroC PRO for PIC User Manual v100
mikroC PRO for AVR User`s Manual
mikroC for 8051 User Manual
mikroBasic PRO for AVR User Manual v100