Mochuan Drives - Professional design, manufacturer HMI Touch Screen Panel & PLC Controller, provide industry solutions and system integration since 2009.

  • Professional design, manufacturer HMI Touch Screen Panel & PLC Controller, provide industry solutions and system integration since 2009.

HMI Panel

Simple operation of macro commands

Hello, welcome to the touch screen operation video tutorial, this talk is mainly about the simple operation of the macro command. First of all, let's talk about the new macro command, there are two ways to create a new macro command, the first is to click on the macro command in the menu bar, click on the general macro, select the new macro command, the second is to click on the left side of the project, find the general macro, new macro command, macro name can be modified by themselves, Chinese and English can be, the description is to describe the specific role of the macro, click OK to complete the new macro command, the left side is Address declaration, all the variables used in the macro, including the local address of the box or label address must first be defined here, the middle of this part is the code writing part of the macro instruction, the right is the use of some functions, such as read and write functions, in addition to these functions, you can also use the functions of the C language, but read and write functions must use these listed on the right, including read words, read double words, floating point numbers and so on. Then look at the second step of editing macro instructions, editing macro instructions also has two methods, the first is to click on macro instructions - general macro - edit macro instructions, the second is to click on the project, find the corresponding macro, click to open the macro instructions, you can rewrite the code, modify, etc. on this side. The third talk about the macro password settings, or click on the menu bar in the macro command, click on the general macro password settings, pop-up password settings interface, for example, enter the password 123456, when the password and confirm the password is the same, OK button can only be used, click OK, macro password settings, either new macro instructions or edit macro instructions need to enter the password, for example, now a new macro instructions, you need to Enter the macro password, edit macro instructions, assuming that under the project click on, also need to enter the macro password, after entering the password will jump to the macro instruction interface, and then talk about changing the password, or click on the macro instruction, find the general macro password settings, in the password settings interface click to change the password, you need to enter the old password and the new password, when the old password, password, confirm the password is the same, before you can click OK, click OK Then click on the new macro command to enter the new password, click OK, you can see that the macro password has been successfully modified, the macro password can also be deactivated, click on the macro command, select the general macro password settings, click on the password settings window to deactivate the password, click on verify, then click on a macro command, you can see that you now no longer need to enter the password. The fourth talk about the macro instruction call method, there are two commonly used, one using the switch, click on the component switch - function key, select execute macro instruction, find the macro instruction you want to use, click OK, this side of an additional operation to execute the macro instruction, click OK, you can also use the timer to operate, the timer is divided into a public window timer and a basic window timer, when When the timer works on a public window, it will be executed when all windows are opened again, when it works on a basic window, it will only be executed when the window is opened, for example, double click on the window, find the timer, click on the Add button, select Trigger when window is opened, select the timer function we want to use the macro instruction, click OK. The following is a simple example of the specific operation of the macro, the example is LW1 value type 16 unsigned number through the macro instruction to achieve the value of LW2 is twice the value of LW1, the first step is to create a new macro instruction, click on the macro instruction, new macro instruction, macro name can be modified, click OK, we need to use the address first defined in this side, click New, address alias For example is lw1, the first LW1 used to build over, select the word address, the address to LW1, and then click OK, in a new LW2 address, address alias can be new, modify, delete copy and paste the operation, the following write the code of the macro instruction, first of all to read the value of LW1 up, with read-write function GetWord, this side of the corresponding use of the statement, see it There are two parameters, the first is the address alias, the second is the address offset, address alias we will choose lw1, offset set to 0, the return variable name assumed named a, and then click insert, you can see this side to check into a, the requirement is LW2 is twice the LW1, now first define an intermediate variable b, copy it so that it is equal to twice the a, and then copy the value of b to LW2 on, you need to use the SetWord function, select LW2, address offset select 0, and then click insert, then this side of the set value is written, that is, b, written after the compile to detect whether there are errors, prompt compile success, we now set an error, the lack of a semicolon, and then compile, it suggests that there is a comma or semicolon missing, and then add a semicolon, the Compile again, compile successfully, then save. The next step is to call the macro instruction, we select the role in the basic window, select Timer, then select Add, Trigger when the window is open, execute the macro instruction, check the macro instruction just built, click OK, then simulate offline, for example, enter 1, you can see that it becomes 2. The simple operation of the macro instruction is finished here, thank you for watching.

Basic Information
  • Year Established
  • Business Type
  • Country / Region
  • Main Industry
  • Main Products
  • Enterprise Legal Person
  • Total Employees
  • Annual Output Value
  • Export Market
  • Cooperated Customers
Contact Us

Take advantage of our unrivaled knowledge and experience, we offer you the best customization service.

Get in touch 

Please provide us with the information below to complete your request.    Just leave your email or phone number in the contact form so we can send you a free quote for our wide range of designs!    

They are all manufactured according to the strictest international standards. Our products have received favor from both domestic and foreign markets.
They are now widely exporting to 200 countries.

Send your inquiry

Choose a different language
Current language:English