Omron SYSMAC CP Series Instruction & Reference Manual page 292

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Function
FCS(180) calculates the FCS value for W units
of data beginning with the data in R1, converts
the value to ASCII code, and outputs the result
to D (for bytes) or D+1 and D (for words). The
settings in C+1 determine whether the units
are words or bytes, whether the data is binary
(signed or unsigned) or BCD, and whether to
start with the right or left byte of R1 if bytes are
being added.
When bit 13 of C+1 has been set to 1,
FCS(180) operates on bytes of data. In this
case, bit 12 determines whether the calculation
starts with the rightmost byte of R1 (bit 12 = 1)
or the leftmost byte of R1 (bit 12 = 0).
Sample program
When CIO 0.00 is ON in the following example, FCS(180) calculates the FCS value for the 10 bytes of
data beginning with the rightmost byte of D100 and writes the result to D200.
0.00
FCS
C
D300
R1
D100
D
D200
2-256
15
14 13 12 11 10 9 8 7
C+1: D301
Starting byte (Effective only if bit 13 is 1.)
1: Rightmost byte
Units
1: Bytes
Always 0.
15
8 7
0
0
C: D300
15
8 7
R1: D100
0
2
D101
0
4
D102
0
6
D103
D104
0
8
D105
0
0
15
3
0
D: D200
R1
W (Table length)
ASCII conversion
Calculation
FCS value
D
6 5 4 3 2 1
0
Always 0.
0
0
A
10 bytes
Table length
0
0
1
0
3
0
5
0
7
The FCS value for the
0
0
shaded bytes is calculated
and converted to ASCII.
0
3
8
CP1E CPU Unit Instructions Reference Manual(W483)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents