ODD

Function - Test if an integer is odd

Inputs

IN : DINT  Input value

Outputs

Q : BOOL   TRUE if IN is odd. FALSE if IN is even.

Remarks

In LD language, the input rung (EN) enables the operation, and the output rung is the result of the function. In IL language, the input must be loaded before the function call.

ST Language

Q := ODD (IN);

FBD Language

OddFbd.gif (1154 octets)

LD Language

(* The function is executed only if EN is TRUE *)
OddLd.gif (1355 octets)

IL Language:

Op1: LD  IN
     ODD
     ST  Q    (* Q is TRUE if IN is odd *)

See also

MIN   MAX   LIMIT   MOD