Share this

M Series Tutorial (Basic Course) | Hechuan TP2000 Series Touch Screen and M Controller - Modbus TCP Communication

2026-04-06 04:35:40 · · #1

Let's embark on a new chapter in M-series controller programming education, starting with the fundamental course – Hechuan TP2000 series touchscreen and M-controller Modbus TCP communication – and begin our learning journey!

01

Preliminary preparations

Software: Sysctrl Studio (PLC programming software)

HCTDesigner 2 (HMI programming software)

Hardware: M-series controller (taking M511S as an example)

Touchscreen (taking TP2507-E as an example)

02

Sysctrl Studio Project Configuration

Step 1: New Construction Project

Double-click to open the software Sysctrl Studio, select "File" → "New". Users can modify the project name and set the project storage location, and select the corresponding controller.

Step 2: Write a simple program

Open the default POU, right-click in the variable declaration area and select "Add Variable" to create a new variable and assign it to the corresponding address.

(1) Create a new variable “switch”. Directly enter “%MX201.4” or click the “···” on the right of 【Assign to】 to assign the variable to the address of MX201.4.

(2) Similarly, create the following variables, assign them to their corresponding memory addresses, and select the appropriate data types, as shown in the figure. Note that memory addresses should not overlap!

(3) After successful compilation, download the program to the controller.

Step 3: Modify the controller IP

Modbus TCP communication requires that the devices be on the same network segment.

(1) Click [Controller] → [Ethernet]. In the Ethernet interface, change the [IP address] to 192.168.1.2.

(2) Download to controller

(3) After the download is complete, turn off the power to the controller and then turn it back on.

03

HCTDesigner 2 Project Configuration

Step 1: New Construction Project

(1) Open HCTDesigner 2 software, select "File" in the upper left corner, and click "New". Enter the project name in the pop-up window, select the storage location, and click "OK".

(2) Select TP2507/TP2510 and click [Next].

(3) In the HMI Properties interface, modify the IP address (this is the IP address of the touch screen). You need to ensure that the IP address of the M511S (IP address: 192.168.1.2) and the IP address of the touch screen are in the same network segment. Modify the gateway to 192.168.1.1.

(4) Click on [Network PLC] → [Add]

For section 3, select "Modbus Network Compatible Device" for manufacturer, "Modbus_TCP" for device type, and "Modbus_TCP" for device alias (the device alias will be discussed in the HMI symbol table later).

For section 4, the network PLC IP address must be the controller's IP address (192.168.1.2), and the port number is 502 by default (must match the controller's IP address). The controller's IP address and port number can be viewed in the "Communication Settings" section of the Sysctrl software; the port number is 502 by default and cannot be changed.

(5) Change the address base setting to 0

Click on [Advanced Settings] → [Address Base Setting] and change it to 0. If the address base is not changed to 0, address offset will occur.

In the project, the Modbus addresses of variables and touch screen components must correspond one-to-one for communication to be successful.

There are two ways to map addresses: one is the HMI symbol table (Part 4), and the other is standard Modbus address calculation (Part 5).

You can choose any method to map addresses.

04

HMI Symbol Table

Step 1: Generate the HMI symbol table (Sysctrl Studio project)

(1) Select "Tools" from the menu bar and click "HMI Symbol".

(2) The HMI symbol interface appears at the bottom. Click on "Add Project Symbol...", select the variable to be added in the pop-up window, and click "OK".

(3) Click on [Check Engineering Symbols] and the variables will be automatically assigned Modbus addresses.

(4) Click on 【Generate HMI Symbol Table…】, select Hechuan TP2000 series, select Ethernet as the communication method, select Modbus_TCP as the connection path, and the communication station number is 1 by default.

Note: In the HMI symbol table generation window, the name before the colon in the connection path must be consistent with the device alias.

(5) Save to computer. The generated CSV file will be used in the touch screen project.

Step 2: Import the HMI symbol table (HCTDesigner 2 project)

(1) Select [Library] from the top menu bar, then select [Address Tag Library].

(2) Select "CSV file" in "Import/Export File Format", click "Import", find the exported HMI symbol table, and click "Open".

(3) A pop-up window indicates that the import was successful. Click [Close].

(4) A pop-up window indicates that the save was successful.

Step 3: Create a new component

(1) Add a "switch" component. Right-click and select 【Add Component】→【Switch】→【Bit Setting】.

(2) In the pop-up window, select "Press" for "Action" and "Invert" for "Execution Settings". In the address field, check "Use address labels", select the imported "Switch" label, and click "OK".

(3) Add an "Indicator Light" component. Right-click and select 【Add Component】→【Indicator Light】→【Bit Status Indicator】.

(4) In the pop-up window, click the symbol to the right of the address, check the "Use address label" box, select the imported "indicator" label, and click "OK".

(5) Add a "Number Input" component. Right-click and select 【Add Component】→【Number and Character Display】→【Number Input】.

(6) In the general properties interface, select numerical input under 【Operation Properties】, check 【Use Address Labels】, select the imported “Number Input 1” label, and click 【OK】.

(7) Number format interface, because the bound "Number Input 1" label is of type int, select [16-bit signed number] as the data type.

