DEC (81)


DEC (81)

ID                          81

 

 

Application:

PLC

SIM

 

Group: MATH

 

Short description:

Register decrementing function.

 

Inputs (1):

no.

type

impulse

mark

notes

1

B

yes (0 -> 1)

imp

Input signal

 

Outputs (2):

no.

type

impulse

mark

notes

1

I

no

OUT

Function output value
2 B yes (0 -> 1 -> 0) limit Result is out of limit for an integer type variable



Settings:

no.

type

mark

notes

1

I

NUM

Register no.

 

Function operation:

The DEC function decrements the NUM register value when a rising edge occurs at the imp input. When a function block is created, the NUM variable is assigned a register number. The function returns the value of the selected NUM register on the OUT output. If the result of the operation is lower than 0, the limit output is activated for one program cycle, and the value 2147483647 is set on the OUT output and in the register. If the value of the register at the start of the function is greater than 2147483647, then the register is set to 2147483647.

 

R registers and M markers used: as set in the (NUM) parameter of the function block.