Kaiyi — 2.8 Creating Function Blocks

Chapter 2 0BProgramming Double-click the blank to open the Add Symbol window. Type “X0.0” in the Address box. The default values in the Type… box, the Initial box, and the Comment… box remain unchanged. Click OK to complete the typing. Users can see a new piece of data. Users can create the global symbols for the data in the table above in the same way. (For the analog module, the data type is a real floating-point number. Therefore, the symbol occupies two data registers, and the address in the Address box is the initial address.) 2.8 Creating Function Blocks The procedure in this example is to create a function block first. Users also can create the main program first.

There is no absolute relation between the function block and the main program. They are actually executed alternately. However, users are recommended to create a function first when the function is used repeatedly. The control relation among the underground pool, the water tower, and the pump can be represented by a function block. There are usually two water systems in a multi-storey building. If users create the function blocks, they only need to change the variables of the input pins and those of the output pins to complete the second water system. 2-19