(8) Similarly, create two more “numerical input” elements, bind the “numerical input 2” label to them respectively, select the data type as [16-bit unsigned number]; bind the “numerical input 3” label to them, select the data type as [single-precision floating-point number], and fill in the number of decimal places as needed.

To make them easier to distinguish, you can use text labels. Right-click on "Add Vector Graphic" → "Static Text", and enter the text in the "Label Content" field.

(9) The components and variables are now set up.

Step 4: Download the program

(1) Click the “Download” icon in the top menu bar, select USB or Ethernet as the communication method, and click “Download”.

(2) A pop-up window displays "Download successful".

05

Standard Modbus address calculation

Address calculation relationship explanation:

The HCTDesigner2 software will have corresponding bit address symbols depending on the different connected devices.

In the M-series PLC, %IX represents the address of the input coil, and the corresponding touchscreen address is 1X; %QX represents the address of the output coil, and the corresponding touchscreen address is 0X; %MW represents the address of the intermediate register, and the corresponding touchscreen address is 4X.

The table below only applies to the address correspondence between M-series controllers and TP2000 series touchscreens.

The Modbus address conversion method is as follows:

(1)%IXA.B → 1X(address type):(starting address) + A*8 + B

%IX1.1 → 1X: 24576 + 1*8 + 1 = 24585

(2)%IBA → 3X_bit:①24576 + A/2 (A/2 is divisible)

②[24576 + A/2 (rounded down to the nearest integer)].8 (A/2 is not divisible)

%IB20 → 3X_bit: 24576 + 20/2 = 24586

%IB21 → 3X_bit: [24576 + 21/2 (rounded down to the nearest integer)].8 = 24586.8

(3)%IWA → 3X : 32768 + A

%IW10 → 3X : 32768 + 10 = 32778

(4)%QXA.B → 0X(address type):(starting address) + A*8 + B

%QX1.1 → 0X: 40960 + 1*8 + 1 = 40969

(5)%QBA → 4X_bit:①40960 + A/2 (A/2 is divisible)

②[40960 + A/2 (rounded down to the nearest integer)].8 (A/2 is not divisible)

%QB10 → 4X_bit: 40960 + 10/2 = 40965

%QB11 → 4X_bit: [40960 + 11/2 (rounded down to the nearest integer)].8 = 40965.8

(6)%QWA → 4X : 40960 + A

%QW10 → 4X : 40960 + 10 = 40970

(7)%MXA.B → 4X_bit:① A/2.B (A/2 is divisible)

②A/2 (rounded down to the nearest integer) ÷ (B+8) (A/2 is not divisible by 8)

%MX500.3 → 4X_bit: 500/2 = 250.3

%MX501.3 → 4X_bit: [501/2 (integer)].(3+8) = 250.11

(8)%MBA → 4X_bit :①A/2 (A/2 is divisible)

② A/2 (rounded down to the nearest integer) . 8 (A/2 is not divisible by this number)

%MB100 → 4X_bit:100/2 = 50

%MB101 → 4X_bit: 101/2 (rounded down to the nearest integer).8 = 50.8

(9)%MWA → 4X :A

%MW100 → 4X :100

Step 1: Create a new component

(1) Add a “switch element”. In the execution conditions, select “press” for 【Action】, select “invert” for 【Execution settings】, select Modbus_TCP for 【Device】, select 4X_bit for 【Address type】, and enter 100.12 in the 【Address】 field.

(%MX201.4 → 4X_bit : 201/2 (rounded down). (4+8) = 100.12)

(2) Add an "Indicator Light" component. In the pop-up window, click the symbol to the right of the address, select Modbus_TCP for [Device], select 0X for [Address Type], and enter 40970 in the [Address] field.

(%QX1.2 → 0X: 40960 + 1*8 + 2 = 40970)

(3) Add a "Numerical Input" component. In the general properties interface, select Numerical Input for [Operation Properties], Modbus_TCP for [Device], 4X for [Address Type], and enter 10 in the [Address] field. (%MW10 → 4X : 10)

(4) Number format interface. Since the bound “Number Input 1” label is of type int, select the data type [16-bit signed number].

(5) Similarly, create two more “Number Input” elements. Enter 25 (%MW25→ 4X : 25) at the address of “Number Input 2”, and select [16-bit unsigned number] as the data type; enter 200 (%MW200→ 4X : 200) at the address of “Number Input 3”, select [single-precision floating-point number] as the data type, and enter the number of decimal places as needed.

Step 2: Create New Components. After setting up the components and variables, you can download the program to the touchscreen.

06

Communication testing

In the Sysctrl Studio interface, the program enters monitoring mode. Set the variables "Switch" and "Indicator Light" to true, assign the value -195 to the variable "Value Input 1", the value 365 to the variable "Value Input 2", and the value 5264.213 to the variable "Value Input 3".

Meanwhile, the touchscreen displays the image below.

✦Control Technology Product Line✦


Read next

CATDOLL 128CM Katya Silicone Doll

Height: 128 Silicone Weight: 21kg Shoulder Width: 30cm Bust/Waist/Hip: 57/52/63cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22