1. Quick Introduction to Function Blocks
1. Quick Introduction to Function Blocks
1.1. Basic knowledge
If you want to know C language,Please click here。
If you want to know editor,Please click here。
1.2. 快速入门
- In the Engineering Explorer, right-click on the "Function Blocks" folder and open the context menu. Click "Add" → "Function Block".

图1 Add Function Block
- When a "new function" appears, enter a suitable name.

图2 Rename
- Double click on "New Function" to open a blank text area. Enter C language code.

图3 Enter code
This C language function adds parameter a and parameter b, and writes parameter c. Parameters a and b are of type int, and parameter c is of type cword, which is actually an int pointer.
Looking at the Engineering Resource Manager again, this function appears.

图4 Appearing Function
- Drag the mouse to the editor and add the CALLM instruction that calls this function.

图5 Add CALLM
- Fill in the parameters. Non pointer type parameters can be substituted into constants. The following program is equivalent to ADDD D0 K10 D2.

图6 Fill in parameters