当前位置:网站首页>Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (3) -- modk routine test
Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (3) -- modk routine test
2022-07-29 06:40:00 【Hongke Industrial Communication Division】
This series of articles aims to help readers understand Hongke KPA Automation A brief understanding of the system , And can use MoDK Carry out quick hands-on operation , Include : Siphonaceae KPA
Automation、 Siphonaceae KPA MoDK brief introduction , Siphonaceae KPA MoDK Build the running environment and routine test . Hongke built in this document KPA
MoDK Running environment , Is based on Win10, And it is based on C/C++ For developing languages . If you have any questions , Welcome to comment on 、 Private letter or contact [email protected], Hongke engineers will give you professional answers .
Siphonaceae KPA Automation It is an automation solution development platform , Suitable for factory automation and process control applications . After the previous introduction and the construction of the operating environment , This part will test some official routines , Include EtherCAT From station ( combination MDK)、Vrep Robot simulation platform 、Simulation( Pure text simulation ).
This tweet will show the testing of some official routines . The following routines correspond to MoDK Controllable 3 Class object :EtherCAT From station ( combination MDK)、Vrep Robot simulation platform 、Simulation( Pure text simulation ). The last routine passes Motion Configuration Utility Settings in , The actual motor and Vrep Simultaneity control of simulation robot in .
1. Move_relative (EtherCAT & CiA402)
The test effect of this routine is to control a physical motor shaft 3 Related sports , We need an external EtherCAT Observe the phenomenon of slave servo and motor , In my testing environment , The choice is maxsine Servo of .

The steps of routine test are as follows :
① In Hongke KPA Studio Network configuration in
Open Hongke KPA Studio, Import maxsine servo ESI file . Danghongke KPA MRT After installation , Can be used as local EtherCAT Master And Studio Connect . take maxsine Servo drag to Master The location of , That is, the slave station is mounted , Also completed the network configuration .
② Configure the shaft , And export the configuration file
The next in Motion Configuration Utility Dock the shaft with the servo motor , And export the network configuration and axis configuration files , Then bind the motor shaft to the servo , And export relevant files .
③ Modify some parameters of the program source code
The routine reads the network configuration file and the axis configuration file MoDK Initialization of running environment , The read file name is set by macro . You can adapt the file name by modifying the macro . in addition , We still need to revise it ecatm Siphonaceae KPA15_helper.c The selected network card number in , Make local Master It can control the slave servo through the correct network card .
After the above configuration is completed , Click on “ctrl+F5”, You can run the program to observe the phenomenon .
2. Move_path (Vrep)
This routine not only embodies Hongke KPA MoDK Another kind of controlled object (Vrep), It also reflects another initialization method of shaft instances —— Source code configuration , That is, to modify the axis configuration parameters by adding the source code directly to the program . Compared with “ Interface configuration + Source code import ” Environment initialization method , This configuration method will undoubtedly be more cumbersome , And it will increase the amount of source code . But after this part of the code is completed , The steps of modifying the axis configuration parameters again can be carried out directly in the code , The other way of environment initialization still needs to be reconfigured ini file .
The steps of routine test are as follows :
① stay VREP Open the official three-axis linear robot model
Siphonaceae MoDK Provides a Vrep Three axis linear robot model , In the development package samples Under the folder , install Vrep after , Double click on Vrep Open the model in
② Modify... In the code VREP Port parameters for
Siphonaceae MoDK Provided Vrep Model USES 3.04.00 Version of Vrep Development , And currently downloaded on the official website Vrep The version has arrived 3.5.0. However, this does not require users to perform too many adaptation operations , The new version of the vrep Will be downward compatible with older versions vrep Model of .
③ Observe the control phenomenon
After the modification is completed , Routine tests can be carried out , Click on ctrl+F5, Switch to VREP window , It can be observed that the end of the robot moves according to the predetermined trajectory points . Users can also use their own algorithm to generate the required trajectory here demo Intermediate testing
3.Simulation_move_absolute (Simulation)
This routine is pure text emulation , There is no need for additional operations .MoDK In Hongke KPA The virtual axis handle is created in the running environment ,simulation That is, these virtual axis handles are virtualized , Reflected in the position of each axis read 、 The speed value changes .
Switch startup items , Press down ctrl+F5, You can start the simulation .
4. Move_complex_drawing (EtherCAT & CiA402 + Vrep)
For three controllable controlled objects , Siphonaceae MoDK You can control any two of them at the same time , Select EtherCAT Servo motor +Vrep The robot model is tested by two more intuitive controlled objects . The objects of test control are three maxsine Of EtherCAT Servo motor , add Vrep Three axis linear robot model in .
The steps of routine test are as follows :
① In Hongke KPA Studio Network configuration in
The operation of this part is the same as that of 1 Routine Move_relative (EtherCAT & CiA402) The operation is basically the same , Refer to the above .
② open Vrep Three axis linear robot model in , And connect the shaft with the servo motor
Notice the name of the linear robot model here , We will use . And notice , Robotic axis1 Use y Axis coordinates represent ,axis2 Use x Axis coordinates represent . The logic of the code is based on x、y The order of scanning . Therefore, when initializing the configuration, you need to pay attention to the number designation of the shaft , About to number 1(x Axis ) Assign to axis2, Number 2(y Axis ) Assign to axis1.
③ modify V-REP Parameters and general parameters , And clone the motor shaft
Change the parameter to the required parameter , Clone the motor shaft after completing the motor shaft parameter configuration , Then just bind the servo for the cloned motor axis 、 Set up Vrep Axis number of robot model 、 modify Vrep Port number is enough .
export file , Press... After modifying some parameters of the source code “ctrl+F5”, You can see the control phenomenon :Vrep The robot model in carries out circular motion ,EtherCAT The servo also drives the motor to move .

