Share this

Windows Real-Time Motion Control Soft Core (Part 6): Testing the LOCAL High-Speed ​​Interface with Matlab

2026-04-06 02:59:59 · · #1

Today, the MotionRT Assistant will share with you the installation and use of MotionRT7, as well as the preliminary preparations for developing MotionRT7 using Matlab.

01

MotionRT7 Introduction

MotionRT7 is a cross-platform real-time motion control kernel launched by Shenzhen Zheng Motion Technology Co., Ltd. It is also the first domestically developed and controllable Windows motion control real-time soft kernel.

1. MotionRT7 has the following features: (1) Independent software installation, suitable for various Windows computers; green and installation-free, quick experience; hardware-bound operating license authorization (can be tried even without authorization); easy to configure, start, connect, simulate operation, etc.

(2) It is compatible with other versions of MotionRT. Once developed, it can be quickly switched to various platforms such as embedded systems and Linux.

(3) Unified function library interface, fast local LOCAL interface, motion function calls are as fast as microseconds, which is dozens of times faster than ordinary PCI cards.

(4) Integrate machine vision to quickly build various motion control + machine vision real-time applications.

(5) Powerful multi-card function, up to 240 axes linkage, supports cross-card linkage, pulse and bus linkage, galvanometer and platform linkage, and easily realizes advanced functions such as position latch/PSO.

2. MotionRT, a real-time motion control kernel that continuously iterates.

MotionRT is a real-time motion control kernel that has been continuously built and developed by positive motion technology. It has been iterated for 7 generations, from MotionRT1 to MotionRT7.

3. MotionRT7 adopts a modular software architecture.

The motion control program, vision algorithms, and MotionRT7 motion control engine interact with each other via high shared memory, significantly improving the efficiency of motion control and machine vision interaction. User-defined functions integrate algorithms such as Gmc, Gear/Cam, Frame, Robotics, and CNC to create customized control systems for individual users.

4. Unified and open API functions

A unified and comprehensive SDK library ensures that all third-party development environments use the same API interface, resulting in a cross-platform product architecture that improves efficiency and maintains compatibility.

5. Simple and easy-to-use motion control features

a. Point-to-point motion, linear interpolation, circular interpolation, helical interpolation, and continuous trajectory machining;

b. Electronic cam, electronic gear, synchronous following, position latching, virtual axis overlay;

cS curve acceleration/deceleration, SS curve acceleration/deceleration, resulting in smoother trajectory motion;

d. 1D/2D/3D high-speed position synchronous output PSO, fully meeting the needs of vision-based imaging, high-speed dispensing, and laser processing;

e. Customers can customize motion control algorithms or robot forward and inverse kinematics algorithms;

f. Facilitates collaboration with third-party visual design firms.

6. Open EtherCAT and configuration/debugging tools

ZDevelop offers open and easy-to-use tools for configuration, development, debugging, and diagnostics. ZDevelop is not only free and green software, but also includes tools for axis debugging, axis status monitoring, and oscilloscope functionality.

MotionRT7 widely supports the EtherCAT bus, including widely used and easy-to-use EtherCAT servos, EtherCAT steppers, EtherCAT IO, EtherCAT valve islands, and EtherCAT sensors.

Our company will continue to improve the EtherCAT configuration tools and strive to make the best motion control solution.

02

Installation and use of MotionRT7

Step 1: Install the driver

1. Open "Device Manager", select "Action" and then "Add legacy hardware", then select "Manual selection".

2. Click "Next".

3. Click "Install from disk".

4. Click the "Browse" button to select the path where the driver is located, open the folder "driver_signed", and select "ZMotionRt64.inf".

5. Keep clicking Next until the installation is complete.

Note: When updating drivers, you must remove the device from Device Manager and make sure to also delete the driver files.

Step 2: Run the console application

1. Open the location of the console program and run the executable file "MotionRt710.exe".

2. Click “Start”.

