Share this

Quick Start Guide | Part 5: How to Apply Input/Output I/O to a Motion Controller?

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

Previously, Zheng Motion Technology discussed motion controller firmware upgrades, ZBasic program development, ZPLC program development, and communication between motion controllers and touchscreens. Today, we'll learn how to apply motion controller input/output I/O.

    Video Tutorial : "Video Tutorial: How to Apply Input/Output I/O to a Motion Controller?"

1. Material preparation

1) One computer with ZDevelop version 3.01 or later installed;

2) One ZMC306X controller and one ZMC432 controller;

3) One 24V DC power supply;

4) Several bus drivers + motors (or stepper drivers + motors);

5) Several controller wiring terminals;

6) Several network cables;

7) Several connecting cables; Additionally: I/O devices, expansion modules, touch screens, etc., can be selected according to requirements.

2. Controller Connection Configuration Reference

ZMC306X Connection Configuration

ZMC432 Connection Configuration

3. ZMC306X controller interface

Basic hardware information for the controller can be found in the hardware manual or by connecting the controller using programming software and typing ?*max in the online command bar to print the information.

Basic number of axes: 6, can actually control 6 pulse motor axes.

Maximum number of axes that can be expanded: 12, the total number of axes is 12 including real axes, encoder axes and virtual axes.

Basic axis type: differential pulse output, all axes have ABZ differential encoder feedback input.

Internal I/O count: 24 inputs and 12 outputs (all 12 outputs have overcurrent protection and support 300mA current). In addition, each axis terminal has 1 input and 1 output (1 input in the axis can be used for alarm input, and 1 output can be used for enable).

Number of PWMs: 2 (output frequency 1MHz, PWM0 and PWM1 occupy OP0 and OP1 respectively).

Latch channel: 2 (occupies two terminals IN0 and IN1, latch instruction REGIST).

Internal AD/DA count: 2 AD channels, AIN(0)-AIN(1); 2 DA channels, AOUT(0)-AOUT(1).

Power input: 24V DC input (power consumption within 10W, no fan cooling required).

Communication interfaces: RS232, RS485, RS422, Ethernet, USB flash drive, CAN. RS232 is port 0, RS485 is port 1, and RS422 is port 2.

4. Viewing ZMC306X hardware information

Entering ?*max in the online command prompt will print the following result:

max_axis: 12 Maximum number of axes for all axes

max_motor: 6 Maximum controllable number of motor shafts

max_movebuff: 128 Maximum motion buffer for each axis or axis group.

`max_in:30,528` specifies the maximum number of IN inputs supported by the controller.

`max_out: 18,528` represents the number of built-in OUT outputs of the controller, and the maximum number of OUT outputs supported.

`max_ain:2,128` represents the maximum number of analog inputs supported by the controller.

`max_aout:2,64` specifies the maximum number of analog outputs supported by the controller.

max_pwm: 2 Number of PWM outputs

max_slot: 0 Number of buses

max_comport: 3 Number of serial ports

`max_ethport: 3` specifies the number of network communication connections to the PC and API functions.

max_ethcustom: 2 (Custom number of network interface connections)

max_ethiport:1 Ethernet communication connection for interconnecting motion controllers.

max_flashnum: 1000 FLASH blocks

max_flashsize: 20480 Size of each flash memory space

max_nand: 265551872 Total amount of space for NandFlash storage

max_nandremain: 267911168 The remaining available space in NandFlash storage.

max_pswitch:16 Maximum number of outputs from software position comparison

max_file:30 Maximum number of files supported by the system

max_3file:1 The maximum number of files that the system supports (up to 3 files).

max_task: 12 Number of tasks

max_timer: 128 (number of timers)

`max_loopnest: 8` is the number of times the inner loop or selection is performed.

max_callstack: 7 Number of stack levels for subroutine calls

`max_local of one sub: 16` represents the number of local variables in sub-sub.

max_flashnum: 1000 FLASH blocks

max_flashsize: 20480 Size of each flash memory space

max_nand: 265551872 Total amount of space for NandFlash storage

max_nandremain: 267911168 The remaining available space in NandFlash storage.

max_pswitch:16 Maximum number of outputs from software position comparison

max_file:30 Maximum number of files supported by the system

max_3file:1 The maximum number of files that the system supports (up to 3 files).

max_task: 12 Number of tasks

max_timer: 128 (number of timers)

`max_loopnest: 8` is the number of times the inner loop or selection is performed.

max_callstack: 7 Number of stack levels for subroutine calls

`max_local of one sub: 16` represents the number of local variables in the sub-sub.

max_vr: 1024 Number of VR register spaces

max_table: 300000 (Number of spaces for the TABLE array)

max_modbusbit: 4096 MODBUS_BIT bit register size

max_modbusreg:4096 MODBUS_REG word register space size

max_var: 4096 Maximum number of variables supported (including global variables and file variables)

`max_array: 1024` specifies the maximum number of arrays supported (including global arrays and file arrays).

max_arrayspace: 640000 Total space size for all arrays

