Character to integer (chr_to), C.9.7 character to integer (chr_to) – Nematron Pointe Controller User Manual

Page 436

Advertising
background image

Appendix C: Ladder Diagram Block Reference

Pointe Controller User Guide

434

C.9.7 Character to Integer (CHR_TO)

When used in a Ladder Diagram, the CHR_TO block converts the first character of
a string into the equivalent ASCII decimal value.

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 first character of the
Input Value (IN) is converted into an equivalent ASCII decimal value and the
result is placed in the Output Value (OUT).

For example, the character ‘A’ is converted into the ASCII decimal value 65.

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

String

Literal

The input value. Literals must be
enclosed in single quotes (‘ ’).

OUT

Output
Value

req

any integer*

The result of converting the first
character of the input value into an
equivalent decimal value.

* Any Memory or Output tag except 32-bit Real (F) or Bit (X). For more information, see “

Defining

Input, Output, Memory tags

” on page 114

.

Advertising