Share this

Application of ADT850 quad-axis motion control card based on LabVIEW platform

2026-04-06 07:38:40 · · #1
Abstract: This paper introduces a method for rapidly developing multi-axis motion control programs by using dynamic link libraries (DLLs) to drive and control a non-matching four-axis motion control card (ADT850) in the LabVIEW programming environment. This method combines LabVIEW with a common motion control card. The paper presents the design method and steps. Real-world applications demonstrate that this method not only effectively utilizes the motion control card's performance but also leverages LabVIEW's powerful interface editing capabilities to shorten the program development cycle and enhance the human-machine interface. 1 Introduction 1.1 Introduction to LabVIEW LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a virtual instrument development platform. It is a virtual instrument software development platform based on G language (Graphics Language), launched by National Instruments (NI) in the 1980s. LabVIEW is a graphical software programming platform specifically designed for virtual instrument development, with the latest version currently at 8.5. The graphical representation is a more natural design representation than text code. On this platform, users can easily and quickly build their applications by defining and connecting icons representing various functional modules. LabVIEW has a dedicated motion control module, and NI provides corresponding drivers for all its motion control cards, enabling easy plug-and-play functionality, but these are expensive. If the user's board is not an NI product and does not provide a LabVIEW-compatible driver, it cannot be used with LabVIEW. However, as an open development platform, LabVIEW provides a DLL interface, allowing users to call modules compiled from other software platforms and providing support for Object Linking and Embedding (OLE) technology. This allows LabVIEW to write LabVIEW-compatible drivers by calling Windows 32 Dynamic Link Libraries (DLLs), enabling secondary development of the motion control card within the LabVIEW environment. Furthermore, this software platform can significantly reduce costs and shorten project development time. 2. Development Background Based on the requirements of a glass processing company, we designed an electrical control system for its processing machinery that included four-axis motion control requirements. In the design process, adhering to the principle of cost-saving and achieving functionality, we adopted the ADT850 four-axis motion control card produced by Shenzhen Zhongweixing CNC Technology Co., Ltd. The dynamic link library of the ADT850 motion control card is a standard Windows 32-bit dynamic link library, and the selected development tools should support the Windows standard 32-bit DLL call. We compiled the dynamic link library file required for motion control (i.e., DLL format) in the VC compilation environment, and packaged the written dynamic link library file into a static link library (LIB format) according to functional blocks. If the DLL method is used, the compiled program must include not only the EXE program but also the DLL file. However, if the static link library method is used, only one EXE file is needed when distributing the program, which is simpler and easier to package and release. When writing the main interface of the program in the LabVIEW environment, the packaged LIB file is called to write the required motion control program. The main process is shown in Figure 1. [align=center] Figure 1[/align] 3 Program Design 3.1 Writing Dynamic Link Libraries Since Microsoft launched the first version of the Windows operating system, dynamic link libraries (DLLs) have been the foundation of the Windows operating system. Dynamic link libraries (DLLs) typically cannot be run directly or receive messages. They are independent files containing functions that can be called by executable programs or other DLLs to perform a specific task. A DLL only functions when other modules call its functions. All functions in the Windows API are contained within DLLs. DLL development is independent of specific programming languages ​​and compilers; as long as the agreed-upon DLL interface specifications and calling methods are followed, DLLs written in various languages ​​can call each other. To facilitate future project maintenance and development, we have developed DLLs for motion control based on their functionalities. Each DLL contains one or more functions from the ADT850 motion control library, referred to as function functions. The main function functions include board initialization, single-axis jogging, two-axis linear interpolation, two-axis circular interpolation, stop functions for emergency and gradual stops, logical coordinate zeroing functions, and axis status detection functions. Each function function has its own independent interface for easy calling. In the VC++ 6.0 software environment, select File -> New, click the Project tab, select Windows 32 Dynamic Link Library from the left list, enter the project name, add the motion control function library file of the corresponding ADT850 motion control card, and compile it into the required DLL file according to the function. 3.2 Calling the Dynamic Link Library I used LabVIEW 8.2 Chinese version in the development, which has been greatly improved compared to 8.0. First, in the LabVIEW back panel, select Libraries and Executables in the Interconnect Interface, then select Call Library Function and drag it to the appropriate location. In the newly created empty library function, select Configuration and correctly configure the DLL parameters. This article will take the continue_move function as an example for a detailed introduction, as shown in Figure 2: [align=center] Figure 2[/align] In the library name or path, select the DLL storage path C:\WINDOWS\system32\adt850.dll, under function name, select the encapsulated function continue_move, in the thread option of the right menu, select "Run in UI thread", and in the calling specification, select that it should be consistent with the compilation mode of the dynamic library written in C++. If the C++ calling convention is `extern "C" declspec (dllexport)`, then the Calling Conventions option is "C". If the calling convention is `extern declspec (dllexport) stdcall`, then the Conventions option is the default value "stdcall (WINAPI)". This setting must be correct; otherwise, unpredictable errors may occur. In the second parameter option, set the corresponding parameter values. This function has four parameters: `speed1`, `speed2`, `acc`, and `value`. After setting the parameters in the parameter options, they can be displayed under the function prototype. Finally, select the required callback function in the callback settings. This allows the compiled ADT850 function to be called by LabVIEW. For ease of distribution and packaging, we encapsulate the DLL file into a static link library, so that only one EXE file is needed for program distribution. The encapsulated LIB file is shown in Figure 3. [align=center] Figure 3[/align] 3.3 Program Implementation After configuring the function and packaging it into a static link library, we can call these functions like basic functions. To meet the requirements of automatic control, it is necessary to implement single-axis jogging and two-axis linear interpolation motion requirements sequentially on two axes. Simultaneously, functions such as emergency stop and motion status detection for each axis must be implemented. The entire LabVIEW program structure is mainly based on sequential and conditional structures, with each frame corresponding to a fixed logical function. Figure 4 shows the first two block diagrams of the entire motion control. The leftmost block is the board initialization function, which is called only once during the initial program execution through a pre-packaged power-on pulse function. The second block controls the process parameters, consisting of 13 nested selection statements within conditional statements. Motion status detection is embedded in the acceleration/deceleration control; after a conditional branch action is completed, the status value is automatically transmitted to the motion stage, entering the next branch program until completion, fulfilling the process requirements. A 100ms waiting time is set to increase the buffer time. The XY two-axis interpolation function and the Y2-axis quantitative motion function on the right have already been encapsulated in the previous section. [align=center] Figure 4[/align] Figure 5 shows the next two block diagrams, mainly implementing motion pause and resume functions. In the sequence diagram on the left, one conditional structure is composed of two nested conditional structures. The trigger condition is a unit pulse trigger. In the true condition, motion is paused while the current coordinate value is stored; in the false condition, motion continues. The sequence diagram on the right mainly uses local variables to achieve real-time transmission of motion parameters. [align=center]Figure 5[/align] Figure 6 shows a part of the storage block diagram, mainly implementing the data hard disk storage function. The encapsulated sub-VI is for data read/write functions. First, the changed values ​​are transmitted to the hard disk storage area. Data reading uses a true value trigger to achieve constant read. Because there are many parameters, an array format is used to transmit values, making the program more concise and easier to maintain. [align=center]Figure 6[/align] Figure 7 shows the front panel of the motion control program. The appropriate interface can be selected according to the actual control requirements. The main functions implemented include process parameter setting, machine tool parameter setting, automatic control interface, graphical real-time display of two-axis motion trajectories, and manual control of each axis's motion. The motion control interface implements two-axis linear interpolation, pause function, emergency stop function, real-time display of machine coordinates and working coordinates, and displays the motion status of each solenoid valve through status lights. [align=center]Figure 7[/align] 4 Conclusion Generally, engineers still mostly use compiled languages ​​such as VB, VC, or C++ for secondary development of motion control cards. Often, the development of the graphical interface consumes a significant amount of programming time, resulting in relatively low efficiency. The main advantage of the new method used in this paper is the use of the LabVIEW graphical programming language. Its powerful interface editing capabilities save considerable development time. Furthermore, by leveraging LabVIEW's support for dynamic link library calls, it enables secondary development of motion control cards not provided by NI on the LabVIEW platform. This method effectively reduces costs and programming time. The program presented in this paper has been debugged on-site at the factory and is now running stably.
Read next

CATDOLL Momoko Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22