Introduction

Add to My manuals
704 Pages

advertisement

Introduction | Manualzz

Chapter 5 Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ)

Use Strings In an Expression

Use a relay ladder or structured text expression to compare string data types.

To use strings in an expression, follow these guidelines:

An expression lets you compare two string tags.

You cannot enter ASCII characters directly into the expression.

Only the following operators are permitted

>

>=

<>

Operator

=

<

<=

Description

equal less than less than or equal greater than greater than or equal not equal

Strings are equal if their characters match.

ASCII characters are case sensitive. Upper case “A” ($41) is not equal to lower case “a” ($61).

The hexadecimal values of the characters determine if one string is less than or greater than another string. For the hex code of a character, see the back cover of this manual.

When the two strings are sorted as in a telephone directory, the order of the strings determines which one is greater. s e r e s l e r a t g r e

AB

B a ab

ASCII Characters Hex Codes

1ab

1b

A

$31$61$62

$31$62

$41

$41$42

$42

$61

$61$62

AB < B a > B

210

Publication 1756-RM003K-EN-P - July 2008

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

advertisement

Related manuals

advertisement

Table of contents