How to Enter a Function Block

Enter the function block you want to use

There are two methods to enter a function block in the Structured Text program.

  • Method 1: Use the Function/Function Block window. (Use this method if you don’t know the function block name yet.)

  • Method 2: Type in the function block name directly. (This method is quicker if you already know the function block name.)

 

 

Use the function block you entered

XG5000 displays the data type defined for each input(s) indicated with ‘:=‘ and output(s) indicated with ‘=>’.

A variable or constant can be assigned to each input. Only a variable can be assigned to each output.

All input(s) must be used in the program, but any output can be omitted. The following expressions are all valid.

The instance of the function block is a variable. The input(s) and output(s) associated with the function block become member variables for the instance.

For example, when the instance of the TMR function block is entered in the program, the following 5 member variables are created automatically.

Each member variable can be accessed with the name in the following format.

<Variable name of the instance><Member variable name>

The example programs in the left can be written as follows.

The member variables can be used in the program like this.

 

 

 

LP304D-6