Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communication using the PROMOTIC drivers
Basic properties of the driver
- Usage of this driver requires purchase of the PmModbus license
. With the freeware version PmFree
, or when developing the application (with development environment
for tersting purposes), this component is always functional.
- The communication is done for serial link (COM1, COM2 ...).
- The PROMOTIC application is always the SLAVE
from this communication point of view (i.e. the other side initiates the data transfer). For MASTER
communication see the PmModbusMr
- The driver supports only the RTU mode for the SLAVE.
3 Modbus data types are supported:
- Bit (1Bit): stored in the PLC on 1 bit. In the PROMOTIC application it is represented by the Boolean data type.
- Word (2Byte Unsigned Integer): stored in the PLC on 16 bits (value from 0 to 65535). In the PROMOTIC application it is represented by the Long data type.
- Int (2Byte Signed Integer): stored in the PLC on 16 bits (value from -32767 to +32767). In the PROMOTIC application it is represented by the Integer data type.
The communication description by means of the PmaCommMsg objectThe description of the protocol functions:
Each of eight messages can be started only once. It means that in the PROMOTIC system only eight messages can be defined together. If we need to read different memory fields, then the communication proceeds as follows:
- Master sends a query on the memory.
- In the onDataReceive
event the designer finds out from the Data-received
page which address and the data amount are required from the Master
and it fills the Data-sent
page by them. If it doesn't have the data available, then it sets the "Validity
" item to false
(invalid data), otherwise it sets this item to true
(valid data) on the "Data-sent
- The communication finds out if the "Validity" differs from false and it sends the appropriate data to the Master.
Note: If the "Validity" is set to true and the "Data-received" page isn't filled in the onDataReceive event, then the communication sends always the same data to the Master, regardless of the address that is requested by the Master.
Caution! If the "Validity" item is set to false, then the communication DOESN'T ANSWER the request !
List and description of the communication messages:
01 - Read Coil Status (Read Output Bits): This message reads n output states (1-bit values)
02 - Read Input Status (Read Input Bits): This message reads n input states (1-bit values)
03 - Read Holding Registers (Read Output Registers): This message reads n output register (16-bits values)
04 - Read Input Registers: This message reads n input registers (16-bits values)
05 - Force Single Coil (Write 1 Bit): This message writes into one state (1-bit values)
06 - Preset Single Register (Write 1 Register): This message writes into one register (16-bits values)
15 - Force Multiple Coils (Write n Bits): This message writes into n state (1-bit values)
16 - Preset Multiple Registers (Write n Registers): This message writes into n registers (16-bits values)