TRN (Truncate) Ladder Logic Instruction

Definition

The Truncate instruction removes the fractional part of a number stored in a Real data type and places the truncated value in the destination. The Source data remains unchanged.

Example

  •             Source data =              357.06
  •             Destination data =      357      (After truncate)

List of possible arguments

SOURCE can be one of the following data types.

  • CONSTANT
  • REAL

DESTINATION can be any combination of the following data types.

  • SINT
  • INT
  • DINT
  • REAL

Note: Arithmetic status flags are affected (S:V, S:Z, S:N, S:C). Overflow, Zero, Negative, and Carry.