odd

PLCopen motion icon

 Function - Test if an integer is odd.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN

DINT

 

 

 

Input value.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

 

 

  • TRUE if IN is odd.
  • FALSE if IN is even.

Remarks

None

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the input rung (EN) enables the operation.
    • The output rung keeps the state of the input rung.
    • The function is executed only if EN is TRUE.

IL Language Example

  • In the IL Language, the first input must be loaded before the function call.
    • The second input is the operand of the function.
Op1: LD  IN
     ODD
     ST  Q    (* Q is TRUE if IN is odd. *)

ST Language Example

Q := ODD (IN);

See Also