Chapter 8 Logic Instructions
8-343
FB/FC
Explanation Applicable model
FC
LRC instruction is used to find the LRC value of the specified data.
Input Parameters
Meaning
Description Valid range
Data
address of the
data for LRC
value calculation
Input
The starting address of the data for
LRC value calculation. The starting
address can be got by ADR instruction
——
Length
Length of the data
for LRC value
calculation
Input
How many bytes of data are for the
LRC value calculation by counting from
the starting address of the data with
1~255
LRC The LRC value Output The LRC value of the specified data
type of the variable
that the output
parameter is
Boolean
Bit string Integer
Real
number
Time, date
POINTER
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
POINTER TO
Data
●
Length
●
LRC
●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data type.
Function Explanation
LRC instruction is used to find the LRC value of the specified data.
The instruction performs the calculation of the LRC value according to the starting address specified by
Data and number of bytes specified by Length.
The calculation result is put in the output parameter LRC.