max_sub:1500 Maximum number of SUB subroutines supported

max_edgescan: 1024 Maximum number of rising/falling edge scans supported

`max_labellength: 17` specifies the maximum length of custom characters used in arrays and variables.

max_hmi:1, x:1024, y:600 supports one remote HMI with a maximum size of 1024*600.

Function support: Coder Cam MultiMove Circ Merge Frame supports motion control functions.

5. ZMC306X Controller Status

Connect to the controller using ZDevelop software, then go to Menu Bar -> Controller -> Controller Status to view the controller's basic information.

VirtualAxises: Supports a maximum number of virtual axes

RealAxises: Supports a maximum number of motor axes

Tasks: Maximum number of tasks

Files/3Files: Maximum number of files / Number of files in three rounds

Modbus0x Bits: User-available space size of Modbus bit register

Modbus4x Regs: User-available space size for Modbus word registers

VR Regs: User-available space size for VR registers

TABLE Regs: User-available space for the TABLE array

RomSize: Rom capacity

FlashSize: Flash capacity

SoftType: Software Model

SoftVersion: System software version + firmware version

IpAddress: Controller IP address

HardVersion: Hardware Version

ControllerID: Unique ID for the controller

Axis features list: Axis type list

Connect to the controller using ZDevelop software: Menu bar -> Controller -> Controller Status.

ZCAN node: View local controller information and information about expansion modules connected to the CAN bus.

Communication configuration: View CAN information and serial channel RS232/RS485/RS422 information.

Controllers with EtherCAT interfaces can view slot node information in the controller status, displaying information about all devices connected to the bus slot.

6. ZMC306X Digital Input Port

The general-purpose digital input port can be connected to an NPN type. The optocoupler and filter are used to prevent interference signals from entering the controller through the signal and power lines.

Special functions of the input ports: Ports IN0-1 function as both latched input A and latched input B. The allowed hardware lag time for the high-speed latched input port is 1µs. The remaining ports are ordinary input ports, with an allowed hardware lag time of approximately 50µs. Filter parameters can be set to increase the filtering time.

Special signal definitions: Digital input ports are not specifically defined in hardware and are all universal. Special signals such as origin, limit, alarm, quick jog, forward JOG, reverse JOG, and feed hold are set through software instructions.

The directives DATUM_IN, REV_IN, FWD_IN, ALM_IN, FAST_JOG, FWD_JOG, REV_JOG, and FHOLD_IN can be used for configuration.

INVERT_IN: Inverted configuration of the input signal.

Input reversed:

INVERT_IN(8,ON) 'Invert the input'

Input port filtering:

INFILTER=5 'The larger the value, the longer the filtering time. 2-9, default 2

Input port reading:

IN(0) reads the data from IN0. IN(0,7) reads the data from IN0 to IN7 at once.

Read rising/falling edge status:

Method 1:

SCAN_EVENT(IN(0)) > 0 rising edge

SCAN_EVENT(IN(0)) < 0 Falling edge

Method 2:

After IN_SCAN(0,23), the rising edge of IN_EVENT(0) > 0.

After IN_SCAN(0,23), the rising edge of IN_EVENT(0) < 0.

Diagnosing input signals: ZDevelop -> View -> Input Port.

Run the following program to obtain the input port status as shown in the figure.

Gray indicates no input, green indicates input, special signal inputs are indicated in the window, and the display of IO numbers can be customized in "IO Selection".

7. ZMC306X Digital Output Port

The general-purpose digital output port can be connected to an NPN type. The optocoupler and filter are used to prevent interference signals from entering the controller through the signal and power lines.

The maximum output current of a single general-purpose output port is 300mA, while the maximum output current of the shaft terminal is 50mA.

The general output instruction is OP.

Output port special functions: OUT0~1 ports support PWM output; when the PWM function is disabled, they function as normal outputs. The PWM high-speed output port allows an output signal frequency of 1MHz; the remaining ports are normal output ports, allowing an output frequency of approximately 10kHz.

Use the PWM_DUTY and PWM_FREQ instructions to set the duty cycle and frequency, respectively.

PWM_DUTY(0)=0.4'0.4 duty cycle PWM_FREQ(0)=1000'1k frequency.

PWM_DUTY(1)=0.5'0.5 duty cycle PWM_FREQ(1)=1000000'1MHz frequency.

Diagnosing output signals: ZDevelop -> View -> Output Port.

Run the following program to obtain the output port status as shown in the figure.

8. Digital Input/Output Expansion

When the number of digital input/output points is insufficient, an expansion module can be connected to expand the input/output. CAN bus and EtherCAT bus can be used to connect the expansion module.

Since the ZMC306X only includes a CAN interface, it can only be expanded using the CAN bus, with a maximum of 512 IN input ports and 512 OUT output ports. When the number of pulse axes is insufficient, it supports the use of the ZCAN expansion module to expand the pulse axes. See the diagram below for the wiring method.

Make sure that the controller's EGND is connected to the ZCAN IO's GND, and that a 120-ohm resistor is connected between CANL and CANH.

9. ZMC306X Analog Input/Output

