High
−
level Instructions
3
−
130
Precautions when comparing BCD or external data
When comparing special data, such as BCD or unsigned binary (0 to FFFF), construct your program as
shown in the program example below, using special internal relays R900B and R9009.
Example:
Compares BCD data in DT0 and DT1.
R1
R2
R3
R0
R0
R0
R0
F60 CMP, DT 0, DT 1
R9009
R900B
R9009
R900B
1
....When DT0 < DT1, internal relay R1
turns on
2
....When DT0 = DT1, internal relay R2
turns on
3
....When DT0 > DT1, internal relay R3
turns on
Flag operation when comparing BCD data or unsigned 16
−
bit data (0 to FFFF)
Comparison between
Flag
Comparison between
S1 and S2
R900A
(> flag)
R900B
(= flag)
R900C
(< flag)
R9009
(carry flag)
S1 < S2
off
on
S1 = S2
off
on
off
off
S1 > S2
off
off
“ ”: turns on or off according to the conditions
For example, when S1 = H8000 and S2 = H1000, R900A will turn off and R900C will turn on. For this reason,
the correct comparison result will not be obtained in a program which uses R900A and R900C.
S1
1 0 0
0
0 0
0
0
0 0
0
0
0 0
0 0
BCD
8
0
0
0
S2
0 0 0
0
0 0
0
0
1 0
0
0
0 0
0 0
BCD
1
0
0
0
Flag conditions
・
Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
・
Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]
Summary of Contents for FP-X
Page 1: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 2: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 24: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 1333: ...5 245 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...