Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 1072

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Text String Processing Instructions
Example
D100
D200
0.01
0.03
D100
D200
Text string ABCD
D100
D101
D102
Text string ABC
D100
D101
>$
D100
D200
>$
D200
D300
Text string
The milk and juice
D100: Milk
text strings are
D200: Juice
compared and their
positions are
D300: Beer
reversed because
M > J.
In this way, three text strings can be rearranged in alphabetical order.
In this example, string comparison instructions are used to compare data.
200.00
200.02
D100
D200
200.04
Text string ABC
D200
D201
Text string ABC
D200
D201
In this example, three text strings are rearranged in alphabetical order. The
original order is as follows:
D100: Milk
D200: Juice
D300: Beer
When rearranged alphabetically, the order is as follows: beer, juice, milk.
Two text strings beginning with D100 and D200 are compared in
ASCII order from lower to higher. If the text string beginning with
D100
D100 is higher in ASCII order than the one beginning with D200,
D200
then the position of the two text strings will be reversed.
Two text strings beginning with D200 and D300 are compared in
ASCII order from lower to higher. If the text string beginning with
D200
D200 is higher in ASCII order than the one beginning with D300,
D300
then the position of the two text strings will be reversed.
The milk and beer
Juice
text strings are
Milk
compared and
their positions are
Beer
reversed because
M > B.
Address
Mnemonic
Operand
>
---
D100
D200
200.00
0.01
---
D100
D200
200.02
0.03
<>
---
D100
D200
200.04
>
=
D100
D100
D200
D200
The juice and beer
Juice
text strings are
Beer
compared and
their positions are
Milk
reversed because
J > B.
Section 3-31
<>
D100
D200
Alphabetical order
Beer
Juice
Milk
1039

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CP - PROGRAMMING MANUAL 05-2007 and is the answer not in the manual?

Questions and answers

Table of Contents