Dynamic Changes - Modbus TCP Device
Since IDE 2.5.0.x.
Block Name
Modbus_TCP_Device
Description
Using this function block, we can dynamically change the parameters of Modbus TCP device. To write new parameter values, we must first enable the function block using the "Enable" input parameter, then enter the name of the communication channel ("Channel" input) and the device name ("Device" input). Then we can dynamically change parameters such as IPv4 address, port, hostname, SSCP device address or device enabling.
For the subsequent commit of the changes we made at the input of the function block, it is necessary to set the "Commit" input parameter to "True" and then a PLC restart is required, which can be invoked using the "RestartRequest" input parameter. To select the PLC restart type, there is an input parameter "RestartFlag" with which we can choose between warm, cold and system restart.
For the current reading of the values at the output of the function block, it is necessary to perform the first write in the case of dynamic changes for image (alarm channels, communication channels and devices).
Inputs
Input | Type | Description |
---|---|---|
Enable | bool | Enable Function Block |
Channel | string | Channel Name |
Device | string | Device Name |
Ipv4 | string | IPv4 |
Port | dint | Port for Modbus (default value 502) |
Host | string | Hostname |
Address | int | Modbus Device Address |
DeviceEnable | bool | Enabling of Device |
Commit | bool | Used to write values (necessary restart) |
RestartFlag | RestartFlag | Selecting the type of restart (Warm, Cold, System) |
RestartRequest | bool | PLC restart request according to selected restart type |
Outputs
Output | Type | Description |
---|---|---|
Ipv4Out | string | Actual IPv4 |
PortOut | dint | Actual Port for Modbus |
HostOut | string | Actual Hostname |
AddressOut | int | Actual Address of Modbus Device |
DeviceEnableOut | bool | Actual enabling of device |
RestartResult | dint | Restart Result |