beautypg.com

Truncate (trunc), C.9.5 truncate (trunc) – Nematron Pointe Controller User Manual

Page 434

background image

Appendix C: Ladder Diagram Block Reference

Pointe Controller User Guide

432

C.9.5 Truncate (TRUNC)

When used in a Ladder Diagram, the TRUNC block truncates a floating-point
input value and discards its fractional (decimal) part. This is effectively the same
as rounding the value down to the nearest integer, although the value always
remains a floating-point number.

Select the

tool (from the

Miscellaneous Blocks

toolbar) and click on a ladder

rung to insert the following block:

Once the block is inserted, you can double-click on it to

configure

it.

Functional Description

This block always passes the Enable input state (EN) through to the Enable Out
output state (ENO) without change; when EN becomes on, ENO is turned on, and
when EN becomes off, ENO is turned off.

When EN becomes on, the block function is executed: the Input Value (IN) is
truncated and its fractional (decimal) part is discarded. The result is sent to the
Output Value (OUT).

For example, the floating-point value 123.45 is truncated to 123.00.

The block function is executed every time the ladder is

scanned

, so long as EN

remains on. If EN becomes off, then OUT remains at its last calculated value until
EN becomes on and the block function is executed again.

Configuration Reference

The parameters of this block are described in the following table:

Param

Name

Config

Var Type

Description

EN

Enable

no

-

The state of the rung (off/on)
received from the left.

ENO

Enable
Out

no

-

The state of the rung (off/on)
passed to the right.

IN

Input
Value

req

%IF

%MF

%QF

The input value.

OUT

Output
Value

req

%MF

%QF

The result of truncating the input
value.