DL205 User Manual, 4th Edition, Rev. B
5–268
Chapter 5: Intelligent Box (IBox) Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Sum BCD Numbers (SUMBCD) (IB-522)
Sum BCD Numbers sums up a list of consecutive 4-digit WORD BCD numbers into an 8-
digit DWORD BCD result.
You specify the group's starting and ending
V-memory addresses (inclusive). When
enabled, this instruction will add up all the
numbers in the group (so you may want to
place a differential contact driving the
enable).
SUMBCD could be used as the first part of
calculating an average.
SUMBCD Parameters
• Start Address: specifies the starting address of a block of V-memory location values to be added
together (BCD)
• End Addr (inclusive): specifies the ending address of a block of V-memory location values to be
added together (BCD)
• Result (DWORD BCD): specifies the location where the sum of the block of V-memory BCD
values will be placed
SUMBCD Example
In the following example, the SUMBCD instruction is used to total the sum of all BCD
values in words V2000 thru V2007 and store the resulting 8-digit double word BCD value in
V3000 and V3001 when C100 turns on.
DS5
Used
HPP
N/A
Parameter
DL205 Range
Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . V
See DL205 V-memory map - Data Words
End Address (inclusive) . . . . . . . . . . . . . . . . . . V
See DL205 V-memory map - Data Words
Result (DWORD BCD) . . . . . . . . . . . . . . . . . . . . V
See DL205 V-memory map - Data Words
ý
ý
þ
þ
230
240
2
5
0
-1
2
6
0