2 Instruction Descriptions
2-508
NJ-series Instructions Reference Manual (W502)
StringCRCCCITT
The StringCRCCCITT instruction calculates the CRC-CCITT value using the XMODEM method.
The StringCRCCCITT instruction calculates the CRC-CCITT value of text string to process In using the
XMODEM method. CRC-CCITT value Out is given as a hexadecimal text string with a NULL character
stored at the end.
Set Initial to the initial value for CRC-CCITT value calculation. OutOrder specifies the byte order.
The data type of OutOrder is enumerated type _eBYTE_ORDER. The meanings of the enumerators
are as follows:
Instruction Name FB/FUN Graphic expression ST expression
StringCRCCCITT Calculate Text
String CRC-CCITT
FUN Out:=StringCRCCCITT(In,
Initial, OutOrder);
Variables
Name Meaning I/O Description Valid range Unit Default
In Text string
to process
Input
Text string to process
Depends on data type.
---
''
Initial Initial value Initial value of CRC-CCITT
value
0
OutOrder Byte order Order to process bytes in In _LOW_HIGH,
_HIGH_LOW
_HIGH
_LOW
Out CRC-
CCITT
value
Output CRC-CCITT value 5 bytes (four single-
byte alphanumeric
characters plus the final
NULL character)
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK
Initial OK
OutOrder Refer to Function for the enumerators of the enumerated type _eBYTE_ORDER.
Out OK
Function
Enumerators Meaning
_LOW_HIGH Lower byte first, upper byte last
_HIGH_LOW Upper byte first, lower byte last
(@)StringCRCCCITT
EN ENO
In Out
Initial
OutOrder