Step 3: Use ZDevelop software to connect to the controller and monitor parameters.

ZDevelop Link Controller, software version 3.10 and above, uses PCI/LOCAL connection method.

Step 4: Extend the network port to support EtherCAT master protocol

1. Check network connections.

2. Select the network adapter to be used for EtherCAT, right-click and select Properties, then install the protocol.

3. Click Install from disk, select the path of the drive, open the folder "driver_signed", and select "MotionRtPacket.inf".

4. After successful installation, confirm that ZMotionRT64 Packet Protocol Driver is selected.

In the RT console program, select AddEcat. You will then see the corresponding network card. Select it and start RT.

5. MotionRT7 EtherCAT protocol installation video demonstration.

The built-in EtherCAT network card has a certain level of real-time performance. To improve EtherCAT performance, other protocols on the network port need to be removed. For further improvements in real-time performance, please use the dedicated EtherCAT motion control card XPCIE1032 from MotionRT. For more information on MotionRT7 parameter settings and related issues, please refer to the "MotionRT7 Manual".

For related information, please visit the official website of Zheng Motion Technology, www.zmotion.com.cn, or contact relevant personnel at Zheng Motion.

03

Developing the MotionRT7 project using Matlab

1. Open MATLAB R2020a and create a new project: Menu "Home" → "New" → "Project" → "Blank Project" to start the project creation wizard.

2. Select the project save path, set the project name, and click Create.

3. Enter GUIDE in the command line to create a new GUI.

4. Copy the dynamic link libraries "zmotion.dll" and "zauxdll.dll" from the "..\function library\dll" folder on the product's accompanying CD to the MATLAB working directory.

5. Copy the header file "zauxdll2.h" to the project folder.

6. Configure the MATLAB development environment.

(1) Enter mbuild -setup and mex -setup in the MATLAB command line and select the C language compiler to be installed.

(2) Use loadlibrary('zauxdll.dll','zauxdll2.h') to load the function library.

(3) libfunctions zauxdll-full or libfunctionsview zauxdll, to display the signatures of shared library functions.

7. Use calllib to call functions in the zauxdll function library. For details, please refer to the MATLAB help.

Now, users can call any function in the MATLAB function library and write applications. For specific usage and functions, please refer to the ZMotion PC Function Library Programming Manual on the CD.

(1) Introduction to relevant PC functions

In MATLAB's GUI design interface, find the controls you need and drag them onto the form to design the UI interface. The result is as follows.

Note: When connecting to MotionRT7 using IP mode, the value of the Eth num configuration item in motionRT710 should be set to a number greater than 0 (1-12). The IP address entered is the local machine IP address, which can be viewed directly in ZDevelop.

(2) Related code ① Connect the controller by linking the button via IP link.

·

% --- IP connection method to connect to controller Executes on button press in btn_open_eth.function btn_open_eth_Callback(hObject, eventdata, handles)global g_handleptr;% Define connection handle calllib('zauxdll','ZAux_Close',g_handleptr);str_zmc_connect =get(handles.edit_ip,'String');disp("Connecting to controller:"+str_zmc_connect);[res,~] = calllib('zauxdll','ZAux_OpenEth',str_zmc_connect ,g_handleptr);commandCheckHandler("ZAux_OpenEth",res);if res==0 fprintf('ETH connection to controller successful\n'); set(gcf,'NumberTitle', 'off', 'Name', '(Network port connection successful)');else fprintf('ETH connection to controller failed, error code %d\n',res); set(gcf,'NumberTitle', 'off', 'Name', '(Not connected)'); msgbox('Connection failure, Please check the IP!');%Connection to controller failed, please check the IP address return;end

② Link the controller using the message response function of the link button in the LOCAL linking method.

·

% --- Local connection method connects to controller Executes on button press in btn_open_local.function btn_open_local_Callback(hObject, eventdata, handles)global g_handleptr;% Define connection handle calllib('zauxdll','ZAux_Close',g_handleptr);str_zmc_connect =get(handles.edit_local,'String');disp("Connecting controller:LOCAL");[res,~] = calllib('zauxdll','ZAux_FastOpen',5,str_zmc_connect ,3000,g_handleptr);commandCheckHandler("ZAux_FastOpen",res);if res==0 fprintf('LOCAL connection to controller successful\n'); set(gcf,'NumberTitle', 'off', 'Name', '(LOCAL connection successful)');else fprintf('Connection to controller failed, error code %d\n',res); set(gcf,'NumberTitle', 'off', 'Name', '(Not connected)'); msgbox('Connection failure, Please check the LOCAL!');%Connection to controller failed, please check the IP address return;end

③ Disconnect the controller by using the message response function of the disconnect button.

·

% --- Disconnect Executes on button press in btn_close.function btn_close_Callback(hObject, eventdata, handles)global g_handleptr;% Define connection handle [res,~] =calllib('zauxdll','ZAux_Close',g_handleptr);commandCheckHandler("ZAux_FastOpen",res);disp("Close connection with controller");% Print

④ Download the basic file via the start button and obtain the axis coordinates in real time for drawing tests.

·

% --- Start Executes on button press in btn_test1.function btn_test1_Callback(hObject, eventdata, handles)global g_handleptr;h = animatedline; % Create blank dynamic curve axis([-500 2000 -500 1000]) % Set coordinate system range Response =char(512*512);cmd=char('?dpos(0),dpos(1),dpos(2),dpos(3),axisstatus(0),axisstatus(1),axisstatus(2),axisstatus(3),in(0),in(1),in(2),in(3)');char Response;cmdpath=char('C:\Users\Lemon\MATLAB\Projects\LocalRunSP\Basic1.bas');[~,~,~]=calllib('zauxdll','ZAux_BasDown',g_handleptr, cmdpath,1);for k = 1:10000[~,~,~,Response]=calllib('zauxdll','ZAux_DirectCommand',g_handleptr, cmd, Response,255); Para = strsplit(Response,' '); x=str2double(Para(1)); y=str2double(Para(2)); set(handles.edit_dpos0,'String',Para(1)); set(handles.edit_dpos1,'String',Para(2)); set(handles.edit_dpos2,'String',Para(3)); set(handles.edit_dpos3,'String',Para(4)); set(handles.edit_axisstatus0,'String',Para(5)); set(handles.edit_axisstatus1,'String',Para(6)); set(handles.edit_axisstatus2,'String',Para(7)); set(handles.edit_axisstatus3,'String',Para(8)); set(handles.edit_in0,'String',Para(9)); set(handles.edit_in1,'String',Para(10)); set(handles.edit_in2,'String',Para(11)); set(handles.edit_in3,'String',Para(12)); addpoints(h,x,y); drawnowend

(3) Running effect

(4) Analysis and Conclusion The emergence of MotionRT7 is undoubtedly a major surprise and upgrade. It provides better efficiency and stability for us in the process of large-scale instruction interaction, creating higher efficiency and more value for production! For related functions, please refer to the "ZMotion PC Function Library Programming Manual".

Code download address

This concludes our presentation on the Windows Real-Time Motion Control Soft Core of Positive Motion Technology (Part 6): High-Speed ​​Interface Testing of LOCAL in Matlab.

For more exciting content, please follow the "Zheng Motion Assistant" WeChat official account. For related development environment and example code, please contact Zheng Motion Technology sales engineer: 400-089-8936. This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to improve China's intelligent manufacturing level together. Copyright of this article belongs to Zheng Motion Technology. Please indicate the source if you reprint it.

Read next

CATDOLL Maruko 95CM TPE Mini Love Doll

Height: 95cm Weight: 16kg Shoulder Width: 27cm Bust/Waist/Hip: 50/52/63cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm Anal ...

Articles 2026-02-22