The driver supports the usage of both PmaCommMsg and PmaCommGroup objects. For common data transfers, it is better to use the PmaCommGroup object.
For easy integration of this driver into the application it is handy to use: Preconfigurations in group "Modbus communication protocol"
In the PLC device: 1bit. In the PROMOTIC application: data type Boolean.
In the PLC device: 16 bits (value from 0 to 65535). In the PROMOTIC application: data type Long.
In the PLC device: 16 bits (value from -32767 to +32767). In the PROMOTIC application: data type Integer.
In the PLC device: 32 bits. In the PROMOTIC application: data type Long.
Only for messages of the 03, 04, 16 type.
The binary format of this type is the same as in PC, only the bytes order is changed (bytes order PC:1234, PLC:2143).
Identical as the previous data type, only the bytes sequence is different (bytes order PC:1234, PLC:4321).
Use for example: JUMO.
Identical as the previous data type, only the bytes order stays the same - as in the PC (bytes order PC:1234, PLC:1234).
In the PLC device: 32 bits. In the PROMOTIC application: data type Double.
Only for messages of the 03, 04, 16 type.
The binary format of this type is the same as in PC, only the bytes order is changed (bytes order PC:1234, PLC:2143).
Identical as the previous data type, only the bytes sequence is different (bytes order PC:1234, PLC:4321).
Identical as the previous data type, only the bytes order stays the same - as in the PC (bytes order PC:1234, PLC:1234).
In the PLC device: 64 bits. In the PROMOTIC application: data type Double. (bytes order PLC:87654321)
Only for messages of the 03, 04, 16 type.
8-byte integer cannot be stored in requested data type with full accuracy. Here it is stored to value of the Double type, but for some very big numbers the accuracy may suffer (maximum difference +-2047).
Use for example: Energy meter iEM3100(Schneider-Electric), Multimeter EPM-07S(ENTES) ...
In the PLC device: 32 bits. In the PROMOTIC application: data type Single.
Only for messages of the 03, 04, 16 type.
The binary format of this type is standardized by IEEE-754, so it is the same as in PC, only the bytes order is changed (bytes order PC:1234, PLC:2143).
Identical as the previous data type, only the bytes sequence is different (bytes order PC:1234, PLC:4321).
Use for example: ABB AC500.
Identical as the previous data type, only the bytes order stays the same - as in the PC (bytes order PC:1234, PLC:1234).
In the PLC device: 64 bits In the PROMOTIC application: data type Double.
Only for messages of the 03, 04, 16 type.
The binary format of this type is standardized by IEEE-754, so it is the same as in PC, only the bytes order is changed (bytes order PC:12345678, PLC:21436587).
Identical as the previous data type, only the bytes sequence is different (bytes order PC:12345678, PLC:87654321).
Identical as the previous data type, only the bytes order stays the same - as in the PC (bytes order PC:12345678, PLC:12345678).
Number of data bits | 8 for RTU mode, 7 for ASCII mode |
---|---|
Number of stop bits | 1 if parity is used, 2 if parity is NO |
TCP/UDP port number | 502 (for MODBUS TCP/IP data type) |
---|---|
Ethernet transfer type | TCP (for MODBUS TCP/IP data type) |
Protocol data type | Only for Ethernet. Specifies the protocol data form. It is possible to set: MODBUS TCP/IP - Standard Ethernet MODBUS communication. Compared to the data for serial link a special header is included and it is transferred via Ethernet TCP on port 502. The same data as for serial link - This option can be selected, for example, if the device is equipped with the serial link and it is connected to the Ethernet through the RS232/Ethernet converter. If the converter does no modifications to the transmitted data, then it is a very easy way how to communicate via Ethernet with devices not equipped with Ethernet interface. |
---|---|
Response receipt timeout | Only for serial link. The recommended value is for example 2000 ms. The time (in milliseconds) the driver is waiting for the response on sending the message. If no response comes during this time, then the transfer of the message is terminated (the onEndOfTransfer event is triggered with error 24 or 66). |
Transfer mode | The Modbus protocol includes two transfer options. In the parameters of the PmaCommMsg object message, the mode can be changed (for special cases, when necessaray to communicate with multiple PLCs in different modes). RTU - Most commonly used transfer mode, where the data is being transferred in binary form. ASCII - The transfer mode, where the data is transferred in ASCII form. This mode is not supported for MODBUS TCP/IP. |
The variables in the PmaCommGroup object (or even better the variables in the PmaData object with ExtComm data extension) can be of arbitrary number, type and order. The driver uses optimalised internal communication messages for reading the data from the device.
All variables are read (if the "Data refresh enabled" configurator is checked). When writing to the variable, only the single value is sent (if the "Auto send when writing to item" configurator is checked).
ItemId is the text identifier of the item that is used for addressing the value in the device. The ItemID configurator tells the driver how to receive or send the item value.
The text can be written manually, or it can be assembled in the window opened by the button to the right of the configurator.
Macro expression can be used for input (it is evaluated after starting the application).
A list of data areas:
The difference from the Bo area is only the write method (FN15 is used instead of FN05).
The difference from the Ro area is only the write method (FN06 is used instead of FN16).
Caution: The function FN06 cannot write 4 and more byte values (for example data types Long and Float).
Example: RoB38.0 is read/write of 0.bit in register 38.
The difference from the Ri area is only the write method (FN06 is used instead of FN16).
Caution: The function FN06 cannot write 4 and more byte values (for example data types Long and Float).
Default PLC address | The address defined here can be used for definitions in the "ItemID" configurator for the variables in this object (i.e. the variables on the "Data" tab or in the ExtComm data extensions). The address can be entered in ItemID: - as for example dev1... - then the value will be read from the PLC device with address 1. - or devD... - the "D" character means default, (it means that the address is taken from this configurator). This parameter can be modified and read in the script during runtime by methods: SetSpecParam("SlaveAddr") and GetSpecParam("SlaveAddr"). |
---|---|
Area base addresses | Here, the addresses of the beginnings of the data areas are entered (Bo, Bi, Ro, Ri). The addresses for these areas are preset to 0. (if the preconfiguration for a specific device is not used - see Preconfigurations / Communication / Modbus communication protocol). For another PLC types the addresses my be different (e.g. the addresses do not begin with 0, but with 1 or 40001, etc.). While communicating, the "Data item address" is modified as a sum of the relative item address (defined in the ItemID identificator) and the area base address. |
Max. number of variables received in one message | For each area (Bo,Bi,Ro,Ri) the maximum number of variables to be transmitted in one communication message is defined here. These values depend on the device type to communicate with (some devices support transmissions of low register numbers in a single message, other support higher numbers) - this specification can be found in the device documentation or must be tried/tested. The preset values are 64 for Bo and Bi, 32 for Ro and Ri (if the preconfiguration for a specific device is not used - see Preconfigurations / Communication / Modbus communication protocol). The preconfigured values are very low. Increasing these values (if the device allows it) may cause higher communication speeds because the transmitted data can be sent in a lower number of communication messages. |
The address 0 is used for the broadcast, i.e. for the messages received by all stations (if the Modbus protocol is used on higher network level, then the broadcast may not be allowed). The driver sends these messages but does not wait for response - therefore it is not relevant to set address 0 for messages that are to read (e.g. messages 01 to 04).
The maximum number of values (states, registers) in one message differs according to the PLC device. It can be for example 32, 125, 128, 1024, etc.
User-defined Modbus message. It can be used for message types that are not otherwise supported by this driver. The designer can define the complete content of the message (received or sent), but the order and data type of the DataX variables must be observed carefully.
The variables DataX (in Data-sent and in Data-received) represent data in Modbus protocol from the character Function (without this character) and up to the character CRC (for serial RTU, without his character) or up to the end of the message (for Modbus TCP/IP). For ASCII transfer mode the data is defined the same way as for RTU mode and the driver then transforms such data into ASCII form.
This is not the total size of the received mesage, but just the portion that will be stored in the DataX variables on the "Data-received" tab.
The value -1 means that the expected size will be calculated as the total length of all DataX variables on the "Data-received" tab.
If the size is defined less than the currently received data, then an error occurs and the received data is not processed.
If the size is defined greater than the currently received data, then the transfer takes longer (the system will wait for timeout), but the received data is processed.