summary
- Observe MoDK Routine code , It can be found that its programming follows a relatively regular three-step pattern : Declare variables → Create examples → Function call , The axis control cycle is realized by state machine . But this PLC Although the way of programming is relatively clear , But the amount of code looks quite large , Maintainability is relatively poor .
- thus MoDK The best way to use , Still combined with Hongke Straton Use PLC Language development . Siphonaceae Straton Have an independent variable editor , also PLC Function block creation and invocation are integrated , It can greatly reduce the workload of development , The maintenance of the program has also become intuitive and simple .
Due to space limitation , Routine test examples failed to expand in detail . If you have any questions , Welcome to email [email protected] Contact our technical engineer .
边栏推荐
- Idea practical shortcut key novice must see
- DDoS details
- Plugin location in mavan
- 虹科案例 | PAC:一种整合了softPLC控制逻辑、HMI和其他服务功能的集成控制解决方案
- 6898 changing matrix problem solution
- What if the 80443 port of the website server has been maliciously attacked?
- day04_ array
- Handwritten digit recognition using neural network
- 4、 LAN and man
- Merkletree builds QT implementation UI
猜你喜欢
随机推荐
案例补充、ATM
六、 网络互联与互联网
基于udp通信的在线多人聊天室
5、 Wireless communication network
UDP套接口通信实验
Complex floating point multiplication of vivado IP core floating point
通过os-shell引发的mysql拿shell的思考
waf防护是什么
day17_集合下
Why are the job requirements for software testing in 2022 getting higher and higher? Is there any secret in it?
day04_ array
一文看懂网络安全五年之巨变
How to pre circumvent the vulnerabilities of unsafe third-party components?
day04_数组
Right value reference and mobile construction
Explain the difference between FIR filter and IIR filter in detail
Merkle Tree 存在性功能第一次修改
虹科案例 | PAC:一种整合了softPLC控制逻辑、HMI和其他服务功能的集成控制解决方案
Floating point multiplication and division of vivado IP core floating point
Hongke automation SoftPLC | modk operation environment and construction steps (1) -- Introduction to operation environment









