TS6250 | TwinCAT Modbus TCP Server

TwinCAT Modbus TCP Configurator

Configuration 1:

The configurator is installed per default to the directory \TwinCAT\TcModbusSrv. The tools allows to read and change the actual configuration of TwinCAT Modbus TCP server.

Configuration 2:

IP Address: IP of the server. If no address is set, the local one is used (default) .

Port: Configured port of the server (default port = 502).

Get Configuration: Read configured IP address and port.

Set Configuration: Set IP address and port.

Export Configuration: Read and save configuration.

Import Configuration: Import new configuration.

Set Default Configuration: Reset to default-settings (use local ip, Port = 502, and default mapping).

Note: TwinCAT must be stopped if you want to use the configurator, which will be done by the tool.

Export configuration

The configuration is XML-based and can be changed by a text editor.

Hint: It is easier to edit and activate an exported configuration.

Importing Mapping information

Use the "Import Configuration" function to import and set active an existing (altered) configration file.

Example for simple mapping:

Port 801 = PLC1 TC2 -->   
<!-- IndexGroup 61472 = 0xF020 -> physical plc input register %I -->
<IndexOffset> 0 </IndexOffset> </MappingInfo>
801 </AdsPort>
<!-- Modbus input registers -->
32768 </StartAddress>
33023 </EndAddress>
.mb_Input_Registers </VarName>
</InputRegisters>; <OutputRegisters/> <InputCoils/> <OutputCoils/> </Mapping> </Configuration>

This samples maps the input register (IndexGroup 0xF020) of the first TwinCAT2 runtime (port = 801) to the Modbus input registers.

Hint: It is possible to map by variablename or IndexGroup/Offset(better performance).

The default configuration can be found here.