EasyManua.ls Logo

Panasonic FP-E - Page 398

Panasonic FP-E
1334 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
High−level Instructions
3 − 134
Precautions when comparing BCD or external data
When comparing special data, such as BCD or unsigned binary (0 to FFFFFFFF), flags R9009, R900A,
R900B, and R900C work as shown in the table below. In this case, construct your program as shown in the
program example below, using special internal relays R900B and R9009.
Example: Compares BCD data in (DT1, DT0) and (DT11, DT10).
e)....When (DT1, DT0) < (DT11, DT10),
internal relay R1 turns on
f)....When (DT1, DT0) = (DT11, DT10),
internal relay R2 turns on
g)....When (DT1, DT0) > (DT11, DT10),
internal relay R3 turns on
R1
R2
R3
R0
R0
R0
R0
F61 DCMP, DT 0, DT 10
R9009
R900B
R9009R900B
e)
f)
g)
Flag operation when comparing BCD data or unsigned 32−bit data (0 to FFFFFFFF)
Comparison
between
Flag
Comparison between
(S1+1, S1) and (S2+1, S2)
R900A
(> flag)
R900B
(= flag)
R900C
(< flag)
R9009
(carry flag)
(S1+1, S1) < (S2+1, S2)
off on
(S1+1, S1) = (S2+1, S2)
off on off
off
(S1+1, S1) > (S2+1, S2)
off
off
“ ”: turns on or off according to the conditions
For example, if an F61 (DCMP) instruction is executed when S1 = H80000000 (K−2147483648) and S2 =
H10000001 (K+268435457), the result will be S1<S2. Thus R900A will turn off and R900C will turn on. In a
program which uses R900A and R900C, the correct comparison result will not be obtained.
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: info@clrwtr.com