UART sends and receives data between the PLC and its peripheral devices, especially a host PC. In LDMicro there some UART instructions to use.
- UART RECV : Is avail ?
This instruction output true whenever its buffer is not empty. It's just a flag for testing the availability of data.
|
UART RECV : Is avail ? |
- UART (SERIAL) RECEIVE
This instruction reads data from UART buffer and send it to a destination.
|
UART (SERIAL) RECV |
We have to set the number of bytes and its destination to store.
- UART (SERIAL) SEND
This instruction reads data from a source and send it over the UART.
|
UART (SERIAL) SEND |
Source is a data source to read from and it will be send to the UART transmit buffer.
Within this example, I use these basic three instructions to read data from UART and send it back to the UART terminal.
|
PLC Simulation echos received data |
The ladder diagram of this example made by a single rung.
|
Ladder diagram program |
Click here to download a full zip file of this ladder diagram example.
No comments:
Post a Comment