SUB

Subtraction of one variable from another of the types: BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL and LREAL. A TIME variable may also be subtracted from another TIME variable resulting in third TIME type variable. Note that negative TIME values are undefined.

Example in IL:

LD 7

SUB 8

ST var1

Example in ST:

var1 := 7-2;

Example in FBD:

SUB 1: