Stringlrc - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions

StringLRC

The StringLRC instruction calculates the LRC value (horizontal parity).
Instruction
StringLRC
Calculate Text
String LRC
Variables
Name
Meaning
In
Text string
to process
Out
LRC value
Bit strings
In
Out
Function
The StringLRC instruction calculates the LRC value (horizontal parity) of text string to process In. The
LRC value is the exclusive logical OR of the character codes for the text string in In. The LRC value
(Out) is given as a hexadecimal text string with a NULL character stored at the end.
The following example is for when In is '1234'.
LD
StringLRC
EN
In
'1234'
In
'1234'
Character codes
31
32
2-506
Name
FB/FUN
FUN
I/O
Description
Input
Text string to process
Output
LRC value
ENO
abc
Exclusive logical OR
33
34
Graphic expression
(@)StringLRC
EN
ENO
In
Out
Valid range
Depends on data type.
3 bytes max. (two sin-
gle-byte alphanumeric
characters plus the final
NULL character)
Integers
ST
abc:=StringLRC('1234');
Out = abc
'04'
NJ-series Instructions Reference Manual (W502)
ST expression
Out:=StringLRC(In);
Unit
Default
''
---
---
---
Times, durations,
dates, and text strings
OK
OK

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents