Previously, Zheng Motion Technology shared with everyone the firmware upgrade of motion controllers, ZBasic program development, ZPLC program development, application of communication with touch screens and input/output IO, application of motion controller data and storage, use of motion controller ZCAN and EtherCAT bus, application of oscilloscopes, characteristics of multi-tasking operation, application of motion controller interrupts, and use of USB flash drive interface, etc.
Today, we will explain how to use the ZDevelop programming software for positive motion technology motion controllers.
Video Tutorial : "Video Tutorial: Using ZDevelop Motion Controller Programming Software for Positive Motion Technology"
Using ZDevelop programming software for positive motion technology
The following is a detailed explanation with pictures and text.
1. Material preparation and controller wiring reference
2. Advantages of ZDevelop positive motion technique
ZDevelop is a PC-based software for developing, debugging, and diagnosing ZMoiton series motion controllers . It allows users to easily edit and configure the controller's program, quickly develop applications, diagnose system operating parameters in real time, and debug the program running on the motion controller in real time . It also supports both Chinese and English.
ZDevelop supports three programming methods: ZBasic, ZPLC ladder diagram, and ZHMI configuration . Programs written using ZDevelop software can be downloaded to the positive motion controller or to the simulator for simulation on a PC platform.
The ZDevelop software can connect to the controller via serial port or network port. When downloading the program to the controller, you can choose to download it to ROM and save it when power is off, or download it to RAM and not save it when power is off. Programs saved when power is off can run offline.
ZBasic, ZPLC, and ZHMI can run in multiple tasks. ZBasic can run in multiple tasks and can be programmed in combination with ZPLC and ZHMI.
ZDevelop programming software main interface
3. ZDevelop Positive Motion Technology: Main Functions
Key Points
◆ Supports three programming environments: ZBasic, ZPLC, and ZHMI;
◆ Monitor the operating status of the controller;
◆ Supports online debugging;
◆ Supports multi-tasking;
◆ Supports controller and touchscreen emulation (for applications without a controller or touchscreen);
◆ Supports manual controller operation – manual motion view;
◆ Supports viewing various types of register data -- Register View;
◆ Supports oscilloscope acquisition and display of various data types (oscilloscope view);
◆ Supports operation of input/output port status (input/output port view);
◆ Supports encrypted downloading, controller locking, and protection of customer intellectual property (generating ZAR files, locking the controller);
◆ Facilitates quick firmware and user program upgrades for customers (firmware upgrade, ZAR file download).
4. ZDevelop online command for positive motion technology
The online command and output window allows users to query and output various parameters of the controller, control axis movement, print program execution results, print program error messages, and print output functions provided by software developers in the program (output by commands such as "?", PRINT, WARN, ERROR, TRACE, etc.).
? is short for PRINT, WARN is a warning message, ERROR is an error message, and TRACE is a print message.
Whether commands such as WARN, ERROR, and TRACE are output is controlled by the ERRSWITCH instruction.
Syntax: ERRSWITCH = switch
switch: Switch for debug output
Connecting a controller or emulator allows you to use online command functionality, unrestricted by the program's running state. The "Clear" button clears all content from the "Commands and Output" window.
With "Capture" enabled, a "Save As" window will pop up, and the default file type is a .txt text file;
Once "Capture" is enabled, the original "Capture" button changes to "Capture in Progress," saving all subsequent commands and output from the output window to a txt text file until the "Capture in Progress" button is pressed again to stop capturing and saving information.
Execute online commands and print error message prompts:
5. ZDevelop search results for positive motion techniques
Open the "Search in Project" view by going to "Edit" → "Find throughout Project". Enter your search terms to search the project files and display the results in the "Find Results" window. Double-clicking a search result will quickly position the cursor on that line of code in the program file.
6. ZDevelop Axis Parameters for Positive Motion Technology
The axis parameter window allows you to monitor common parameters used in motion control. Read-write parameters can be modified directly by double-clicking within the window, while read-only parameters cannot be modified.
In the "Axis Selection" window, select the axis to be monitored; the parameters in the axis parameter window can be displayed by opening the "Custom View" through "Parameter Selection" and selecting the required parameters from the instruction list. The meaning of the parameter instructions can be found in ZBasic Help.
7. ZDevelop Custom View for Positive Motion Technology
Open the custom view by going to "View" → "Customize". In addition to changing the parameter display in the "Axis Parameters Window", you can also change the font, font size, display color and other styles of the following types of windows.
8. ZDevelop Register Window for Positive Motion Technology
Open it via the menu bar: "View" → "Registers".
This window allows you to view the values of the controller's registers. You can choose to view various types of registers (this function is only supported by controllers that support PLC functionality).
How to use:
1) Select the type, starting number, and number of registers to be read, and then click "Read" to display the data in the window. Note that the number of registers to be read should not exceed the range of registers, otherwise an error message will be displayed. Check the automatic refresh function to automatically collect and display the changes in register values in real time. Otherwise, you need to click "Read" again to obtain the changes in register values.
2) Click “Import”/“Export” to quickly upload/download register data.
3) Exporting data allows customers to easily export the registers they are interested in to a text file for saving.
4) Importing data allows customers to directly modify the saved register data they are interested in into the controller.
9. ZDevelop Oscilloscope Window for Positive Motion Technology
This window allows you to capture various data information such as the speed curve or position change curve of the controller axis.
The oscilloscope is a crucial component in program debugging and execution. It can be accessed through "View" → "Oscilloscope". The oscilloscope must be started before it can be triggered for successful sampling. After opening and configuring the oscilloscope, click "Start". It can be triggered manually or automatically by adding the "TRIGGER" command to the program.
For detailed instructions on using an oscilloscope, please refer to the previous article on our official WeChat account, "Quick Start | Part Nine".
10. Forward Motion Technique ZDevelop (Other Windows)
Manual operation : Manually operate the motor to check if the motor wiring is correct.
Input Port : View the status of the input port and special input definitions.
Output port : Check the status of the output port.
File view : The number, type, and task number of the files contained in the project.
Process view : A list of SUB functions contained in all files.
Configuration view : All windows contained in the HMI file and the components contained in each window.
11. ZDevelop Controller Status
The controller status information can be displayed through "Controller" → "Controller Status", including basic controller information, ZCAN node status, slot 0 node status, and communication configuration.
Basic information includes the maximum number of virtual axes, the maximum number of motor axes, the number of tasks, the number of files, the size of various register spaces, the program size, the memory size, the controller model, the software version number and time, the IP address, the hardware version number, the controller hardware ID, and the configurable types and mappings on each axis.
ZCAN Node : View device information on the ZCAN node.
It is generally used to view the CANID, number of axes, digital input/output number range and analog input/output number range of each module of the ZCAN expansion module.
Slot 0 node : View the node devices on the bus driver.
As shown in the diagram on the right, node 0 is an expansion module that requires the NODE_IO instruction to map input/output IO numbers. Nodes 1 and 2 are driver devices, each with a motor.
Communication configuration: View CAN communication configuration and RS232/RS485/RS422 serial port parameter configuration.
The CAN communication settings at this time are: CANIO_ADDRESS = 32, CANIO_ENABLE = 1
Combining the information from CANIO_ADDRESS and CANIO_ENABLE, we can know that the controller is in ZCAN Master mode, the CAN bus communication rate is 500kbps, and CAN is enabled.
To modify the CAN communication settings, simply change the CANIO_ADDRESS and CANIO_ENABLE parameters.
Port0 is an RS232 serial port in ModbusSlave mode, with address 1. VR and MODBUS registers are two independent ranges.
Port1 is an RS485 serial port in ModbusSlave mode, address 1. VR and MODBUS registers are two independent ranges.
For a more detailed explanation of serial ports, please refer to the parameter descriptions related to the SETCOM command.
12. ZDevelop Positive Motion Technology Firmware Upgrade
Firmware upgrades are used to update the existing firmware version of the controller. If the current firmware version cannot meet the program's operating requirements or some instruction functions are not supported, then the firmware needs to be upgraded.
There are two methods for firmware upgrades: one is to use the built-in firmware upgrade function of the ZDevelop software, and the other is to use the zfirmdown tool to download the ZFM firmware package and perform the upgrade . The two upgrade methods are similar.
First, download the firmware that needs to be upgraded. Note that the firmware version must be consistent with the current controller model. After clicking "Controller" → "Firmware Upgrade" in the ZDevelop software menu bar, click "Browse" in the pop-up window to select the target firmware package and perform the firmware upgrade operation.
For detailed instructions on firmware upgrades, please refer to the previous article on our official WeChat account, "Quick Start | Part 1".
13. ZDevelop (positive motion technology) - Modify IP address
The controller's factory default IP address is 192.168.0.11. You can change the controller's network port IP address by sending an online command using the IP_ADDRESS instruction, or by directly modifying it through the "Controller" → "Modify IP Address" window.
After connecting to the controller, the IP address can be modified. The connection will be automatically disconnected after successful modification. The online command will print the controller connection error information. You need to select the new IP address 192.168.0.23 to reconnect to the controller. The modification will be permanent after successful modification.
14. Comparison of ZDevelop controllers for positive motion technology
By using "Controller" → "Controller Comparison", you can compare whether the current project program and the program in the controller are consistent, and also compare the versions.
The left side shows the current file on the PC, and the right side shows the file saved in the controller. The files included in the project are compared one by one. If the programs in the files are exactly the same, "YES" is displayed; if the programs are different, "NO" is displayed.
15. ZDevelop Controller Lock & Unlock
Once the controller is locked, debugging will be impossible. Controller locking protects downloaded programs within the controller; after locking, the host computer program will be unable to download to the controller, but the generated ZAR file can still be downloaded. The password can be set to numbers, letters, and special symbols, with a maximum length of 16 characters.
The password is encrypted using an irreversible algorithm; once forgotten, it cannot be retrieved.
After locking the controller, operating it will display a message prompt. To unlock the controller, simply enter the password.
Operation path: Menu bar "Controller" → "Lock Controller" / "Unlock Controller".
16. ZDevelop compiles into library files.
To facilitate program confidentiality or prevent modification, the "Compile to Lib" function of ZDevelop software can compile a program file into a library file and save it. The file name of the library file has the extension ".zlb".
After debugging the source code to ensure it is correct, click "File" → "Compile Lib" in the menu bar, and save the generated .zlb file in the folder of the project's .zpj folder.
After compilation, add the Lib file back to the project. Right-click in the project window on the left side of the software, click "Add to Project", select the compiled Lib file and add it, as shown in the following figure.
Delete the source file that generated the Lib file, set the automatic run task number 0 for the compiled file, and then download the compiled file back to the controller to run it.
Opening the currently compiled program file allows you to see the declarations of the main program definition. Only the names of global definitions can be viewed; local variable definitions and the specific processes of SUB sub-functions cannot be seen. This is suitable for maintaining the confidentiality of subroutines when multiple people are collaborating on development.
17. Download ZDevelop ZAR for positive motion techniques.
By generating a dedicated ZAR encrypted download file, independent program downloads can be achieved, allowing the downloaded file to be sent to end users without concerns about program leakage. It also supports binding to the controller ID (the controller ID is a unique serial number of the controller at the factory; the controller ID can be viewed in "Controller Status" or via the SERIAL_NUMBER command). After binding, the ZAR file can only be used by this specific controller.
After setting a password, you need to use the APP_PASS command to write the password into the program for verification before downloading the ZAR file.
1) ZAR download path: Menu bar "Project" → "Generate ZAR file" to open the following window, save the file. Note that you need to debug the program to ensure it is correct before downloading.
2) ZAR loading and running path: Menu bar "Project" → "Download ZAR file", select the ZAR file to open, and the file will be automatically loaded and run.
18. ZDevelop Program Debugging
The debugging function allows you to quickly debug the program and view the running status of each task in the program.
After connecting ZDevelop to the controller, select "Debug" → "Start/Stop Debugging" from the menu bar. The following window will pop up, and there are four ways to enter debugging mode:
Download to RAM again : This means the program is downloaded to RAM again and will not be saved if RAM loses power.
Download to ROM again : This means the program is downloaded to ROM again and run. The ROM saves the data after power failure.
Do not download, reset program : This means that the program will not be downloaded, but will be rerun, and the task window will be opened to display the current running status.
Attach to current program : This means that the program will not be downloaded at this time, but only the task window will be opened to display the current running status.
After selecting the mode for entering debugging, the Tasks and Monitoring window will open.
1) The task window is used to view the running status of tasks, the file where the task is located, and the line number of the task.
2) You can add valid expressions such as global variables and file module variables to the watch window. Local variables are not supported; the parameter values will be automatically obtained and displayed during program runtime. Alternatively, in debug mode, you can select a variable in the program editing area, right-click, and select "Add to Watch" to add it to the watch list. You can also modify or add watch items by double-clicking the watch list name.
Quick Debug Toolbar: Effective when debugging is enabled.
1) Reset : Start running from the beginning.
2) Run : Start running automatically. If a breakpoint is encountered, the scan will pause. Press again to resume the scan.
3) Pause : Suspend operation.
4) Step into (F11) : Run into the program and press once to scan down one line.
5) Step over (F10) : Run to the next step of the program.
6) Step out : Step out of the SUB subroutine.
7) Run to : Run to the line specified by the cursor.
8) Set a breakpoint : Click "Set" once, then click "Cancel" again at the same location.
9) Force stop all programs from running.
If the program and the controller are inconsistent, or if the program is modified but not downloaded in time, the line number specified for debugging will be offset.
When pausing, currently submitted movements will not be paused.
You can capture and pause the program's execution by adding breakpoints.
Breakpoint debugging allows you to view the specific process of program execution, primarily used to identify logical errors. Combined with monitoring settings and axis parameter changes, it allows you to examine the impact of each execution step on registers, variables, arrays, etc.
Add breakpoints using the keyboard shortcut F9, or via the menu bar "Debug" → "Add/Remove Breakpoints". Multiple breakpoints can be added. The menu bar "Debug" → "Clear Breakpoints" clears all breakpoints in the project file at once. The Edit Breakpoint window allows you to quickly remove target breakpoints or locate breakpoints to edit code.
Once the program stops at the breakpoint, you can proceed with step-by-step debugging. Use the shortcut F11 to execute the program one step at a time.
If the breakpoint is set in a loop, the program will still pause when the loop reaches the breakpoint the next time it runs.
After the program is debugged, all breakpoints need to be cleared before downloading it to the controller for execution. Otherwise, the following message will be printed: "Warn file: "BASIC1.BAS" line: 16 task: 0, Paused. The program after the breakpoint will not be scanned temporarily."
The program can continue running even if a warning appears during its execution. However, it will stop running after the program prints an ERROR error after downloading and running.
19. ZDevelop Fault Diagnosis
The "Debug" → "Fault Diagnosis" window in the menu bar allows you to easily view the controller's software/hardware model, date, version number, task running status, and error message prompts, making it convenient for customers to check for faults and where the program stops on-site.
The Run and Alm lights in the fault diagnosis window can also be manually turned on and off, allowing you to quickly find the currently connected controller among many controllers.
The task running status is displayed as follows. When an error occurs, a prompt message is displayed, and the Alm light illuminates.
20. ZDevelop Bus Status Diagnostics
The "Debug" → "Bus Status Diagnostics" window in the menu bar allows you to easily view the buses currently supported by the controller and the device information of all nodes connected to the bus.
For the meaning of the printed information, please refer to the help documentation for the *ETHERCAT command. This window is consistent with the print data results of *ETHERCAT and *RTEX.
21. ZDevelop User Help
Click "Help" to directly open the following document, where you can view the instructions, usage examples, and introductions to some functions.
In the program, select the target instruction, press the F1 key or double-click the instruction to quickly open the instruction help in the help view. Basic instructions, PLC instructions, and ZV vision instructions support quick access to instruction help.
That concludes our tutorial on using the ZDevelop motion controller programming software. For more learning videos and articles, please follow our WeChat official account, "Zheng Motion Assistant".
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.