Stringsum - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions

StringSum

The StringSum instruction calculates the checksum for a text string.
Instruction
StringSum
Checksum
Calculation
Variables
Name
Meaning
In
Text string
to process
Size
Byte size
Out
Checksum
Bit strings
In
Size
Out
Function
The StringSum instruction calculates the checksum of text string to process In. Checksum Out will be
the number of bytes specified with byte size Size. 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' and Size is USINT#2.
LD
StringSum
EN
In
'1234'
USINT#2
Size
In
Character codes
31
32
If Size was USINT#1 in the above example, Out would be 'A'.
2-532
Name
FB/FUN
FUN
I/O
Description
Text string to process
Input
Byte size of checksum
Output
Checksum
OK
ENO
abc
'1234'
Total calculated.
33
34
Graphic expression
(@)StringSum
EN
ENO
In
Out
Size
Valid range
Depends on data type.
1 or 2
Number of bytes speci-
fied by Size
Integers
ST
abc:=StringSum('1234', USINT#2);
Byte size Size = USINT#2
Out = abc
'CA'
NY-series Instructions Reference Manual (W560)
ST expression
Out:=StringSum(In, Size);
Unit
Default
---
''
Bytes
1
Bytes
---
Times, durations,
dates, and text strings
OK
OK

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents