Share this

Quick Start Guide | Part 22: Introduction to ZHMI Motion Controller Configuration Programming

2026-04-06 05:47:21 · · #1

Video Tutorial: Introduction to ZHMI Motion Controller Configuration Programming (Part 1)

Today we'll learn about ZHMI configuration programming for motion controllers. This article mainly covers four aspects: product overview, controller connection to a touchscreen, HMI programming methods, and configuration example programs.

01 Product Overview

The ZMC306X controller is used to connect to the ZHD400X touchscreen.

The controller reference configuration is shown in the following figure:

(I) ZMC306X

The ZMC306X series controller has 6 pulse axes and can expand the number of pulse axes via CAN bus, supporting up to 12 axes of linear interpolation, arbitrary circular interpolation, spatial circular interpolation, helical interpolation, electronic cam, electronic gear, synchronous following, virtual axis setting, etc.; it can realize real-time motion control by adopting an optimized network communication protocol.

The communication interfaces include RS232, RS485, RS422, Ethernet, USB flash drive, and CAN.

The controller's input ports 0-1 support latching, and output ports 0-1 support PWM. It has two analog input and two analog output interfaces with 12-bit precision and a voltage range of 0-10V.

It supports the functionality of XPLC for positive motion technology, and uses ZDevelop software for HMI programming and configuration development, which can be configured and displayed over a network.

(II) ZHD400X

The ZHD400X is a network-display touchscreen teach pendant. The teach pendant must be used with a controller that supports ZHMI functionality. The touchscreen configuration program is developed using ZDevelop's HMI programming method, and the program is stored in the controller.

The teach pendant has one USB port, one USB flash drive extension port, and is powered by a 24V DC power supply (USB power supply is also available). It features an 800*480 resolution true color display, 18 buttons, and an emergency stop switch.

The ZHD400X supports a touchscreen and can be used in conjunction with buttons and touch.

For the coding rules of the physical buttons on the side of the screen, please refer to the "ZHD400X Handheld Box Manual". When a button is pressed, the teach pendant automatically sends the physical button to the controller. The controller program can detect the physical button. If virtual buttons are needed, a button conversion table needs to be used in the configuration. ZDevelop comes with a standard 400X button conversion table, which can be modified according to specific circumstances or the device.

02. Controller connection to touchscreen.

The touchscreen comes with a network cable. Use the network cable to connect to the Ethernet port of the controller. There are three wires coming out from the RJ45 connector of the network cable: the power supply wire for the teach pendant and the emergency stop signal wire. The red wire is the positive terminal of the 24V power supply, the black wire is the negative terminal of the 24V power supply, and the purple wire is the emergency stop signal wire.

The main power supply for the touchscreen and controller can be shared.

Usage steps:

1. First, use ZDevelop software to edit the HMI program, connect the controller, download the program to the ROM and save it after power-off. Then disconnect the controller from ZDevelop. Finally, power on the touchscreen.

2. Connect the ZHD400X directly to the controller's network port using the provided cable. Then, click the four corners of the screen in a Z-shaped sequence twice to wake up the screen. A settings window will pop up, allowing you to perform touch calibration, change the controller's IP address, etc.

3. The settings window is shown below. The pop-up window will automatically obtain the IP address of the currently connected controller. After confirming that the IP is correct, click Connect to connect and use it. At this time, the touch screen will display the contents of the initial basic window.

4. If there is no touchscreen, the HMI program can be downloaded to the simulator and simulated on the XPLC screen platform.

After connecting and downloading the simulator, click the "Show" button to bring up the simulation interface.

XPLC screen display effect:

03 HMI Programming Methods

HMI configuration programming is generally mixed with Basic programming. The registers and related action functions to be called by the HMI are written in Basic. Basic functions are called in the HMI file through system settings or components. The called Basic function must be a global SUB procedure.

Note that the configuration file to be run must have the automatic run task number set.

Programming reference process:

1. Create a new project and HMI file. After the HMI file is created, the "HMI System Settings" window will pop up, where you can set basic information such as resolution and main interface window.

2. Create a new window as needed and set its properties;

3. Add configuration elements to each window and set element properties; window access can be configured in element actions, allowing you to directly open or close a specified window, or use Basic functions to open or close a specified window using commands;

4. When you need to call a Basic function, create a new Basic file under the project and write the function to be called by the configuration element as a global SUB function.

5. Once the program is written, the specified file will be automatically executed, the task number will be downloaded to the controller or simulator, and the screen will be connected to the touch screen or displayed on the XPLC screen.

(I) Creating a new HMI file

After creating the project, create a new HMI file. By default, the newly created HMI program comes with three keyboard windows of different styles (6, 7, and 8) and a basic window (10). By default, window 10 is used as the main interface of the touch screen. The default main interface can be changed (see HMI system settings on the next page).

Invoke the soft keyboard window to input data:

After clicking on the configuration element where data can be entered, the soft keyboard window will open, as shown in the figure below. After entering the value in the soft keyboard window, press Enter to save and change the data.

(II) HMI System Setup

Before editing the configuration program, select the HMI file. First, open the menu bar "Edit" → "HMI System Settings" to open the following window.

Based on the size of the teach pendant to be used in the configuration program, set the horizontal and vertical resolutions (as shown in the size of window 10 in the previous section). Select the initial basic window (i.e., the initial interface displayed on the touchscreen), and choose the globally defined SUB sub-functions in Basic for the initialization and cycle functions.

The initialization program runs once after the HMI is powered on, and the periodic function performs a periodic cyclic scan.

(III) Configuration Window

The configuration display must use a basic window as the base window, which serves as the background for other windows. Components need to be displayed in the window. Multiple windows of different types can be created under one configuration file.

To create a new window: Open the window as follows by going to "Components" → "New Window" in the menu bar. Enter the window number and window name and confirm. Note that the window number should not be duplicated.

The window's properties, size, and position can all be modified by opening the window's "Properties" menu.

The configuration view can display all windows and the components under each window. Components are added to windows, and the properties of windows or components can be modified in the "Properties" window.

Clicking on the configuration window or component will open the properties window.

There are five window types: Base Window, Keyboard Window, Pop Window, Menu Window, and Top Window.

1. Base Window: The configuration display must use a base window as the bottom window. Only one base window can be displayed. The base window is switched through program or component operations and cannot be closed.

2. Soft Keyboard Window: Used when numerical input is required. Component: value is displayed. Select the soft keyboard window in the component properties. Newly created HMI files have three built-in soft keyboard windows to choose from.

3. Pop-up Window: Pop-up windows need to be closed via program or component operation. After a pop-up window is opened, components outside the pop-up area can still be triggered. Setting a monopoly in the pop-up window properties restricts operation to components within the current pop-up window. The pop/menu window closes after switching to the basic window.

4. Menu Window: The Menu window is a type of Pop window, both of which open upon being invoked. The difference is that once the Menu window pops up, it gains maximum access control; only the Menu window can be interacted with at this time. The Menu window will close when a user clicks on an area outside the Menu window.

5. Top Window: This window is always displayed on top, usually a small window, and can be used to implement toolbars, etc. When switching between basic windows, the Top Window will still be displayed on top and will not close.

Methods to open or close a window

1. The BUTTON function key calls the Basic program. Within the program, you can write HMI_SHOWWINDOW to display the window, HMI_BASEWINDOW to display the basic window, and HMI_CLOSEWINDOW() to close the window. The basic window does not support closing.

2. Function key properties - Action selection: close or show window.

Select “Component” → “Bit Component” → “Function Key” to create a new function key button. Open the component’s properties window and find the “Action” drop-down list.

You can choose to open three window types: base, top, and pop. The menu window is a type of pop window.

Selecting Close will close the current window or specify the window number to close.

(iv) Adding configuration elements

The windows and components required for HMI programming can be selected from the "Components" menu. Detailed instructions for using the windows and components can be found in the HMI Programming Manual.

After adding a component in the "Component" menu bar, place the component within the size range of the configuration window, open the component properties settings to set the relevant parameters of the component, as shown in the figure below. Drag the component to select the placement position, or set the size and position in the properties bar.

Different components have different properties, but they also have commonalities. Generally, when you need to call a Basic function, select "Function Key Button". When you need to control the register state, select "Bit Component" or "Word Component". Use "Character Display" to display text. Use the "Value Display" component to call the soft keyboard window to input values ​​on the touch screen.

1. General properties of components

2. Registers

Most components include a "register type" attribute, which is used to establish data communication with various registers. Registers can be system-provided registers or user-defined variables or arrays.

As shown in the figure below, pressing the bit state switching element sets the value of bit register M10 to 1 and displays the format text 0; releasing M10 sets it to 0 and displays the format text 1.

3. Actions

The action dropdown list allows different elements to select different actions, such as opening or closing a window and calling the Basic global SUB function. Pressing the button activates the action by default.

As shown in the image below, the function key's action selection calls a function, and the function selected is onrun().

04 Configuration Example Program

This routine is a single-axis motion routine, which contains two files. The Basic program is called and executed by the HMI.

HMI configuration interface:

