Examples for inserting functions

  1. Load first input operand (see highlighted area in examples) into accumulator with LD operator (e.g. LD start).
  2. Call function or operator with remaining operands (the sequence is marked with a black arrow in the examples below, e.g. E_MUX var_1,-2,var_2,5,var_3,var_4).
  3. Store first output operand (highlighted in the examples) from accumulator into operand with ST operator (e.g. ST start_next)

    Example 1:

Class

Identifier

Type

Initial

Comment

0

VAR

var_1

INT

0

Input parameter 1, select

1

VAR

var_2

INT

0

Input parameter 2, input

2

VAR

var_3

INT

0

Input parameter 3, input

3

VAR

var_4

INT

0

Output parameter

4

VAR

start

BOOL

FALSE

Start condition

5

VAR

start_next

BOOL

FALSE

Optional output parameter, save ENO

LD body
IL body

LD

start

(* Load value of EN input *)

E_MUX

var_1,-2,var_2,5,var_3,var_4

(* E_MUX function call *)

ST

start_next

(* Optionally store value of ENO or enter new function for cascading *)

Example 2:

POU header

Class

Identifier

Type

Initial

Comment

0

VAR

var_1

INT

0

Input parameter 1, select

1

VAR

var_2

INT

0

Input parameter 2, input

2

VAR

var_3

INT

0

Input parameter 3, input

3

VAR

var_4

INT

0

Output parameter

LD body
IL body

LD

var_1

(* Load value of first parameter *)

MUX

var_2,11,var_3,2

(* MUX function call *)

ST

var_4

(* Store output parameter in var_4 *)

Modified on: 2019-01-26Feedback on this pagePanasonic hotline