Configuration
The server can receive Modbus functions via TCP/IP.
Modbus areas
The Modbus specification defines these four modbus-areas:
Modbus-areas | Data type | Access | Example |
---|---|---|---|
digital inputs (Discrete Inputs)
| 1 Bit | Read only | |
digitale outputs (Coils) | 1 Bit | Read / write | |
Input registers | 16 Bit | Read only | |
Output registers | 16 Bit | Read / write |
After the installation the modbus areas are mapped to the PLC areas. Check the article about the default-mapping.
The TwinCAT Modbus TCP/IP server configurator is used for configuring this mapping.
ADS-Access
If you want to access the specific modbus areas, you have to add these global variables to your PLC project.
VAR_GLOBAL
mb_Input_Coils : ARRAY [0..255] OF BOOL;
mb_Output_Coils : ARRAY [0..255] OF BOOL;
mb_Input_Registers : ARRAY [0..255] OF WORD;
mb_Output_Registers : ARRAY [0..255] OF WORD;
END_VAR
Further Information