First, select the axis number to be moved, either the X-axis or the Y-axis. Movement is not possible without selecting an axis number. Then, select the direction of movement and the movement mode. If you select the inching mode, you also need to set the inching distance.

The basic axis parameters above can be customized or use default values. The soft keyboard window can be called to input custom values. After the above settings are completed, you can click "Move" to make the axis move. The running speed SPEED and axis position DPOS are obtained and dynamically displayed by display elements 1 and 2.

Press the stop button to immediately stop the current motion, and press the position zero button to zero the DPOS.

Basic program interface:

Basic program:

global sub main_int() 'HMI initialization function

global str(20) 'Axis status, value display element 11 call'

str="Not Selected" 'Value display element 11 displays content: Not Selected'

global state(20) 'Running state'

state="stop"

global axisnum 'Axis selection'

axisnum=0 '1 X-axis, 2 Y-axis....

intaxis() 'Initializes axis parameters, default values

dpos=0

units = table(0) 'HMI interface manually sets values ​​and saves them in table'

lspeed = table(1)

speed = table(2)

accel = table(3)

decel = table(4)

sramp = table(5)

table(10)=0 'Current position, value display element 1 called'

table(11)=0 'Current speed, value display element 2 called'

table(15)=0 'Inch distance, value display element 28 called'

RAPIDSTOP(2)

end sub

global sub main_scan() 'HMI periodic function

slcaxis() 'Select axis

If idle=-1 then 'Axis parameters only take effect when the axis is stopped.'

setaxis()

endif

table(10) = DPOS 'Dynamically retrieve and display data'

table(11)=MSPEED

if idle=-1 then

state="stop"

endif

end sub

sub intaxis() 'Axis parameter initialization'

table(0) = 10 units (pulse equivalent)

table(1)=10 'lspeed Initial speed

table(2)=100 'speed Running speed'

table(3)=1000 'acceleration'

table(4)=1000 'decel deceleration'

table(5)=10 'sramp s curve time

end sub

sub setaxis() 'Set axis parameters'

units = table(0)

lspeed = table(1)

speed = table(2)

accel = table(3)

decel = table(4)

sramp = table(5)

end sub

global sub slcaxis() 'axis selection function

If MODBUS_BIT(0)=1, then 'modbus_bit(0) corresponds to the X-axis selection button on the HMI interface'.

cancel(2) axis(1) 'Stop the movement of the Y-axis axis1 when the selected axis is changed.

str="X-axis" 'Displays the content as: X-axis'

axisnum=1

base(0) 'Select the X-axis'

elseif MODBUS_BIT(1)=1 then 'modbus_bit(1) corresponds to the Y-axis selection button on the HMI interface'

cancel(2) axis(0) 'Stop the movement of the X-axis Axis0 when the selected axis is changed.

str="Y-axis" 'Displays the content as: Y-axis

axisnum=2

base(1) 'Select the Y-axis'

endif

end sub

global sub onrun() 'Activity function key call

if axisnum=0 then

return 'axisnum=0 No axis number selected'

elseif MODBUS_BIT(20)=0 then 'modbus_bit(20) corresponds to the motion mode button on the HMI interface, equal to 0 for continuous motion mode.'

If MODBUS_BIT(10)=0 then 'modbus_bit(10) corresponds to the direction selection button on the HMI interface'

vmove(1)

elseif MODBUS_BIT(10)=1 then

VMOVE(-1)

endif

elseif MODBUS_BIT(20)=1 then 'Motion mode, equal to 1 for inching'

move(table(15)) 'Inch distance specified, value displayed on element 28

endif

if idle=0 then

state="sports"

endif

end sub

global sub onstop() 'Stop function key calls

state="stop"

RAPIDSTOP(2)

end sub

global sub clear_dpos() ' Function key call to clear position

dpos=0

end sub

This concludes "Quick Start | Part 21: Introduction to ZHMI Motion Controller Configuration Programming (Part 1)". For more learning videos and detailed explanations with pictures, please follow our WeChat Official Account "Zheng Motion Assistant".

This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to jointly improve China's intelligent manufacturing level. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.

Read next

CATDOLL 138CM Airi(TPE Body with Hard Silicone Head)

Height: 138cm Weight: 26kg Shoulder Width: 30cm Bust/Waist/Hip: 65/61/76cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL 132CM Luisa Silicone Doll

CATDOLL 132CM Luisa Silicone Doll

Articles
2026-02-22
CATDOLL Airi Soft Silicone Head

CATDOLL Airi Soft Silicone Head

Articles
2026-02-22
CATDOLL Yuki Soft Silicone Head

CATDOLL Yuki Soft Silicone Head

Articles
2026-02-22