ALT

Alternative out

The function inverts the output condition each time the rising edge of the input signal is detected.

Parameters

Input

Unnamed input (BOOL)

input signal

Output

Unnamed output (BOOL)

inverted output signal

Remarks

When the mode is changed from “PROG” to “RUN” or the power is turned on in “RUN” mode while the input signal is TRUE, a rising edge will not be detected for the first scan.

  1.  (1) Invert
Be careful when programming with commands that effect the order in which a program is carried out, e.g. jump or loop instructions within a sequential function chart or a function block. The order of the instructions might change depending on the time when the instruction is carried out or the input value. Specific basic JUMP and LOOP instructions are:
  • MC to MCE instruction

  • JP to LBL instruction

  • F19_SJP to LBL instruction

  • LOOP to LBL instruction

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

	VAR
		input_value: BOOL:=FALSE;
		output_value: BOOL:=FALSE;
	END_VAR
	VAR
		input_value: BOOL:=FALSE;
		output_value: BOOL:=FALSE;
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,ALT!,Instance,8,0,13,3,,?Di?Co);
B(B_VARIN,,input_value,6,1,8,3,);
B(B_VAROUT,,output_value,13,1,15,3,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

output_value:=(ALT(input_value));

IL body

Modified on: 2019-12-14Feedback on this pagePanasonic hotline