The ZMC306X includes two analog input channels (AD) and two analog output channels (DA). The internal AD/DA converter uses an internal power supply.

The controller has an analog signal accuracy of 12 bits, a scale range of 0~4095, and an input/output voltage range of 0~10V.

When the number of analog input/output points is insufficient, an expansion module can be used to expand the range. The analog input/output can be expanded to 256 AD channels and 128 DA channels.

Related instructions:

Analog input: AIN reads AIN(0), AIN(1)

Analog output: AOUT writes to AOUT(0), AOUT(1)

Diagnosing the AD/DA signals of ZMC306X: ZDevelop->View->AD/DA, monitor the voltage of each analog channel in real time.

10. Synchronous output during movement

During the motion, OP, DA, and PWM are output synchronously.

Related instructions:

MOVE_OP outputs the OP during the motion process.

MOVE_OP2 outputs an operation (OP) for a period of time during the motion.

MOVE_PWM outputs PWM during motion.

MOVE_AOUT outputs analog signals during the motion process.

11. Reading and writing data such as IN, OP, ADC, and DAC on the touchscreen.

● IN(0)~IN(4095) correspond to MODBUS_BIT(10000)~MODBUS_BIT(14095) read-only

● OP(0)~OP(4095) correspond to MODBUS_BIT(20000)~MODBUS_BIT(24095) for read/write operations.

● AIN(0)~AIN(255) correspond to MODBUS_REG(14000)~MODBUS_REG(14255) which are read-only.

● AOUT(0)~AOUT(127) correspond to MODBUS_REG(13000)~MODBUS_REG(13127) for reading and writing.

● DPOS, MPOS, VPSEED correspond to read-only MODBUS_IEEE(10000)~MODBUS_IEEE(12198).

12. Position Comparison Output

● Compare and output related instructions: Software compare and output PSWITCH instruction; hardware compare and output HW_PSWITCH instruction (only supported for pulse axis), HW_PSWITCH2 instruction (supported for both pulse axis and bus axis), which change the level of a certain output port when the motor position reaches the set position.

● Some controllers in the 4 series and 3 series support hardware comparison output, such as the ZMC432, which has 4 hardware comparison output channels, and each channel is independent (some models are not independent). The number of hardware comparison output channels supported by different controller models varies. The output port IO number corresponding to special functions generally starts from 0.

● Only one comparison can be performed per system cycle. Each channel is independent. One system cycle supports multiple output ports to use hardware comparison output simultaneously. If the channel is not independent, only one output port can be used per system cycle. The system cycle is queried through SERVO_PERIOD, and the default value is 1ms.

● HW_PSWITCH2 and MOVE_OP use the same hardware resources precisely, so it is not recommended to use them simultaneously on the same channel. If the channels are independent, they can be used simultaneously on different channels.

13. Precise Output

Only controllers that support hardware compare output can use the precise output function. Use the AXIS_ZSET instruction to enable or disable precise output. Once enabled, use the MOVE_OP instruction for precise output to take effect. Note that the output channel must be selected to support precise output; the number of supported channels varies depending on the controller model. Generally, special functions start from I/O number 0.

Ordinary output operations require waiting for a controller cycle to execute. Precision output operations, on the other hand, can respond within a single pulse from the motor, greatly improving process accuracy. Furthermore, the response time can be adjusted (advanced or delayed) using the MOVEOP_DELAY instruction.

Generally, only one precise output function can be executed within a single controller cycle, and it must be activated again in the next cycle. However, in the latest controllers such as the ZMC420SCAN, each precise output is independent, allowing multiple ports to be used simultaneously within a single cycle. Whether multiple precise output functions can be used simultaneously can be found in the output port description in the hardware manual.

14. Controller Sample Program (basic sample program)

The controller program is divided into five modules:

1) Initialization module: Axis parameter setting subroutine, IO initialization subroutine.

2) Input scanning module: Press to start the input point and stop the corresponding program of the input point.

3) Axis parameter setting subroutine: Initializes axis parameters.

4) IO initialization subroutine: Initialize IO(OP, AOUT).

5) Press the start button to execute the motion task: Press the start button to execute motion task 1.

That concludes our sharing on how to apply motion controller input/output I/O in ZhengMotion Technology. For more exciting content, please follow our official WeChat account.

This article was originally created by Zheng Motion Assistant. We welcome everyone to reprint it for mutual learning and to improve China's intelligent manufacturing capabilities. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.

Zheng Motion Technology is a national high-tech enterprise specializing in the research and application of motion control technology. It mainly engages in the research, development, production, sales and service of a series of products such as motion controllers, motion control cards, IO expansion modules and motion display and control all-in-one machines.

The company has gathered outstanding talents from companies such as Huawei and ZTE. While adhering to independent innovation, it actively collaborates with major universities to dedicate itself to the research and application of motion control technology. It is one of the fastest-growing companies in the domestic industrial control field and also one of the companies in China that has fully mastered the core technologies of motion control and real-time industrial control software platform technology.


Read next

CATDOLL Rosie Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22