You are on page 1of 256

STANDARD RLL AND CHAPTER

INTELLIGENT BOX
INSTRUCTIONS 5
In This Chapter:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Using Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
Boolean Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
Comparative Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .525
Immediate Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .531
Timer, Counter and Shift Register Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .535
Accumulator/Stack Load and Output Data Instructions . . . . . . . . . . . . . . . . . . . . . . .548
Logical Instructions (Accumulator) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .560
Math Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .568
Bit Operation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .582
Number Conversion Instructions (Accumulator) . . . . . . . . . . . . . . . . . . . . . . . . . . . .587
Table Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .596
CPU Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .599
Program Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5101
Interrupt Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5108
Message Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5111
Intelligent I/O Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5118
Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5120
Intelligent Box (IBox) Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-124
Chapter 5: Standard RLL Instructions

1 IntroductionDL05 Micro PLCs offer a wide variety of instructions to perform many different types of
operations. This chapter shows you how to use each standard Relay Ladder Logic (RLL)
2 instruction. In addition to these instructions, you may also need to refer to the Drum
instruction in Chapter 6, or the Stage programming instructions in Chapter 7.
3 There are two ways to quickly find the instruction you need.
If you know the instruction category (Boolean, Comparative Boolean, etc.) just use the title at the
4 top of the page to find the pages that discuss the instructions in that category.
If you know the individual instruction name, use the following table to find the page(s) that
5 discusses the instruction.

Instruction Page Instruction Page


6 Accumulating Timer (TMRA) 538 Decode (DECO) 586
Accumulating Fast Timer (TMRAF) 5-38 Decrement (DEC) 576
7 Add (ADD) 568 Decrement Binary (DECB) 577
Add Binary (ADDB) 578 Disable Interrupts (DISI) 5109
8 Add Double (ADDD) 569 Divide (DIV) 574
And (AND) 513 Divide Binary (DIVB) 581
9 And (AND) 530 Divide Double (DIVD) 575
And (AND) 560 Enable Interrupts (ENI) 5108
10 And Bit-of-Word (ANDB)
And Double (ANDD)
5-14
561
Encode (ENCO)
End (END)
585
599

11 And If Equal (ANDE)


And If Not Equal (ANDNE)
527
527
Exclusive Or (XOR)
Exclusive Or Double (XORD)
564
565
And Immediate (ANDI) 532 Fault (FAULT) 5111
12 And Negative Differential (ANDND) 521 For / Next (FOR) (NEXT) 5101
And Not (ANDN) 513 Goto Subroutine (GTS) (SBR) 5103
13 And Not (ANDN) 530 Gray Code (GRAY) 593
And Not Bit-of-Word (ANDNB) 5-14 HEX to ASCII (HTA) 591
14 And Not Immediate (ANDNI) 532 Increment (INC) 576
And Positive Differential (ANDPD) 521 Increment Binary (INCB) 577
A And Store (AND STR) 515 Interrupt (INT) 5108
ASCII Constant (ACON) 5112 Interrupt Return (IRT) 5108
B ASCII to HEX (ATH)
Binary (BIN)
590
587
Interrupt Return Conditional (IRTC)
Invert (INV)
5108
589

C Binary Coded Decimal (BCD)


Compare (CMP)
588
566
Load (LD)
Load Address (LDA)
553
556
Compare Double (CMPD) 567 Load Double (LDD) 554
D Counter (CNT) 541 Load Formatted (LDF) 555
Data Label (DLBL) 5112 Load Label (LDLBL) 597

52 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL Instructions
Instruction Page Instruction Page
Master Line Reset (MLR) 5106 Reset Bit-of-Word (RSTB) 5-23
Master Line Set (MLS) 5106 Reset Immediate (RSTI) 534 1
Move (MOV) 596 Reset Watch Dog Timer (RSTWT) 5100
Move Memory Cartridge (MOVMC) 597 Set (SET) 522 2
Multiply (MUL) 572 Set Bit-of-Word (SETB) 5-23
Multiply Binary (MULB) 580 Set Immediate (SETI) 534 3
Multiply Double (MULD) 573 Shift Left (SHFL) 583
No Operation (NOP) 599 Shift Register (SR) 547 4
Not (NOT) 518 Shift Right (SHFR) 584
Numerical Constant (NCON)
Or (OR)
5112
511
Shuffle Digits (SFLDGT)
Stage Counter (SGCNT)
594
543
5
Or (OR)
Or (OR)
529
562
Stop (STOP)
Store (STR)
599
59
6
Or Bit-of-Word (ORB) 5-12 Store (STR) 5-28
Or Double (ORD) 563 Store Bit-of-Word (STRB) 5-10 7
Or If Equal (ORE) 526 Store If Equal (STRE) 525
Or If Not Equal (ORNE) 526 Store If Not Equal (STRNE) 525 8
Or Immediate (ORI) 531 Store Immediate (STRI) 531
Or Negative Differential (ORND) 520 Store Negative Differential (STRND) 519 9
Or Not (ORN) 511 Store Not (STRN) 59
Or Not (ORN) 529 Store Not (STRN) 5-28 10
Or Not Bit-of-Word (ORNB) 5-12 Store Not Bit-of-Word (STRNB) 5-10
Or Not Immediate (ORNI)
Or Out (OR OUT)
531
516
Store Not Immediate (STRNI)
Store Positive Differential (STRPD)
531
519
11
Or Out Immediate (OROUTI)
Or Positive Differential (ORPD)
533
520
Subroutine Return (RT)
Subroutine Return Conditional (RTC)
5103
5103
12
Or Store (OR STR) 515 Subtract (SUB) 570
Out (OUT) 516 Subtract Binary (SUBB) 579
13
Out (OUT) 557 Subtract Double (SUBD) 571
Out Bit-of-Word (OUTB) 5-17 Sum (SUM) 581 14
Out Double (OUTD) 557 Timer (TMR) and Timer Fast (TMRF) 536
Out Formatted (OUTF) 558 Up Down Counter (UDC) 545 A
Out Immediate (OUTI) 533 Write to Intelligent Box I/O Module (WT) 5-119
Pause (PAUSE) 524 Write to Network (WX) 5122 B
Pop (POP) 558
Positive Differential (PD)
Print Message (PRINT)
518
5114
C
Read from Intelligent Box I/O Module (RD)
Read from Network (RX)
5-118
5120
D
Reset (RST) 522

DL05 Micro PLC User Manual, 6th Edition, Rev. C 53


Chapter 5: Standard RLL - Boolean Instructions

1 Using Boolean Instructions


Do you ever wonder why so many PLC manufacturers always quote the scan time for a 1K
Boolean program? Simple. Most all programs utilize many Boolean instructions. These are
2 typically very simple instructions designed to join input and output contacts in various series
and parallel combinations. Our DirectSOFT 5 software is a similar program. It uses graphic
3 symbols to develop a program; therefore, you don't necessarily have to know the instruction
mnemonics in order to develop your program. However, knowledge of mnemonics will be
4 helpful, whenever it becomes necessary to troubleshoot a program using a handheld
programmer (HPP).
Many of the instructions in this chapter are not program instructions used in DirectSOFT 5,
5 but are implied. In other words, they are not actually keyboard commands, however, they can
be seen in a Mnemonic View of the program once the DirectSOFT 5 program has been
6 developed and accepted (compiled). Each instruction listed in this chapter will have a small
chart to indicate how the instruction is used with DirectSOFT 5 and the HPP.
7 DS5 Implied
HPP Used

8 The following paragraphs show how these instructions are used to build simple ladder
programs.
9 END Statement
All DL05 programs require an END statement as the last instruction. This tells the CPU that
10 this is the end of the program. Normally, any instructions placed after the END statement
will not be executed. There are exceptions to this such as interrupt routines, etc.. This chapter
will discuss the instruction set in detail.
11
X0 Y0
12 All programs must have
OUT

an END statement
13 END

14 Simple Rungs
You use a contact to start rungs that contain both contacts and coils. The boolean instruction
A that does this is called a Store or, STR instruction. The output point is represented by the
Output or, OUT instruction. The following example shows how to enter a single contact and
a single output coil.
B
DirectSOFT5
DirectSOFT Example Handheld Mnemonics
C X0 Y0 STR X0
OUT Y0
OUT END
D
END

54 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Normally Closed Contact


Normally closed contacts are also very common. This is accomplished with the Store Not or, 1
STRN instruction. The following example shows a simple rung with a normally closed
contact.
DirectSOFT5
2
Direct SOFT32 Example Handheld Mnemonics
X0 Y0
OUT
STRN X0
OUT Y0
3
END
4
END

Contacts in Series 5
Use the AND instruction to join two or more contacts in series. The following example shows
two contacts in series and a single output coil. The instructions used would be STR X0, AND 6
X1, followed by OUT Y0.

DirectSOFT5
7
Direct SOFT32 Example Handheld Mnemonics

X0 X1 Y0 STR X0
AND X1
8
OUT OUT Y0
END 9
END

Midline Outputs
10
Sometimes it is necessary to use midline outputs to get additional outputs that are conditional
on other contacts. The following example shows how you can use the AND instruction to
11
continue a rung with more conditional outputs.
DirectSOFT5
Direct SOFT32 Example Handheld Mnemonics
12
X0 X1 Y0 STR X0
AND X1
13
OUT OUT Y0

X2 Y1
AND X2
OUT Y1 14
AND X3
OUT

X3 Y2
OUT Y2
END A
OUT
B
END C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 55


Chapter 5: Standard RLL - Boolean Instructions

Parallel Elements
1 You also have to join contacts in parallel. The OR instruction allows you to do this. The
following example shows two contacts in parallel and a single output coil. The instructions
2 would be STR X0, OR X1, followed by OUT Y0.
DirectSOFT 5 Handheld Mnemonics

3 X0 X1 Y0
OUT
STR X0
AND X1
STR X2
4 X2 X3 AND X3
ORSTR
OUT Y0
END
5 END

Joining Series Branches in Parallel


6 Quite often it is necessary to join several groups of series elements in parallel. The Or Store
(ORSTR) instruction allows this operation. The following example shows a simple network
7 consisting of series elements joined in parallel.
DirectSOFT 5 Handheld Mnemonics
8 X0 Y0 STR X0
OUT OR X1
9 X1
OUT Y0
END

10 END

11
Joining Parallel Branches in Series
12 You can also join one or more parallel branches in series. The And Store (ANDSTR)
instruction allows this operation. The following example shows a simple network with contact
branches in series with parallel contacts.
13 DirectSOFT 5 Handheld Mnemonics
X0 X1 Y0 STR X0
14 OUT STR X1
OR X2
X2 ANDSTR
A OUT Y0
END

B X0 X2
END
X5 Y0
Combination Networks
C You can combine the various types of
series and parallel branches to solve most X1 X3 X4
OUT

any application problem. The following


D example shows a simple combination X6

network.
END

56 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Comparative Boolean
Some PLC manufacturers make it really difficult to do a simple comparison of two numbers. 1
Some of them require you to move the data all over the place before you can actually perform
the comparison. The DL05 Micro PLCs provide Comparative Boolean instructions that allow
you to quickly and easily solve this problem. The Comparative Boolean provides evaluation of
2
two 4-digit values using boolean contacts. The valid
evaluations are: equal to, not equal to, equal to or V1400 K1234 Y3
3
greater than, and less than. OUT

In the following example when the value in V-memory 4


location V1400 is equal to the constant value 1234, Y3
will energize. 5
Boolean Stack
There are limits to how many elements you can include in a rung. This is because the DL05 6
PLCs use an 8-level boolean stack to evaluate the various logic elements. The boolean stack is
a temporary storage area that solves the logic for the rung. Each time the program encounters
a STR instruction, the instruction is placed on the top of the stack. Any other STR
7
instructions already on the boolean stack are pushed down a level. The ANDSTR, and
ORSTR instructions combine levels of the boolean stack when they are encountered. An 8
error will occur during program compilation if the CPU encounters a rung that uses more
than the eight levels of the boolean stack. 9
The following example shows how the boolean stack is used to solve boolean logic.

STR
X0
STR
X1 ORSTR AND X4 Y0
OUT Output
10
STR
X2 AND X3
ANDSTR 11
X5 OR
12
STR X0 STR X1 STR X2 AND X3
1
2
3
STR X0 1
2
3
STR X1
STR X0
1
2
3
STR X2

STR X1
STR X0
1
2
3
X2 AND X3
STR X1
STR X0
13
4 4 4 4
5
6
5
6
5
6
5
6
14
7 7 7 7
8

ORSTR
8

AND X4
8

ORNOT X5
8
A
1 X1 or (X2 AND X3) 1 X4 AND {X1 or (X2 AND X3)} 1 NOT X5 OR X4 AND {X1 OR (X2 AND X3)}
2
3
STR X0 2
3
STR X0 2
3
STR X0 B
. . .
. . .

8 8 8
C
ANDSTR
1
2
3
XO AND (NOT X5 or X4) AND {X1 or (X2 AND X3)}
D
.
.

DL05 Micro PLC User Manual, 6th Edition, Rev. C 57


Chapter 5: Standard RLL - Boolean Instructions

Immediate Boolean
1 The DL05 Micro PLCs can usually complete an operation cycle in a matter of milliseconds.
However, in some applications you may not be able to wait a few milliseconds until the next
2 I/O update occurs. The DL05 PLCs offer Immediate input and outputs which are special
boolean instructions that allow reading directly from inputs and writing directly to outputs
during the program execution portion of the CPU cycle. You may recall that this is normally
3 done during the input or output update portion of the CPU cycle. The immediate
instructions take longer to execute because the program execution is interrupted while the
4 CPU reads or writes the I/O point. This function is not normally done until the read inputs
or the write outputs portion of the CPU cycle.
5 NOTE: Even though the immediate input instruction reads the most current status from the input
point, it only uses the results to solve that one instruction. It does not use the new status to update
6 the image register. Therefore, any regular instructions that follow will still use the image register
values. Any immediate instructions that follow will access the I/O again to update the status. The
immediate output instruction will write the status to the I/O and update the image register.
7
8
9
10
CPU Scan
11 The CPU reads the inputs from the local
base and stores the status in an input
Read Inputs image register.

12 X11 ... X2 X1 X0
OFF ... ON OFF OFF ON X0
Input Image Register
OFF
13 X1

Read Inputs from Specialty I/O

14
A Solve the Application Program
X0 Y0
Immediate instruction does not use the
input image register, but instead reads
the status from the module immediately.
I I/O Point X0 Changes

B ON X0
OFF
C Write Outputs
X1

D Write Outputs to Specialty I/O

Diagnostics

58 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Boolean Instructions 1
Store (STR)
DS5 Implied The Store instruction begins a new rung or an additional
Aaaa
2
HPP Used branch in a rung with a normally open contact. Status of
the contact will be the same state as the associated image 3
register point or memory location.
Store Not (STRN) 4
DS5 Implied The Store Not instruction begins a new rung or an Aaaa
HPP Used additional branch in a rung with a normally closed
contact. Status of the contact will be opposite the state of
5
the associated image register point or memory location.
6
Operand Data Type DL05 Range
....................................A aaa 7
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
0377
0777
8
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177 9
Counter C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP
In the following Store example, when input X1 is on, output Y2 will energize.
0777
10
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes
11
X1 Y2

OUT
$
STR
B
1
ENT
12
GX C ENT
OUT 2
13
14
In the following Store Not example, when input X1 is off output Y2 will energize.
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes
A
X1 Y2

OUT
SP
STRN
B
1
ENT
B
GX C ENT
OUT 2
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 59


Chapter 5: Standard RLL - Boolean Instructions

Store Bit-of-Word (STRB)


1 DS5 Implied The Store Bit-of-Word instruction begins a new rung or an
HPP Used additional branch in a rung with a normally open contact. Aaaa.bb
2 Status of the contact will be the same state as the bit referenced
in the associated memory location.
3 Store Not Bit-of-Word (STRNB)
DS5 Implied The Store Not Bit-of-Word instruction begins a new rung or Aaaa.bb
4 HPP Used an additional branch in a rung with a normally closed contact.
Status of the contact will be opposite the state of the bit
referenced in the associated memory location.
5 Operand Data Type DL05 Range
..................................... A aaa bb
6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B See memory map BCD, 0 to 15
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB See memory map BCD, 0 to 15
7 In the following Store Bit-of-Word example, when bit 12 of V-memory location V1400 is on,
output Y2 will energize.
8 DirectSOFT 5
DirectSOFT32

B1400.12
9 Y2

OUT

10
Handheld Programmer Keystrokes
11 STR SHFT B V 1 4 0 0

12 OUT
K 1

2 ENT
2 ENT

13 In the following Store Not Bit-of-Word example, when bit 12 of V-memory location V1400
is off, output Y2 will energize.
14
DirectSOFT 5
DirectSOFT32
A B1400.12 Y2

OUT

B
C Handheld Programmer Keystrokes

STRN SHFT B V 1 4 0 0
D K 1 2 ENT

OUT 2 ENT

510 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Or (OR)
DS5 Implied The Or instruction logically ors a normally open contact in 1
HPP Used parallel with another contact in a rung. The status of the
Aaaa
contact will be the same state as the associated image register
point or memory location.
2
Or Not (ORN) 3
DS5 Implied The Or Not instruction logically ors a normally closed
HPP Used contact in parallel with another contact in a rung. The status
of the contact will be opposite the state of the associated
Aaaa 4
image register point or memory location.
5
Operand Data Type DL05 Range
....................................A
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0377
6
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777 7
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0177
0177
8
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP 0777

In the following Or example, when input X1 or X2 is on, output Y5 will energize.


9
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes
10
X1 Y5

OUT
$
STR
B
1
ENT 11
Q C ENT
X2
GX
OR
F
2

ENT
12
OUT 5

13
In the following Or Not example, when input X1 is on or X2 is off, output Y5 will
energize. 14
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes A
X1 Y5 $ B ENT
OUT
R
STR
C
1

ENT
B
ORN 2
X2
GX
OUT
F
5
ENT C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 511


Chapter 5: Standard RLL - Boolean Instructions

1 Or Bit-of-Word (ORB)
DS5 Implied The Or Bit-of-Word instruction logically ors a normally
2 HPP Used open contact in parallel with another contact in a rung.
Status of the contact will be the same state as the bit
Aaaa.bb

referenced in the associated memory location.


3
Or Not Bit-of-Word (ORNB)
4 DS5 Implied
The Or Not Bit-of-Word instruction logically ors a
normally closed contact in parallel with another contact
HPP Used Aaaa.bb
in a rung. Status of the contact will be opposite the state
5 of the bit referenced in the associated memory location.

6 Operand Data Type DL05 Range


..................................... A aaa bb
7 V-memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B
PB
See memory map
See memory map
BCD, 0 to 15
BCD, 0 to 15

8 In the following Or Bit-of-Word example, when input X1 or bit 7 of V1400 is on, output Y7
will energize.
DirectSOFT 5
9 DirectSOFT32

X1 Y7

10 OUT

B1400.7

11 Handheld Programmer Keystrokes

STR 1 ENT

12 OR SHFT B V 1 4 0 0

K 7 ENT

13 OUT 7 ENT

14 In the following Or Bit-of-Word example, when input X1 is on or bit 7 of V1400 is off,


output Y7 will energize.
DirectSOFT 5
A DirectSOFT32

X1 Y7

B OUT

B1400.7

C Handheld Programmer Keystrokes

STR 1 ENT

D ORN SHFT

K
B

7 ENT
V 1 4 0 0

OUT 7 ENT

512 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

And (AND)
DS5 Implied The And instruction logically ands a normally open Aaaa
1
HPP Used contact in series with another contact in a rung. The
status of the contact will be the same state as the
associated image register point or memory location.
2
And Not (ANDN) 3
DS5 Implied
The And Not instruction logically ands a normally Aaaa
HPP Used
closed contact in series with another contact in a rung.
The status of the contact will be opposite the state of
4
the associated image register point or memory location.
5
Operand Data Type DL05 Range
....................................A
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
aaa
0377
6
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777 7
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
0177
0177
8
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP 0777
In the following And example, when input X1 and X2 are on output Y5 will energize.
9
10
DirectSOFT 5
Direct SOFT32

X1 X2 Y5
Handheld Programmer Keystrokes

$ B
11
ENT
STR 1
OUT
V
AND
C
2
ENT 12
GX F
OUT 5
ENT
13
In the following And Not example, when input X1 is on and X2 is off output Y5 will
energize.
14
DirectSOFT 5
A
Direct SOFT32 Handheld Programmer Keystrokes

X1 X2 Y5 $
STR
B
1
ENT
B
OUT
W
ANDN
C
2
ENT C
GX F ENT
OUT 5
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 513


Chapter 5: Standard RLL - Boolean Instructions

And Bit-of-Word (ANDB)


1 DS5 Implied The And Bit-of-Word instruction logically ands a
normally open contact in series with another contact in a Aaaa.bb
HPP Used
2 rung. The status of the contact will be the same state as
the bit referenced in the associated memory location.
3 And Not Bit-of-Word (ANDNB)
DS5 Implied
The And Not Bit-of-Word instruction logically ands a
4 HPP Used
normally closed contact in series with another contact in
a rung. The status of the contact will be opposite the state
Aaaa.bb

of the bit referenced in the associated memory location.


5
Operand Data Type DL05 Range
6 ..................................... A aaa bb
V-memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B See memory map BCD, 0 to 15
7 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB See memory map BCD, 0 to 15

In the following And Bit-of-Word example, when input X1 and bit 4 of V1400 is on output
8 Y5 will energize.
DirectSOFT 5

9 X1 B1400.4 Y5

OUT

10
11 Handheld Programmer Keystrokes

STR 1 ENT

12 AND SHFT

K
B

4 ENT
V 1 4 0 0

13 OUT 5 ENT

14 In the following And Not Bit-of-Word example, when input X1 is on and bit 4 of V1400 is
off output Y5 will energize.
A DirectSOFT 5

X1 B1400.4 Y5

B OUT

C Handheld Programmer Keystrokes

STR 1 ENT

D ANDN SHFT

K
B

4 ENT
V 1 4 0 0

OUT 5 ENT

514 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

And Store (AND STR)


DS5 Implied
The And Store instruction logically ands two OUT
1
HPP Used
branches of a rung in series. Both branches must
begin with the Store instruction. 1 2
2
Or Store (OR STR) 1
3
DS5 Implied The Or Store instruction logically ors two OUT
HPP Used branches of a rung in parallel. Both branches
must begin with the Store instruction.
4
2

5
In the following And Store example, the branch
consisting of contacts X2, X3, and X4 have been anded with the branch consisting of contact
X1.
6
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes
7
X1 X2 X3 Y5

OUT
$
STR
B
1
ENT 8
$ C
X4
V
STR
D
2
ENT
9
ENT
AND 3
Q
OR
E
4
ENT 10
L
ANDST
GX
ENT

F
11
ENT
OUT 5

12
In the following Or Store example, the branch consisting of X1 and X2 have been ored with
the branch consisting of X3 and X4. 13
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes

X1 X2 Y5 $ B ENT
14
STR 1
OUT

X3 X4
V
AND
C
2
ENT A
$ D

V
STR
E
3
ENT
B
ENT
AND 4
M
ORST
ENT C
GX F
OUT 5
ENT
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 515


Chapter 5: Standard RLL - Boolean Instructions

Out (OUT)
1 DS5 Used The Out instruction reflects the status of the rung (on/off ) and Aaaa
outputs the discrete (on/off ) state to the specified image OUT
HPP Used
2 register point or memory location.
Multiple Out instructions referencing the same discrete location should not be used since
3 only the last Out instruction in the program will control the physical output point. Instead,
use the next instruction, the Or Out.
4 Operand Data Type
....................................A
DL05 Range
aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377
5 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
6 In the following Out example, when input X1 is on, output Y2 and Y5 will energize.
DirectSOFT 5
7 Direct SOFT32

X1 Y2
Handheld Programmer Keystrokes

$ B ENT
STR 1

8 OUT

Y5
GX
OUT
C
2
ENT

GX F

9 OUT OUT 5
ENT

Or Out (OROUT)
10 DS5 Used
The Or Out instruction allows more than one rung of discrete
A aaa
HPP Used
logic to control a single output. Multiple Or Out instructions
11 referencing the same output coil may be used, since all
contacts controlling the output are logically ORed together. If
OR OUT

the status of any rung is on, the output will also be on.
12 Operand Data Type DL05 Range
....................................A aaa
13 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0177
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0177
14 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777

In the following example, when X1 or X4 is on, Y2 will energize.


A DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes

B X1 Y2

OR OUT
$
STR
B
1
ENT

O D F ENT ENT C ENT

C INST#
$
STR
3
E
5

4
ENT
2

X4 Y2
D OR OUT
O
INST#
D
3
F
5
ENT ENT C
2
ENT

516 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Out Bit-of-Word (OUTB)


DS5 Used The Out Bit-of-Word instruction reflects the status of the 1
HPP Used rung (on/off ) and outputs the discrete (on/off ) state to the
Aaaa.bb
specified bit in the referenced memory location. Multiple Out
Bit-of-Word instructions referencing the same bit of the same OUT 2
word generally should not be used since only the last Out
instruction in the program will control the status of the bit. 3
Operand Data Type DL05 Range 4
....................................A aaa bb
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB
See memory map
See memory map
BCD, 0 to 15
BCD, 0 to 15
5
In the following Out Bit-of-Word example, when input X1 is on, bit 3 of V1400 and bit 6 of 6
V1401 will turn on.
DirectSOFT 5 7
X1 B1400.3

OUT
8
B1401.6

OUT
9
Handheld Programmer Keystrokes

STR 1 ENT
10
OUT SHFT

K
B

3 ENT
V 1 4 0 0
11
OUT SHFT B V 1 4 0 1

K 6 ENT
12
The following Out Bit-of-Word example contains two Out Bit-of-Word instructions using
the same bit in the same memory word. The final state bit 3 of V1400 is ultimately controlled 13
by the last rung of logic referencing it. X1 will override the logic state controlled by X0. To
avoid this situation, multiple outputs using the same location must not be used in 14
programming.
location must not be used in programming.
X0
A
B1400.3

OUT

B
C
X1 B1400.3

OUT D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 517


Chapter 5: Standard RLL - Boolean Instructions

Not (NOT)
1 DS5 Used The Not instruction inverts the status of the rung at
HPP Used the point of the instruction.
2 In the following example when X1 is off, Y2 will energize. This is because the Not instruction
inverts the status of the rung at the Not instruction.
DirectSOFT 5
3 DirectSOFT32 Handheld Programmer Keystrokes

X1 Y2 $ B ENT
4 OUT
SHFT
STR
N O
1
T ENT
TMR INST# MLR

5 GX
OUT
C
2
ENT

6 NOTE: DirectSOFT Release 1.1i and later supports the use of the NOT instruction. The above example
rung is merely intended to show the visual representation of the NOT instruction. The rung cannot be
created or displayed in DirectSOFT versions earlier than 1.1i.
7
Positive Differential (PD)
8 DS5 Used
The Positive Differential instruction is typically
A aaa
known as a one shot. When the input logic
9 HPP Used
produces an off to on transition, the output will
energize for one CPU scan.
PD

10
Operand Data Type DL05 Range
11 ....................................A aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377

12 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
0377
0777

13 In the following example, every time X1 makes an off to on transition, C0 will energize for
one scan.

14
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
A X1 C0 $
STR
B
1
ENT
PD
B SHFT P
CV
SHFT D
3
A
0
ENT

C
D

518 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Store Positive Differential (STRPD)


DS5 Used The Store Positive Differential instruction begins a 1
HPP Used new rung or an additional branch in a rung with a
Aaaa
normally open contact. The contact closes for one
CPU scan when the state of the associated image
2
register point makes an Off-to-On transition.
Thereafter, the contact remains open until the next 3
Off-to-On transition (the symbol inside the contact
represents the transition). This function is sometimes
called a one-shot. This contact will also close on a
4
program-to-run transition if it is within a retentative
range and on before the PLC mode transition. 5
DS5 Used
HPP Used
Store Negative Differential (STRND) 6
The Store Negative Differential instruction begins a
new rung or an additional branch in a rung with a
normally closed contact. The contact closes for one Aaaa 7
CPU scan when the state of the associated image
register point makes an On-to-Off transition.
Thereafter, the contact remains open until the next
8
On-to-Off transition (the symbol inside the contact
represents the transition). 9
Operand Data Type
....................................A
DL05 Range
aaa
10
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0377
0377 11
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
0377
0177
12
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
In the following example, each time X1 is makes an Off-to-On transition, Y4 will energize for
0177
13
one scan.
DirectSOFT 5
14
DirectSOFT32 Handheld Programmer Keystrokes

X1 Y4

OUT
$

GX
STR
SHFT P
CV
D
3
B
1
ENT
A
E ENT
OUT 4

In the following example, each time X1 is makes an On-to-Off transition, Y4 will energize for
B
one scan.
DirectSOFT 5
C
DirectSOFT32 Handheld Programmer Keystrokes

X1

OUT
Y4
$

GX
STR
SHFT N

E
TMR
D
3
B
1
ENT
D
ENT
OUT 4

DL05 Micro PLC User Manual, 6th Edition, Rev. C 519


Chapter 5: Standard RLL - Boolean Instructions

Or Positive Differential (ORPD)


1 DS5 Implied The Or Positive Differential instruction logically ors a contact
HPP Used in parallel with another contact in a rung. The status of the
2 contact will be open until the associated image register point
makes an Off-to-On transition, closing it for one CPU scan.
Aaaa

Thereafter, it remains open until another Off-to-On


3 transition.
Or Negative Differential (ORND)
4 DS5 Implied The Or Negative Differential instruction logically ors a
contact in parallel with another contact in a rung. The status
5 HPP Used
of the contact will be open until the associated image register Aaaa
point makes an On-to-Off transition, closing it for one CPU
6 scan. Thereafter, it remains open until another On-to-Off
transition.
7 Operand Data Type DL05 Range
....................................A aaa
8 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0377
0377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
9 Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
10 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177

In the following example, Y 5 will energize whenever X1 is on, or for one CPU scan when X2
11 transitions from Off to On.

DirectSOFT 5
12 DirectSOFT32

X1 Y5
Handheld Programmer Keystrokes
$ B ENT
STR 1

13 OUT Q
OR
SHFT P
CV
D
3
C
2
ENT

X2 GX F
ENT
OUT 5
14
A In the following example, Y 5 will energize whenever X1 is on, or for one CPU scan when X2
transitions from On to Off.
B
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
C X1 Y5
$
STR
B
1
ENT

OUT Q N D C
D X2 GX
OR
SHFT

F
TMR

ENT
3 2
ENT

OUT 5

520 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

And Positive Differential (ANDPD)


DS5 Implied The And Positive Differential instruction logically ands a 1
HPP Used contact in series with another contact in a rung. The
status of the contact will be open until the associated
image register point makes an Off-to-On transition,
Aaaa 2
closing it for one CPU scan. Thereafter, it remains open
until another Off-to-On transition. 3
And Negative Differential (ANDND)
DS5 Implied
The And Negative Differential instruction logically ands
4
a contact in series with another contact in a rung. The
HPP Used
status of the contact will be open until the associated
Aaaa
5
image register point makes an On-to-Off transition,
closing it for one CPU scan. Thereafter, it remains open
until another On-to-Off transition.
6
Operand Data Type DL05 Range 7
....................................A aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0377
0377
8
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0377 9
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177 10
In the following example, Y5 will energize for one CPU scan whenever X1 is on and X2
transitions from Off to On. 11
DirectSOFT 5
DirectSOFT32

X1 X2 Y5
Handheld Programmer Keystrokes
$
STR
B
1
ENT
12
OUT Q P D C

GX
OR
SHFT

F
CV

ENT
3 2
ENT
13
OUT 5

14
In the following example, Y5 will energize for one CPU scan whenever X1 is on and X2
transitions from On to Off. A
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
B
X1 X2 Y5

OUT
$

Q
STR
B

N
1
ENT

D C
C
SHFT ENT
OR TMR 3 2
GX
OUT
F
5
ENT D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 521


Chapter 5: Standard RLL - Boolean Instructions

Set (SET)
1 DS5 Used The Set instruction sets or turns on an image register
Optional
memory range

HPP Used point/memory location or a consecutive range of image A aaa aaa


2 register points/memory locations. Once the
point/location is set it will remain on until it is reset
SET

using the Reset instruction. It is not necessary for the


3 input controlling the Set instruction to remain on.
Reset (RST)
4 The Reset instruction resets or turns off an image register
Optional
Memory. range
DS5 Used A aaa aaa
point/memory location or a range of image registers
5 HPP Used
points/memory locations. Once the point/location is RST
reset it is not necessary for the input to remain on.
6 Operand Data Type DL05 Range
....................................A aaa
7 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377
8 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0777
0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
9 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177
In the following example when X1 is on, Y2 through Y5 will energize.
10
11 DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes

12 X1
Y2
SET
Y5 $
STR
B
1
ENT

X C F ENT
SET 2 5
13
14
In the following example when X1 is on, Y2 through Y5 will be reset or deenergized.
A
DirectSOFT 5
B DirectSOFT32

X2
Handheld Programmer Keystrokes

$ B
Y2 Y5 ENT
STR 1

C RST
S
RST
C
2
F
5
ENT

522 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Boolean Instructions

Set Bit-of-Word (SETB)


DS5 Used
The Set Bit-of-Word instruction sets or turns on a bit in a 1
V-memory location. Once the bit is set it will remain on until it is Aaaa.bb
HPP Used
reset using the Reset Bit-of-Word instruction. It is not necessary
for the input controlling the Set Bit-of-Word instruction to
SET
2
remain on.
3
Reset Bit-of-Word (RSTB)
DS5 Used
The Reset Bit-of-Word instruction resets or turns off a bit in a
V-memory location. Once the bit is reset it is not necessary for the
A aaa.bb
RST
4
HPP Used
input to remain on.
Operand Data Type DL05 Range
5
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B
aaa
See memory map
bb
BCD, 0 to 15
6
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PB See memory map BCD, 0 to 15

In the following example when X1 turns on, bit 1 in V1400 is set to the on state.
7
DirectSOFT 5
DirectSOFT32 8
X1
B1400.1
SET 9
10
Handheld Programmer Keystrokes

STR 1 ENT 11
SET SHFT B V 1 4 0 0

K 1 ENT 12
In the following example when X2 turns on, bit 1 in V1400 is reset to the off state. 13
DirectSOFT 5
DirectSOFT32

X2
14
B1400.1
RST
A
Handheld Programmer Keystrokes
B
STR 2 ENT C
RST SHFT B V 1 4 0 0

K 1 ENT D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 523


Chapter 5: Standard RLL - Boolean Instructions

Pause (PAUSE)
1 DS5 Used The Pause instruction disables the output update on a
HPP Used range of outputs. The ladder program will continue to Y aaa aaa
2 run and update the image register. However, the outputs
in the range specified in the Pause instruction will be
PAUSE

turned off at the output points.


3
Operand Data Type DL05 Range
4 aaa
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377
5 In the following example, when X1 is ON, Y5-Y7 will be turned OFF. The execution of the
ladder program will not be affected.
6 DirectSOFT 5
DirectSOFT32

7 X1 Y5 Y7

PAUSE

8
9 Since the D2HPP Handheld Programmer does not have a specific Pause key, you can use
the corresponding instruction number for entry (#960), or type each letter of the command.
10 Handheld Programmer Keystrokes

11 $
STR
B
1
ENT

O J G A D F
12 INST# 9 6 0
ENT ENT
3 5
ENT

13 In some cases, you may want certain output points in the specified pause range to operate
normally. In that case, use Aux 58 to over-ride the Pause instruction.
14
A
B
C
D

524 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Comparative Boolean Instructions

Comparative Boolean 1
Store If Equal (STRE)
DS5 Used The Store If Equal instruction begins a new rung or 2
additional branch in a rung with a normally open V aaa B bbb
HPP Used
comparative contact. The contact will be on when 3
Vaaa is equal toBbbb .
Store If Not Equal (STRNE) 4
DS5 Used
The Store If Not Equal instruction begins a new rung V aaa B bbb
HPP Used or additional branch in a rung with a normally closed
comparative contact. The contact will be on when
5
Vaaa does not equal Bbbb.
Operand Data Type DL05 Range
6
....................................B aaa bbb
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 328) All (See page 328) 7
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 328) All (See page 328)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 09999 8
In the following example, when the value in V-memory location V2000 = 4933, Y3 will
energize. 9
DirectSOFT 5 10
DirectSOFT32 Handheld Programmer Keystrokes

V2000 K4933 Y3 $ SHFT E C A A A

OUT
STR
E
4
J
4

9
D
3
D
2

3
ENT
0 0 0
11
GX
OUT
D
3
ENT
12
In the following example, when the value in V-memory location V2000 is not equal to 5060,
Y3 will energize.
13
14
DirectSOFT 5 Handheld Programmer Keystrokes
DirectSOFT32

V2000 K5060 Y3

OUT
SP
STRN
SHFT E
4
C
2
A
0
A
0
A
0 A
F A G A ENT

GX
OUT
5
D
0

3
ENT
6 0
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 525


Chapter 5: Standard RLL - Comparative Boolean Instructions

Or If Equal (ORE)
1 DS5 Implied
The Or If Equal instruction connects a normally open
HPP Used
comparative contact in parallel with another contact. V aaa B bbb
2 The contact will be on when Vaaa is equal to Bbbb.
Or If Not Equal (ORNE)
3 DS5 Implied
The Or If Not Equal instruction connects a normally
HPP Used
closed comparative contact in parallel with another V aaa B bbb
4 contact. The contact will be on when Vaaa does not
equal Bbbb.

5 Operand Data Type DL05 Range


....................................B aaa bbb
6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
All (See page 328)
All (See page 328)
All (See page 328)
All (See page 328)

7 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 09999

In the following example, when the value in V-memory location V2000 = 4500 or
8 V2002 = 2345 , Y3 will energize.
DirectSOFT 5
9 DirectSOFT32 Handheld Programmer Keystrokes

$ E C A A A
V2000 K4500 Y3 SHFT
STR 4 2 0 0 0

10 OUT
E
4
F
5
A
0
A
0
ENT

V2002 K2345 Q SHFT E C A A C


OR 4 2 0 0 2

11 C
2
D
3
E
4
F
5
ENT

GX D ENT

12 OUT 3

In the following example, when the value in V-memory location V2000 = 3916 or
13 V2002 is not equal to 2500, Y3 will energize.

14 DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes

$ E C A A A

A V2000 K3916 Y3
OUT D
STR

3
SHFT

J
9
B
4

1
G
6
ENT
2 0 0 0

B V2002 K2500 R

C
ORN
SHFT

F
E

A
4
A
C

ENT
2
A
0
A
0
C
2

2 5 0 0

C GX
OUT
D
3
ENT

526 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Comparative Boolean Instructions

And If Equal (ANDE)


DS5 Implied The And If Equal instruction connects a normally V aaa B bbb
1
HPP Used open comparative contact in series with another
contact. The contact will be on when Vaaa is equal
to Bbbb.
2
And If Not Equal (ANDNE) V aaa B bbb 3
The And If Not Equal instruction connects a
DS5 Implied
HPP Used
normally closed comparative contact in series with
another contact. The contact will be on when
4
Vaaa does not equal Bbbb
Operand Data Type DL05 Range
5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 328) All (See page 328) 6
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All (See page 328) All (See page 328)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 09999 7
In the following example, when the value in V-memory location V2000 = 5000 and
V2002 = 2345, Y3 will energize. 8
DirectSOFT 5 Handheld Programmer Keystrokes
9
V2000 K5000 V2002 K2345 Y3
OUT
$

F
STR
SHFT

A
E

A
4
A
C
2

ENT
A
0
A
0
A
0 10
5 0 0 0
V

C
AND
SHFT

D
E

E
4
F
C
2
A
0
A
0
C
2 11
ENT
2 3 4 5
GX
OUT
D
3
ENT 12
In the following example, when the value in V-memory location V2000 = 2550 and V2002 13
does not equal 2345, Y3 will energize.

DirectSOFT 5 Handheld Programmer Keystrokes


14
V2000 K5000 V2002 K2345 Y3
OUT
$

F
STR
SHFT

A
E

A
4
A
C

ENT
2
A
0
A
0
A
0
A
5 0 0 0
V

C
AND
SHFT

D
E

E
4
F
C
2
A
0
A
0
C
2 B
ENT
2 3 4 5
GX
OUT
D
3
ENT C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 527


Chapter 5: Standard RLL - Comparative Boolean Instructions

Store (STR)
1 DS5 Used The Comparative Store instruction begins a new rung or A aaa B bbb

HPP Used additional branch in a rung with a normally open comparative


2 contact. The contact will be on when Aaaa is equal to or greater
than Bbbb.
3 Store Not (STRN) A aaa B bbb
DS5 Used The Comparative Store Not instruction begins a new rung or
4 HPP Used additional branch in a rung with a normally closed comparative
contact. The contact will be on when Aaaa is less than Bbbb.

5 Operand Data Type DL05 Range


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 328) All (See page 328)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p All (See page 328) All (See page 328)
7 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T

0177
09999

Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177
8
In the following example, when the value in V-memory location V2000 1000, Y3 will
9 energize.
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes

10 V2000 K1000 Y3
OUT
$
STR
SHFT V
AND
C
2
A
0
A
0
A
0
B A A A ENT
1 0 0 0
11 GX
OUT
D
3
ENT

12
13 In the following example, when the value in V-memory location V2000 < 4050, Y3 will
energize.
14
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
A V2000 K4050 Y3 SP
STRN
SHFT V
AND
C
2
A
0
A
0
A
0
OUT

B GX
E
4
A

D
0
F

ENT
5
A
0
ENT

OUT 3

C
D

528 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Comparative Boolean Instructions

Or (OR)
DS5 Implied The Comparative Or instruction connects a normally 1
open comparative contact in parallel with another A aaa B bbb
HPP Used
contact. The contact will be on when Aaaa is equal to
or greater than Bbbb.
2
Or Not (ORN) 3
DS5 Implied
The Comparative Or Not instruction connects a A aaa B bbb
HPP Used
normally open comparative contact in parallel with
another contact. The contact will be on when
4
Aaaa is less than Bbbb.
Operand Data Type DL05 Range
5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
All (See page 328)
bbb
All (See page 328)
6
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p All (See page 328) All (See page 328)
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 09999 7
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177
8
In the following example, when the value in V-memory location V2000 = 6045 or
V2002 2345, Y3 will energize. 9
DirectSOFT 5
DirectSOFT32

V2000 K6045 Y3
Handheld Programmer Keystrokes

$
STR
SHFT E
4
C
2
A
0
A
0
A
0
10
OUT

V2002 K2345
G

Q
6
A
0
E

SHFT
4
F

V
5
ENT

C A A C
11
OR AND 2 0 0 2
C

GX
2
D
3
E

D
4
F
5
ENT
12
ENT
OUT 3

13
In the following example when the value in V-memory location V2000 = 1000 or
V2002 < 2500, Y3 will energize.
14
A
DirectSOFT 5
Handheld Programmer Keystrokes
DirectSOFT32

V2000 K1000 Y3
$
STR
SHFT E
4
C
2
A
0
A
0
A
0
B
OUT B A A A ENT

V2002 K2500
R
ORN
1 0 0

SHFT V
AND
0
C
2
A
0
A
0
C
2
C
C F A A

GX
OUT
2 5
D
0

3
0

ENT
ENT
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 529


Chapter 5: Standard RLL - Comparative Boolean Instructions

And (AND)
1 DS5 Implied The Comparative And instruction connects a normally A aaa B bbb
HPP Used open comparative contact in series with another contact.
2 The contact will be on when Aaaa is equal to or greater
than Bbbb.
3 And Not (ANDN) A aaa B bbb
DS5 Implied
The Comparative And Not instruction connects a
4 HPP Used
normally open comparative contact in parallel with
another contact. The contact will be on when
Aaaa is less than Bbbb.
5 Operand Data Type DL05 Range
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
6 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 328) All (See page 328)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p All (See page 328) All (See page 328)
7 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T

0177
09999

8 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177

In the following example, when the value in V-memory location V2000 = 5000, and
9 V2002 2345, Y3 will energize.

DirectSOFT 5
10 DirectSOFT32

V2000 K5000 V2002 K2345 Y3


Handheld Programmer Keystrokes

$ SHFT E C A A A
STR 4 2 0 0 0
OUT

11 F

V
5
A
0
A
0
A

V
0
C
ENT

A A C
SHFT
AND AND 2 0 0 2

12 C
2
D
3
E
4
F
5
ENT

GX D ENT
OUT 3

13
14 In the following example, when the value in V-memory location V2000 = 7000 and
V2002 < 050, Y3 will energize.
A
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes

B V2000 K7000 V2002 K2500 Y3


$
STR
SHFT E
4
C
2
A
0
A
0
A
0
OUT H A A A ENT

C W
ANDN
7 0

SHFT
0
V
AND
0
C
2
A
0
A
0
C
2

D C

GX
2
F
5
A

D
0
A

ENT
0
ENT

OUT 3

530 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Immediate Instructions

Immediate Instructions 1
Store Immediate (STRI)
DS5 Used The Store Immediate instruction begins a new rung 2
HPP Used or additional branch in a rung. The status of the X aaa
contact will be the same as the status of the 3
associated input point at the time the instruction is
executed. The image register is not updated.
4
Store Not Immediate (STRNI)
DS5 Used The Store Not Immediate instruction begins a new
rung or additional branch in a rung. The status of X aaa
5
HPP Used
the contact will be opposite the status of the
associated input point at the time the instruction is 6
executed. The image register is not updated.
Operand Data Type DL05 Range 7
aaa
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377 8
In the following example when X1 is on, Y2 will energize.
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
9
$ I B
X1 Y2

OUT
GX
STR
SHFT

C
8

ENT
1
ENT
10
OUT 2

In the following example when X1 is off, Y2 will energize.


11
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
X1 Y2 SP
STRN
SHFT I
8
B
1
ENT
12
OUT
GX
OUT
C
2
ENT
13
Or Immediate (ORI) 14
The Or Immediate connects two contacts in parallel. The
DS5 Implied
HPP Used
status of the contact will be the same as the status of the
associated input point at the time the instruction is executed.
X aaa
A
The image register is not updated.
Or Not Immediate (ORNI)
B
DS5 Implied
The Or Not Immediate connects two contacts in parallel.
The status of the contact will be opposite the status of the X aaa C
HPP Used
associated input point at the time the instruction is executed.
The image register is not updated. D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 531


Chapter 5: Standard RLL - Immediate Instructions

OR Immediate Instructions (contd)


1 Operand Data Type DL05 Range
aaa
2 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377
In the following example, when X1 or X2 is on, Y5 will energize.
3 DirectSOFT
DirectSOFT32 5 Handheld Programmer Keystrokes
X1 Y5 $ B

4 OUT
Q
STR

OR
SHFT I
1

8
ENT

C
2
ENT
X2

5 GX
OUT
F
5
ENT

In the following example, when X1 is on or X2 is off, Y5 will energize.


6 DirectSOFT
DirectSOFT32
5 Handheld Programmer Keystrokes

X1 Y5 $ B

7 X2
OUT
R
ORN
STR

SHFT I
1

8
ENT

C
2
ENT

GX F

8 OUT 5
ENT

And Immediate (ANDI)


9 DS5 Implied
The And Immediate connects two contacts in series. The
status of the contact will be the same as the status of the X aaa
HPP Used
associated input point at the time the instruction is
10 executed. The image register is not updated.
And Not Immediate (ANDNI)
11 DS5 Implied The And Not Immediate connects two contacts in series. X aaa
The status of the contact will be opposite the status of the
12 HPP Used
associated input point at the time the instruction is
executed. The image register is not updated.
13 Operand Data Type DL05 Range
aaa
14 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377
In the following example, when X1 and X2 are on, Y5 will energize.
A DirectSOFT
DirectSOFT32 5 Handheld Programmer Keystrokes
X1 X2 Y5 $ B ENT
OUT STR 1

B V
AND
GX
SHFT I

F
8
C
2
ENT

ENT
OUT 5

C In the following example, when X1 is on and X2 is off, Y5 will energize.


DirectSOFT
DirectSOFT325 Handheld Programmer Keystrokes

D X1 X2 Y5

OUT
$
STR
B
1
ENT

W SHFT I C ENT
ANDN 8 2
GX F ENT
OUT 5

532 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Immediate Instructions

Out Immediate (OUTI)


DS5 Used The Out Immediate instruction reflects the status of the 1
HPP Used rung (on/off ) and outputs the discrete (on/off ) status to
the specified module output point and the image register
at the time the instruction is executed. If multiple Out Y aaa
2
Immediate instructions referencing the same discrete OUTI
point are used it is possible for the module output status 3
to change multiple times in a CPU scan. See Or Out
Immediate. 4
Or Out Immediate (OROUTI)
DS5 Used The Or Out Immediate instruction has been designed to 5
HPP Used use more than 1 rung of discrete logic to control a single
output. Multiple Or Out Immediate instructions
referencing the same output coil may be used, since all
Y aaa 6
OROUTI
contacts controlling the output are ored together. If the
status of any rung is on at the time the instruction is 7
executed, the output will also be on.

Operand Data Type DL05 Range


8
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
aaa
0377
9
In the following example, when X1 is on, output point Y2 on the output module will turn 10
on. For instruction entry on the Handheld Programmer, you can use the instruction number
(#350) as shown, or type each letter of the command.
DirectSOFT 5
11
DirectSOFT32 Handheld Programmer Keystrokes

X1 Y2 $
STR
B
1
ENT
12
OUTI
O
INST#
D
3
F
5
A
0
ENT ENT
13
C ENT
2
14
In the following example, when X1 or X4 is on, Y2 will energize.
DirectSOFT 5
DirectSOFT32 Handheld Programmer Keystrokes
A
$ B
X1 Y2

OR OUTI O
STR
D F
1
ENT

A ENT ENT
B
INST# 3 5 0

X4 Y2
C
2
ENT C
OR OUTI $ E ENT

O
STR

INST#
D
3
F
4

5
A
0
ENT ENT
D
C ENT
2

DL05 Micro PLC User Manual, 6th Edition, Rev. C


533
Chapter 5: Standard RLL - Immediate Instructions

Set Immediate (SETI)


1 DS5 Used
The Set Immediate instruction immediately sets, or
turns on an output or a range of outputs in the image
2 HPP Used
register and the corresponding output point(s) at the
time the instruction is executed. Once the outputs are
Y aaa
SETI
aaa

set it is not necessary for the input to remain on. The


3 Reset Immediate instruction can be used to reset the
outputs.
4 Reset Immediate (RSTI)
The Reset Immediate instruction immediately resets,
5 DS5
HPP
Used
Used
or turns off an output or a range of outputs in the
Y aaa aaa
image register and the output point(s) at the time the
RSTI
6 instruction is executed. Once the outputs are reset it is
not necessary for the input to remain on.
7 Operand Data Type DL05 Range
aaa
8 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377
In the following example, when X1 is on, Y2 through Y5 will be set on in the image register
9 and on the corresponding output points.

DirectSOFT 5
10 DirectSOFT32 Handheld Programmer Keystrokes

$ B ENT
X1 Y2 Y5
11 SETI X
STR

SHFT I
1
C F ENT
SET 8 2 5

12
13
In the following example, when X1 is on, Y5 through Y22 will be reset (off ) in the image
14 register and on the corresponding output module(s).

DirectSOFT 5
A DirectSOFT32
Handheld Programmer Keystrokes
X1 Y5 Y22

B RSTI
$

S
STR

SHFT
B

I
1
ENT

F C C ENT
RST 8 5 2 2

C
D

534 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Timer, Counter and Shift Register Instructions 1


Using Timers
Timers are used to time an event for a desired length of time. The single input timer will time 2
as long as the input is on. When the input changes from on to off the timer current value is
reset to 0. There is a tenth of a second and a hundredth of a second timer available with a 3
maximum time of 999.9 and 99.99 seconds respectively. There is a discrete bit associated with
each timer to indicate that the current value is equal to or greater than the preset value. The
timing diagram below shows the relationship between the timer input, associated discrete bit,
4
current value, and timer preset.
5
Seconds
X1
6
0 1 2 3 4 5 6 7 8 TMR T1
X1

Timer Preset
K30
7
T1
T1 Y0
OUT
8
Current 0 10 20 30 40 50 60 0
Value 1/10 Seconds
9
There are those applications that need an accumulating timer, meaning it has the ability to 10
time, stop, and then resume from where it previously stopped. The accumulating timer works
similarly to the regular timer, but two inputs are required. The start/stop input starts and
stops the timer. When the timer stops, the elapsed time is maintained. When the timer starts
11
again, the timing continues from the elapsed time. When the reset input is turned on, the
elapsed time is cleared and the timer will start at 0 when it is restarted. There is a tenth of a 12
second and a hundredth of a second timer available with a maximum time of 9999999.9 and
999999.99 seconds respectively. The timing diagram below shows the relationship between
the timer input, timer reset, associated discrete bit, current value, and timer preset.
13
14
Seconds
0 1 2 3 4 5 6 7 8 X1
TMRA
K30
T0 A
X1 Enable

X2 B
X2

T0
Reset Input
C
Current
Value
0 10 10 20
1/10 Seconds
30 40 50 0
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 535


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Timer (TMR) and Timer Fast (TMRF)


1 DS5 Used
The Timer instruction is a 0.1 second single input timer that
times to a maximum of 999.9 seconds. The Timer Fast TMR T aaa
HPP Used
2 instruction is a 0.01 second single input timer that times up
to a maximum of 99.99 seconds. These timers will be
B bbb

enabled if the input logic is true (on) and will be reset to 0 if Preset Timer#
3 the input logic is false (off ).
Instruction Specifications
4 Timer Reference (Taaa): Specifies the timer number. TMRF
B bbb
T aaa

Preset Value (Bbbb): Constant value (K) or a V-memory


5 location. Preset Timer#
Current Value: Timer current values (BCD) are accessed by
6 referencing the associated V or T memory location*. For The timer discrete status bit and the
example, the timer current value for T3 physically resides current value are not specified in the
7 in V-memory location V3 as a BCD value. timer instruction

Discrete Status Bit: The discrete status bit is referenced by


8 the associated T memory location. Operating as a timer
done bit, it will be on if the current value is equal to or
greater than the preset value. For example, the discrete
9 status bit for Timer 2 is TA2.
NOTE: Timer preset constants (K) may be changed by using a handheld programmer, even when the
10 CPU is in Run Mode. Therefore, a V-memory preset is required only if the ladder program must
change the preset.
11 Operand Data Type DL05 Range
12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B
Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T
aaa
0177
bbb

V-memory for preset values . . . . . . . . . . . . . . . V 12007377
13 Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P
74007577*
12007377
74007577
14 Constants (preset only) . . . . . . . . . . . . . . . . . . K
Timer discrete status bits . . . . . . . . . . . . . . . T/V

0177 or V4110041107
09999

Timer current values . . . . . . . . . . . . . . . . . V /T** 0177


A
NOTE: * May be non-volatile if MOV instruction is used.
B ** With the HPP, both the Timer discrete status bits and current value are accessed with the same
data reference. DirectSOFT 5 uses separate references, such as T2 for discrete status bit for Timer
T2, and TA2 for the current value of Timer T2.
C
You can perform functions when the timer reaches the specified preset using the discrete
D status bit. Or, use comparative contacts to perform functions at different time intervals, based
on one timer. The examples on the following page show these two methods of programming
timers.

536 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Timer Example Using Discrete Status Bits


In the following example, a single input timer is used with a preset of 3 seconds. The timer 1
discrete status bit (T2) will turn on when the timer has timed for 3 seconds. The timer is reset
when X1 turns off, turns off the discrete status bit and resets the timer current value to 0. 2
DirectSOFT 5 3
Direct SOFT32 Timing Diagram
X1 Seconds
TMR T2 0 1 2 3 4 5 6 7 8
K30

T2 Y0
X1
4
OUT
T2
5
Y0
Handheld Programmer Keystrokes
Current
$

N
STR
B

C
1
ENT

D A
Value 0 10 20 30 40 50 60 0
6
ENT
TMR 2 3 0
$

GX
STR
SHFT

A
T
MLR
C
2
ENT 7
ENT
OUT 0

8
Timer Example Using Comparative Contacts
In the following example, a single input timer is used with a preset of 4.5 seconds.
Comparative contacts are used to energize Y3, Y4, and Y5 at one second intervals respectively.
9
When X1 is turned off the timer will be reset to 0 and the comparative contacts will turn off
Y3, Y4, and Y5. 10
DirectSOFT
Direct SOFT32 5

X1
TMR T20
0 1 2 3
Timing Diagram
Seconds
4 5 6 7 8
11
K45

TA20 K10 Y3

OUT
X1

Y3
12
TA20 K20 Y4
OUT
Y4

Y5
13
TA20 K30 Y5
OUT
Current
T2

0 10 20 30 40 50 60 0
14
Value

Handheld Programmer Keystrokes

$ B ENT
A
STR 1
N

$
TMR

STR
C

SHFT
2
A

T
MLR
0
C
2
E

A
4

0
F
5
B
ENT

1
A
0
ENT
B
GX

$
OUT

STR
D

SHFT
3
ENT

T
MLR
C
2
A
0
C
2
A
0
ENT
C
GX E

$
OUT

STR
SHFT
4
ENT

T
MLR
C
2
A
0
D
3
A
0
ENT
D
GX F ENT
OUT 5

DL05 Micro PLC User Manual, 6th Edition, Rev. C 537


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Accumulating Timer (TMRA)


1 DS5 Used The Accumulating Timer is a 0.1 second two input timer that
Enable TMRA
B bbb
T aaa

HPP Used will time to a maximum of 9999999.9. Reset


2 Accumulating Fast Timer (TMRAF)
The Accumulating Fast Timer is a 0.01 second two-input Timer#
3 DS5
HPP
Used
Used timer that will time to a maximum of 99999.99. Each one uses
Preset

two timer registers in V-memory. These timers have two inputs,


4 an enable and a reset. The timer starts timing when the enable
is on and stops when the enable is off (without resetting the
Enable TMRAF T aaa
count). The reset will reset the timer when on and allow the
5 timer to time when off.
Reset
B bbb

Instruction Specifications
6 Timer Reference (Taaa): Specifies the timer number.
Preset Timer#
Preset Value (Bbbb): Constant value (K) or a V-memory
7 location.
Current Value: Timer current values (BCD) are accessed by The timer discrete status bit
8 referencing the associated V or T memory location*. For and the current value are not
specified in the timer
example, the timer current value for T3 resides in V-memory
instruction
9 location V3 as a BCD value.
Discrete Status Bit: The discrete status bit is accessed by referencing the associated T memory
10 location. Operating as a timer done bit, it will be on if the current value is equal to or
greater than the preset value. For example the discrete status bit for timer 2 would be T2.

11 NOTE: The accumulating type timer uses two consecutive V-memory locations for the 8-digit value,
and therefore two consecutive timer locations. For example, if TMR 1 is used, the next available timer
number is TMR 3.
12
Operand Data Type DL05 Range
13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0176
14 V-memory for preset values . . . . . . . . . . . . . . . V
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P


12007377/74007577*
12007377/74007577
Constants (preset only) . . . . . . . . . . . . . . . . . . K 099999999
A Timer discrete status bits . . . . . . . . . . . . . . . T/V 0176 or V4110041107
Timer current values . . . . . . . . . . . . . . . . . V /T** 0176
B NOTE: * May be non-volatile if MOV instruction is used.
** With the HPP, both the Timer discrete status bits and current value are accessed with the same
C data reference. DirectSOFT 5 uses separate references, such as T2 for discrete status bit for Timer
T2, and TA2 for the current value of Timer T2.
D The following examples show two methods of programming timers. One performs functions
when the timer reaches the preset value using the discrete status bit, or use comparative
contacts to perform functions at different time intervals.

538 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Accumulating Timer Example using Discrete Status Bits


In the following example, a two input timer (accumulating timer) is used with a preset of 3 1
seconds. The timer discrete status bit (T6) will turn on when the timer has timed for 3
seconds. Notice in this example that the timer times for 1 second, stops for one second, then
resumes timing. The timer will reset when C10 turns on, turning the discrete status bit off
2
and resetting the timer current value to 0.
DirectSOFT
Direct SOFT32 5 Timing Diagram
3
X1
TMRA T6

X1
0 1 2 3
Seconds
4 5 6 7 8
4
K30
C10
C10
5
Y7 T6
T6
OUT Current
Value
0 10 10 20 30 40 50 0
6
Handheld Programmer Keystrokes Handheld Programmer Keystrokes (cont)

$
STR
B
1
ENT D
3
A
0
ENT 7
$ SHFT C B A ENT $ SHFT T G ENT
STR 2 1 0 STR MLR 6
N
TMR
SHFT A
0
G
6
GX
OUT
B
1
A
0
ENT 8
Accumulator Timer Example Using Comparative Contacts
9
In the following example, a single input timer is used with a preset of 4.5 seconds.
Comparative contacts are used to energized Y3, Y4, and Y5 at one second intervals 10
respectively. The comparative contacts will turn off when the timer is reset.
Contacts
DirectSOFT
X1
Timing Diagram
11
Seconds
TMRA T20 0 1 2 3 4 5 6 7 8

C10
K45 X1 12
C10

TA20 K10 TA21 K0 Y3

OUT
Y3

Y4
13
TA21 K1

TA20 K20 TA21 K0 Y4


Y5

T20
14
OUT

TA21 K1
Current
Value
0 10 10 20

1/10 Seconds
30 40 50 0

A
TA20 K30 TA21 K1 Y5

OUT
B
Handheld Programmer Keystrokes Handheld Programmer Keystrokes (contd)

$
STR

STR
B

SHFT
1
ENT

C
2
B
1
A
0
ENT
$

V
STR

AND
SHFT
SHFT

E
4
T
MLR
C

SHFT
2
A

T
MLR
0
C
2
B
C
2

1
A
0
ENT

A
0
ENT
C
E

D
N A C A E F Q SHFT SHFT T C B B ENT
SHFT ENT 4
TMR 0 2 0 4 5 OR MLR 2 1 1
$ SHFT T C A B A ENT GX E ENT
STR MLR 2 0 1 0 OUT 4
V E T C B A $ T C A D A
SHFT SHFT ENT SHFT ENT
AND 4 MLR 2 1 0 STR MLR 2 0 3 0
Q E T C B B V E T C B B
SHFT SHFT ENT SHFT SHFT ENT
OR 4 MLR 2 1 1 AND 4 MLR 2 1 1
GX D ENT GX F ENT
OUT 3 OUT 5

DL05 Micro PLC User Manual, 6th Edition, Rev. C 539


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Using Counters
1 Counters are used to count events. The counters available are up counters, up/down counters,
and stage counters (used with RLLPLUS programming).
2 The up counter has two inputs, a count input and a reset input. The maximum count value is
9999. The timing diagram below shows the relationship between the counter input, counter
3 reset, associated discrete bit, current value, and counter preset.

X1
4 X1
Up
CNT
K3
CT1

X2
X2
5 CT1
Reset

6 Current
alue
1 2
Counts
3 4 0 Counter preset

7 The up down counter has three inputs, a count up input, count down input and reset input.
The maximum count value is 99999999. The timing diagram below shows the relationship
8 between the counter input, counter reset, associated discrete bit, current value, and counter
preset.
9
X1
UDC CT2
10 X1

X2
Up K3

X2

11 X3
X3
Down

CT2
12 Current
Value
1 2 1
Counts
2 3 0
Reset

Counter Preset
13 The stage counter has a count input and is reset by the RST instruction. This instruction is
useful when programming using the RLLPLUS structured programming. The maximum count
14 value is 9999. The timing diagram below shows the relationship between the counter input,
associated discrete bit, current value, counter preset and reset instruction.
A
B X1 X1
SGCNT CT2
K3

C CT2

Current 1 2 3 4 0
Value Counts Counter preset
D RST
CT2

540 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Counter (CNT)
DS5 Used
The Counter is a two input counter that increments Counter# 1
when the count input logic transitions from off to on.
HPP Used
When the counter reset input is on the counter resets
to 0. When the current value equals the preset value,
Count CNT
B bbb
CT aaa 2
the counter status bit comes on and the counter
continues to count up to a maximum count of 9999.
Reset 3
The maximum value will be held until the counter is
reset. Preset 4
Instruction Specifications The counter discrete status bit and the
Counter Reference (CTaaa): Specifies the counter current value are not specified in the
counter instruction.
5
number.
Preset Value (Bbbb): Constant value (K) or a 6
V-memory location as a BCD value.
Current Values: Counter current values are accessed by referencing the associated V or CT
memory locations*. The V-memory location is the counter location + 1000. For example, the
7
counter current value for CT3 resides in V-memory location V1003 as a BCD value.
Discrete Status Bit: The discrete status bit is accessed by referencing the associated CT
8
memory location. It will be on if the value is equal to or greater than the preset value. For
example the discrete status bit for counter 2 would be CT2. 9
NOTE: Counter preset constants (K) may be changed by using a programming device, even when the
CPU is in Run Mode. Therefore, a V-memory preset is required only if the ladder program must
10
change the preset.
11
Operand Data Type DL05 Range
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
aaa
0177
bbb

12
12007377
V-memory (preset only) . . . . . . . . . . . . . . . . . . V 74007577*
12007377
13
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P 74007577
Constants (preset only) . . . . . . . . . . . . . . . . . . K
Counter discrete status bits . . . . . . . . . . . . CT/V

0177 or V4114041147
09999 14
Counter current values . . . . . . . . . . . . . . V /CT** 0177
A
NOTE: * May be non-volatile if MOV instruction is used.
** With the HPP, both the Counter discrete status bits and current value are accessed with the same
data reference. DirectSOFT 5 uses separate references, such as CT2 for discrete status bit for
B
Counter CT2, and CTA2 for the current value of Counter CT2.
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 541


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Counter Example Using Discrete Status Bits


1 In the following example, when X1 makes an off to on transition, counter CT2 will
increment by one. When the current value reaches the preset value of 3, the counter status bit
2 CT2 will turn on and energize Y7. When the reset C10 turns on, the counter status bit will
turn off and the current value will be 0. The current value for counter CT2 will be held in
V-memory location V1002.
3 DirectSOFT 5
DirectSOFT32 Counting diagram

4 X1
CNT CT2
X1

5 C10
K3

C10

CT2 or

6 CT2 Y7

OUT
Y7
Current Value 1 2 3 4 0

7 Handheld Programmer Keystrokes

$
STR
B
1
ENT
Handheld Programmer Keystrokes (cont)

$
STR
SHFT C
2
SHFT T
MLR
C
2
ENT

8 $

GY
CNT
STR
SHFT

C
2
C
2
B

D
1

3
A

ENT
0
ENT GX
OUT
B
1
A
0
ENT

9 Counter Example Using Comparative Contacts


In the following example, when X1 makes an off to on transition, counter CT2 will
10 increment by one. Comparative contacts are used to energize Y3, Y4, and Y5 at different
counts. When the reset C10 turns on, the counter status bit will turn off and the counter
11 current value will be 0, and the comparative contacts will turn off.
DirectSOFT 5

12 DirectSOFT32

X1
CNT CT2
Counting diagram

X1

13 C10
K3

C10

CTA2 K1 Y3 Y3

14 OUT
Y4

CTA2 K2 Y4
Y5

A CTA2 K3
OUT

Y5
Current
Value
1 2 3 4 0

OUT

B Handheld Programmer Keystrokes Handheld Programmer Keystrokes (cont)

$ B ENT $ SHFT C SHFT T C


STR 1 STR 2 MLR 2

C $

GY
STR
SHFT

C
C
2
B

D
1
A
0
ENT

GX
C
2
ENT

E
ENT ENT
CNT 2 3 OUT 4

D $
STR
B
1
SHFT

ENT
C
2
SHFT T
MLR
C
2
$
STR
D
3
SHFT

ENT
C
2
SHFT T
MLR
C
2

GX D ENT GX F ENT
OUT 3 OUT 5

542 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Stage Counter (SGCNT)


DS5 Used
The Stage Counter is a single input counter that 1
increments when the input logic transitions from off to Counter#
HPP Used
on. This counter differs from other counters since it will
hold its current value until reset using the RST SGCNT CT aaa
2
instruction. The Stage Counter is designed for use in
RLLPLUS programs but can be used in relay ladder logic
B bbb
3
programs. When the current value equals the preset Preset
value, the counter status bit turns on and the counter
continues to count up to a maximum count of 9999. The counter discrete status bit and the
4
The maximum value will be held until the counter is current value are not specified in the
reset. counter instruction. 5
Instruction Specifications
Counter Reference (CTaaa): Specifies the counter number.
6
Preset Value (Bbbb): Constant value (K) or a V-memory location.
Current Values: Counter current values are accessed by referencing the associated V or CT
7
memory locations*. The V-memory location is the counter location + 1000. For example, the
counter current value for CT3 resides in V-memory location V1003. 8
Discrete Status Bit: The discrete status bit is accessed by referencing the associated CT
memory location. It will be on if the value is equal to or greater than the preset value. For 9
example the discrete status bit for counter 2 would be CT2.
Operand Data Type DL05 Range 10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177 11
V-memory (preset only) . . . . . . . . . . . . . . . . . . V 12007377
74007577*
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P 12007377
74007577
12
Constants (preset only) . . . . . . . . . . . . . . . . . . K
Counter discrete status bits . . . . . . . . . . . . CT/V

0177 or V4114041147
09999
13
Counter current values . . . . . . . . . . . . . . V /CT** 10001177

NOTE: * May be non-volatile if MOV instruction is used.


14
** With the HPP, both the Counter discrete status bits and current value are accessed with the same
data reference. DirectSOFT 5 uses separate references, such as CT2 for discrete status bit for A
Counter CT2, and CTA2 for the current value of Counter CT2.
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 543


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Stage Counter Example Using Discrete Status Bits


1 In the following example, when X1 makes an off to on transition, stage counter CT7 will
increment by one. When the current value reaches 3, the counter status bit CT7 will turn on
2 and energize Y7. The counter status bit CT7 will remain on until the counter is reset using
the RST instruction. When the counter is reset, the counter status bit will turn off and the
counter current value will be 0. The current value for counter CT7 will be held in V-memory
3 location V1007.

4 DirectSOFT 5
DirectSOFT32 Counting diagram
X1
SGCNT CT7

5 CT7
K3

Y7
X1

Y7
OUT Current 1 2 3 4 0

6 C5 CT7
RST
Value

RST
CT7

7 Handheld Programmer Keystrokes

$
STR
B
1
ENT
Handheld Programmer Keystrokes (cont)

GX
OUT
B
1
A
0
ENT

S G GY $ C F

8 SHFT

H
7
RST
SHFT

D
3
6

ENT
SHFT
CNT
S
RST
STR
SHFT

SHFT C
2

2
SHFT
5
ENT

T
MLR
H
7
ENT

$ SHFT C SHFT T H ENT

9 STR 2 MLR 7

Stage Counter Example Using Comparative Contacts


10 In the following example, when X1 makes an off to on transition, counter CT2 will
increment by one. Comparative contacts are used to energize Y3, Y4, and Y5 at different
11 counts. Although this is not shown in the example, when the counter is reset using the Reset
instruction, the counter status bit will turn off and the current value will be 0. The current
value for counter CT2 will be held in V-memory location V1002.
12 DirectSOFT 5
DirectSOFT32 Counting diagram

13 X1
SGCNT
K10
CT2

X1

CT2 K1 Y3

14 OUT
Y3

Y4
CT2 K2 Y4

A CT2 K3
OUT

Y5
Y5

Current
Value
1 2 3 4 0

OUT

B Handheld Programmer Keystrokes


RST
CT2

Handheld Programmer Keystrokes (cont)

$ B $ C T C

C SHFT
STR
S
RST
G
1

6
ENT

SHFT GY
CNT
STR
C
2
SHFT

ENT
2
SHFT
MLR 2

C B A ENT GX E ENT

D $
2

STR
SHFT
1
C
0

2
SHFT T
MLR
C
2
$
OUT

STR
SHFT
4
C
2
SHFT T
MLR
C
2
B ENT D ENT
1 3
GX D ENT GX F ENT
OUT 3 OUT 5

544 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Up Down Counter (UDC) 1


This Up/Down Counter counts up on each off to on
DS5 Used
transition of the Up input and counts down on each
HPP Used
off to on transition of the Down input. The counter Up UDC
B bbb
CT aaa 2
is reset to 0 when the Reset input is on. The count
range is 099999999. The count input not being
used must be off in order for the active count input
Down
Counter # 3
to function.
Instruction Specification
Reset
Preset
4
Counter Reference (CTaaa): Specifies the counter
number.
Caution: The UDC uses two
V-memory locations for the 8 digit
5
current value. This means that the
Preset Value (Bbbb): Constant value (K) or two
consecutive V-memory locations as a BCD value.
UDC uses two consecutive
counter locations. If UDC CT1 is
6
Current Values: Current count is a double word value used in the program, the next
accessed by referencing the associated V or CT available counter is CT3. 7
memory locations*. The V-memory location is the The counter discrete status bit and
counter location + 1000. For example, the counter
current value for CT5 resides in V-memory location
the current value are not specified 8
in the counter instruction
V1005 and V1006 as a BCD value.
Discrete Status Bit: The discrete status bit is accessed by
9
referencing the associated CT memory location.
Operating as a counter done bit it will be on if the 10
value is equal to or greater than the preset value. For
example the discrete status bit for counter 2 would be CT2. 11
Operand Data Type DL05 Range
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa bbb
12
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0176
V-memory (preset only) . . . . . . . . . . . . . . . . . . V 12007377
74007577*
13
12007377
Pointers (preset only) . . . . . . . . . . . . . . . . . . . . P
Constants (preset only) . . . . . . . . . . . . . . . . . . K


74007577
099999999
14
Counter discrete status bits . . . . . . . . . . . . CT/V 0176 or V4114041147
Counter current values . . . . . . . . . . . . . . V /CT** 0176 A
NOTE: * May be non-volatile if MOV instruction is used.
** With the HPP, both the Counter discrete status bits and current value are accessed with the same
B
data reference. DirectSOFT 5 uses separate references, such as CT2 for discrete status bit for
Counter CT2, and CTA2 for the current value of Counter CT2.
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 545


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Up / Down Counter Example Using Discrete Status Bits


1 In the following example if X2 and X3 are off ,when X1 toggles from off to on the counter
will increment by one. If X1 and X3 are off the counter will decrement by one when X2
2 toggles from off to on. When the count value reaches the preset value of 3, the counter status
bit will turn on. When the reset X3 turns on, the counter status bit will turn off and the
current value will be 0.
3
DirectSOFT
DirectSOFT32
5 Counting Diagram

4 X1
UDC
K3
CT2
X1
X2

5 X3
X2

X3

6 CT2 Y7
CT2

Current 1 2 1 2 3 0
OUT Value

7 Handheld Programmer Keystrokes

$ B
Handheld Programmer Keystrokes (cont)

D
ENT ENT
STR 1 3

8 $

$
STR
C

D
2
ENT

ENT
$

GX
STR
SHFT

B
C

A
2
SHFT

ENT
T
MLR
C
2
ENT

STR 3 OUT 1 0

9 SHFT U
ISG
D
3
C
2
C
2

10 Up / Down Counter Example Using Comparative Contacts


In the following example, when X1 makes an off to on transition, counter CT2 will
11 increment by one. Comparative contacts are used to energize Y3 and Y4 at different counts.
When the reset (X3) turns on, the counter status bit will turn off, the current value will be 0,
12 and the comparative contacts will turn off.
DirectSOFT 5
DirectSOFT32 Counting Diagram

13 X1

X2
UDC
V2000
CT2
X1

14
X2

X3
X3

A CTA2 K1 Y3
OUT
Y3

Y4
Y4

B
CTA2 K2 Current 1 2 3 4 0
Value
OUT

Handheld Programmer Keystrokes Handheld Programmer Keystrokes (cont)

C $

$
STR
B

C
1
ENT

ENT GX
B
1
ENT

D ENT
STR 2 OUT 3

D $
STR

SHFT U
ISG
D

D
3

3
ENT

C
2
C
2
$
STR
C
2
SHFT

ENT
C
2
SHFT T
MLR
C
2

SHFT V C A A A ENT GX E ENT


AND 2 0 0 0 OUT 4
$ SHFT C SHFT T C
STR 2 MLR 2

546 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Timer, Counter and Shift Register Instructions

Shift Register (SR)


DS5 Used
The Shift Register instruction shifts data through a
SR
1
predefined number of control relays. The control ranges DATA
HPP Used
in the shift register block must start at the beginning of
an 8 bit boundary use 8-bit blocks.
From A aaa 2
CLOCK
The Shift Register has three contacts.
To B bbb
3
Data determines the value (1 or 0) that will enter the
register RESET
Clock shifts the bits one position on each low to high
4
transition
Reset resets the Shift Register to all zeros. 5
With each off to on transition of the clock input, the bits which make up the shift register
block are shifted by one bit position and the status of the data input is placed into the starting 6
bit position in the shift register. The direction of the shift depends on the entry in the From
and To fields. From C0 to C17 would define a block of sixteen bits to be shifted from left to
right. From C17 to C0 would define a block of sixteen bits, to be shifted from right to left.
7
The maximum size of the shift register block depends on the number of available control
relays. The minimum block size is 8 control relays. 8
Operand Data Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/B aaa
DL05 Range
bbb
9
Control Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777 0777
10
DirectSOFT
Direct SOFT325 Handheld Programmer Keystrokes

X1
Data Input SR
$
STR
B
1
ENT 11
$ C ENT

X2
Clock Input
From C0
$
STR

STR
D
2

3
ENT
12
X3
Reset Input
To C17 SHFT S

B
RST
SHFT

H
R
ORN
SHFT A
0 13
ENT
1 7

Inputs on Successive Scans Shift Register Bits


14
1 0-1-0 0
C0 C17 A
0
0
0-1-0
0-1-0
0
0
B
1 0-1-0 0 C
0 0-1-0 0
0 0 1 D
Indicates Indicates
ON OFF

DL05 Micro PLC User Manual, 6th Edition, Rev. C 547


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

1 Accumulator/Stack Load and Output Data Instructions


Using the Accumulator
2 The accumulator in the DL05 internal CPUs is a 32 bit register which is used as a temporary
storage location for data that is being copied or manipulated in some manor. For example,
3 you have to use the accumulator to perform math operations such as add, subtract, multiply,
etc. Since there are 32 bits, you can use up to an 8-digit BCD number. The accumulator is
4 reset to 0 at the end of every CPU scan.
Copying Data to the Accumulator
5 The Load and Out instructions and their variations are used to copy data from a V-memory
location to the accumulator, or, to copy data from the accumulator to V-memory. The
following example copies data from V-memory location V2000 to V-memory location
6 V2010.
V2000

7 X1 LD
V2000
8 9 3 5

Unused accumulator bits


8 Copy data from V2000 to the
lower 16 bits of the accumu-
lator
are set to zero

Acc. 0 0 0 0 88 99 33 55

9
OUT

10 V2010

Copy data from the lower 16 bits


8 9 3

V2010
5

of the accumulator to V2010

11 Since the accumulator is 32 bits and V-memory locations are 16 bits the Load Double and
Out Double (or variations thereof ) use two consecutive V-memory locations or 8 digit BCD
12 constants to copy data either to the accumulator from a V-memory address or from a
V-memory address to the accumulator. For example if you wanted to copy data from V2000
and V2001 to V2010 and V2011 the most efficient way to perform this function would be as
13 follows:

14 X1
LDD
V2000 6
V2001
7 3 9 5
V2000
0 2 6

A Copy data from V2000 and


V2001 to the accumulator

Acc. 6 7 3 9 55 00 22 66
B
OUTD
C V2010 6 7 3 9 5 0 2 6
Copy data from the accumulator to
V2010 and V2011 V2011 V2010
D

548 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Changing the Accumulator Data


Instructions that manipulate data also use the accumulator. The result of the manipulated 1
data resides in the accumulator. The data that was being manipulated is cleared from the
accumulator. The following example loads the constant value 4935 into the accumulator,
shifts the data right 4 bits, and outputs the result to V2010.
2
3
X1 LD
K4935
Constant 4 9 3 5
4
Load the value 4935 into the
accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0
8
1
7
0
6 5
0 1
4 3
1 0
2
1
1
0
0
1
5
The upper 16 bits of the accumulator
will be set to 0

Shifted out of
accumulator
6
SHFR 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
7
K4 Acc. 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1

Shift the data in the accumulator


4 bits (K4) to the right
8
OUT
V2010
9
0 4 9 3
Output the lower 16 bits of the ac-
cumulator to V2010 V2010 10
11
Some of the data manipulation instructions use 32 bits. They use two consecutive V-memory
locations or an 8 digit BCD constant to manipulate data in the accumulator. 12
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is added
with the value in V2006 and V2007 using the Add Double instruction. The value in the
13
accumulator is copied to V2010 and V2011 using the Out Double instruction.
V2001 V2000
14
X1 6 7 3 9 5 0 2 6
LDD
V2000

Load the value in V2000 and


A
V2001 into the accumulator

ADDD
V2006
+ 2
6 7
0
3
0
9
0
5
4
0
0
2
4
6
6
(Accumulator)

(V2006&V2007)
B
Acc. 8 7 3 9 9 0 7 2
Add the value in the
accumulator with the value
in V2006 and V2007 C
OUTD
V2010

Copy the value in the


8 7 3

V2011
9 9 0

V2010
7 2
D
accumulator to V2010 and
V2011

DL05 Micro PLC User Manual, 6th Edition, Rev. C 549


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Using the Accumulator Stack


1 The accumulator stack is used for instructions that require more than one parameter to
execute a function or for user defined functionality. The accumulator stack is used when more
2 than one Load instruction is executed without the use of an Out instruction. The first load
instruction in the scan places a value into the accumulator. Every Load instruction thereafter
without the use of an Out instruction places a value into the accumulator and the value that
3 was in the accumulator is placed onto the accumulator stack. The Out instruction nullifies
the previous load instruction and does not place the value that was in the accumulator onto
4 the accumulator stack when the next load instruction is executed. Every time a value is placed
onto the accumulator stack the other values in the stack are pushed down one location. The
accumulator is eight levels deep (eight 32 bit registers). If there is a value in the eighth
5 location when a new value is placed onto the stack, the value in the eighth location is pushed
off the stack and cannot be recovered.
6
X1 LD Constant 3 2 4 5

7 K3245

Load the value 3245 into the


accumulator
Current Acc. value

Acc. 0 0 0 0 3 2 4 5
Level 1 X
Accumulator Stack

X X X X X X X
Previous Acc. value X X X X X X X

8 Acc. X X X X X
X X X X
Level 2
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Level 5 X X X X X X X X

9 LD
Constant 5 1 5 1
Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X

K5151 Level 8 X X X X X X X X
Current Acc. value

10 Load the value 5151 into the


accumulator, pushing the value
3245 onto the stack
Acc. 0 0 0

Previous Acc. value


0 55 1 5 1
Accumulator Stack
Bucket

Acc. 0 0 0 0 33 22 44 55 Level 1 0 0 0 0 3 2 4 5

11 Level 2
Level 3
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Level 4 X X X X X X X X

12 Level 5
Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Constant 6 3 6 3
LD
Level 8 X X X X X X X X

13 K6363

Load the value 6363 into the


Current Acc. value

Acc. 0 0 0 0 66 33 66 33
Bucket
accumulator, pushing the value Previous Acc. value Accumulator Stack

14 5151 to the 1st stack location


and the value 3245 to the
2nd stack location
Acc. 0 0 0 0 55 1 5 1 Level 1
Level 2
0
0
0
X
0
0
0
X
0 0 5
0 0 3 2 4 5
0 0
X X X X X X
1 5 1

Level 3

A Level 4
Level 5
Level 6
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Level 7 X X X X X X X X

B Level 8 X X X X X X X X

Bucket

C
The POP instruction rotates values upward through the stack into the accumulator. When a
D POP is executed the value which was in the accumulator is cleared and the value that was on
top of the stack is in the accumulator. The values in the stack are shifted up one position in
the stack.

550 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

X1 POP Previous Acc. value


1
Acc. X X X X XX XX XX X

POP the 1st value on the stack into the


accumulator and move stack values
up one location
Current Acc. value

Acc. 0 0 0 0 44 55 4 5 Level 1 0
Accumulator Stack

0 0 0 3 7 9 2
2
Level 2 0 0 0 0 7 9 3 0
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
3
Level 5 X X X X X X X X
OUT
V2000

Copy data from the accumulator to


V2000 4 5 4 5 Level 6
Level 7
Level 8
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
4
V2000

POP Previous Acc. value


5
Acc. 0 0 0 0 44 55 44 55

POP the 1st value on the stack into the


accumulator and move stack values
up one location
Current Acc. value

Acc. 0 0 0 0 33 77 99 22 Level 1 0
Accumulator Stack

0 0 0 7 9 3 0
6
Level 2 X X X X X X X X
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X 7
Level 5 X X X X X X X X
OUT
V2001

Copy data from the accumulator to


V2001 3 7 9 2 Level 6
Level 7
Level 8
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
8
V2001.

POP
Previous Acc. value

Acc. 0 0 0 0 33 47 69 02
9
Accumulator Stack
POP the 1st value on the stack into the
accumulator and move stack values
up one location
Current Acc. value

Acc. X X X X 77 99 33 00 Level 1
Level 2
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
10
Level 3 X X X X X X X X
Level 4
Level 5
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
11
OUT V2002 7 9 3 0 Level 6 X X X X X X X X
V2002

Copy data from the accumulator to


V2002
Level 7
Level 8
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
12
13
Using Pointers
Many of the DL05 series instructions will allow V-memory pointers as a operand (commonly 14
known as indirect addressing). Pointers allow instructions to obtain data from V-memory
locations referenced by the pointer value. A
NOTE: DL05 V-memory addressing is in octal. However, the pointers reference a V-memory location
with values viewed as HEX. Use the Load Address (LDA) instruction to move an address into the B
pointer location. This instruction performs the Octal to Hexadecimal conversion automatically.

In the following simple example we are using a pointer operand in a Load instruction. C
V-memory location 2000 is being used as the pointer location. V2000 contains the value 440
which the CPU views as the Hex equivalent of the Octal address V-memory location V2100.
The CPU will copy the data from V2100 which in this example contains the value 2635 into
D
the lower word of the accumulator.

DL05 Micro PLC User Manual, 6th Edition, Rev. C 551


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

1
X1 V2076 X X X X
LD
V2077 X X X X
P2000
2 V2000 (P2000) contains the value 440
V2100 2 6 3 5
V2101 X X X X
HEX. 440 HEX. = 2100 Octal which
contains the value 2635. V2102 X X X X
3 V2000 V2103 X X X X
Accumulator
0 4 4 0 V2104 X X X X
2 6 3 5
V2105 X X X X
4 OUT
V2200

5 Copy the data from the lower 16 bits of


the accumulator to V2200. V2200 2 6 3 5
V2201 X X X X

6
7 The following example is identical to the one above with one exception. The LDA (Load
Address) instruction automatically converts the Octal address to Hex.
8
9
10 X1 LDA
O 2100
Load the lower 16 bits of the
accumulator with Hexadecimal
equivalent to Octal 2100 (440) 2 1 0 0

2100 Octal is converted to Hexadecimal

11 Unused accumulator bits


are set to zero
440 and loaded into the accumulator

Acc. 0 0 0 0 00 44 44 00

12 OUT Copy the data from the lower 16 bits of


the accumulator to V2000 0 4 4 0
V 2000

13 V2000

14 V2076
V2077
X
X
X
X
X
X
X
X

V2000 (P2000) contains the value 440 V2100 2 6 3 5

A LD
P 2000
Hex. 440 Hex. = 2100 Octal which
contains the value 2635
V2101
V2102
X
X
X
X
X
X
X
X
V2100 V2103 X X X X

B 0 4 4 0 V2104
V2105
X
X
X
X
X
X
X
X 0 0
Accumulator
0 0 22 66 33 55

C OUT
V 2200
Copy the data from the lower 16 bits of
the accumulator to V2200 V2200 2 6 3 5
V2201 X X X X

552 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Load (LD)
DS5 Used
The Load instruction is a 16 bit instruction that loads the
LD
1
HPP Used
value (Aaaa), which is either a V-memory location or a 4
A aaa
digit constant, into the lower 16 bits of the accumulator.
The upper 16 bits of the accumulator are set to 0.
2
Operand Data Type DL05 Range 3
....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map
See memory map
4
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFF

Discrete Bit Flags Description


5
SP53 On when the pointer is outside of the available range.
SP70 On anytime the value in the accumulator is negative. 6
SP76 On when the value loaded into the accumulator is zero.
7
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
8
In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator and output to V2010.
DirectSOFT 5
9
Direct SOFT32
V2000
X1 LD
V2000
8 9 3 5 10
Load the value in V2000 into
the lower 16 bits of the
accumulator
The unused accumulator
bits are set to zero 11
Acc. 0 0 0 0 88 99 33 55

OUT
V2010
12
Copy the value in the lower
16 bits of the accumulator to
V2010
8 9 3
V2010
5
13
Handheld Programmer Keystrokes 14
$ B X
STR 1 SET

SHFT L
ANDST
D
3
A
C
2
A
0
A
0
A
0
ENT
B
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 553


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Load Double (LDD)


1 DS5 Used
The Load Double instruction is a 32 bit instruction that loads LDD
the value (Aaaa), which is either two consecutive V-memory A aaa
HPP Used
2 locations or an 8 digit constant value, into the accumulator.
Operand Data Type DL05 Range
3 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
4 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map
0FFFF

5 Discrete Bit Flags Description


SP53 On when the pointer is outside of the available range.

6 SP70
SP76
On anytime the value in the accumulator is negative.
On when the value loaded into the accumulator by any instruction is zero.

7 NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
8 In the following example, when X1 is on, the 32 bit value in V2000 and V2001 will be
loaded into the accumulator and output to V2010 and V2011.
9 DirectSOFT 5
Direct SOFT32

10 X1 LDD
V2000 6
V2001
7 3 9 5
V2000
0 2 6

Load the value in V2000 and

11 V2001 into the 32 bit


accumulator
Acc. 6 7 3 9 65 00 22 66

12
6 7 3 9 5 0 2 6

13 OUTD
V2010 V2011 V2010

Copy the value in the 32 bit

14 accumulator to V2010 and


V2011

Handheld Programmer Keystrokes

A $
STR
B
1
ENT

L D D

B C
SHFT
ANDST
A A
3
A
3

ENT
2 0 0 0

C GX
OUT
SHFT D
3
C A B A ENT
2 0 1 0
D

554 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Load Formatted (LDF)


DS5 Used
The Load Formatted instruction loads 132 1
consecutive bits from discrete memory locations into LDF A aaa
HPP Used
the accumulator. The instruction requires a starting
location (Aaaa) and the number of bits (Kbbb) to be
K bbb 2
loaded. Unused accumulator bit locations are set to
zero. 3
Operand Data Type DL05 Range
....................................A aaa bbb
4
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X 0377
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y 0377 5
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
Stage Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Timer Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
S
T
0377
0177


6
Counter Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT 0177
Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . SP 0777 7
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 132

Discrete Bit Flags Description 8


SP70 On anytime the value in the accumulator is negative.
SP76 On when the value loaded into the accumulator by any instruction is zero. 9
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
10
In the following example, when C0 is on, the binary pattern of C10C16 (7 bits) will be 11
loaded into the accumulator using the Load Formatted instruction. The lower 7 bits of the
accumulator are output to Y0Y6 using the Out Formatted instruction.
DirectSOFT 5
Direct SOFT32
12
C0 Location Constant
LDF
K7

Load the status of 7


C10
C10 K7
C16 C15 C14 C13 C12 C11 C10
OFF OFF OFF ON ON ON OFF 13
consecutive bits (C10C16) The unused accumulator bits are set to zero
into the accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 1
2
1
1
1
0
0
14
OUTF
K7
Y0
A
Location Constant Y6 Y5 Y4 Y3 Y2 Y1 Y0
Copy the value from the

Handheld Programmer Keystrokes


specified number of bits in
the accumulator to Y0 Y6
Y0 K7 OFF OFF OFF ON ON ON OFF

B
$ SHFT C A ENT

SHFT
STR
L
ANDST
D
3
F
2

5
0

C
SHFT C B A H ENT
2 1 0 7
GX

A
OUT
SHFT F

H
5 D
ENT
0 7

DL05 Micro PLC User Manual, 6th Edition, Rev. C 555


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Load Address (LDA)


1 DS5 Used
The Load Address instruction is a 16 bit instruction. It
converts any octal value or address to the HEX equivalent LDA
HPP Used
2 value and loads the HEX value into the accumulator. This
instruction is useful when an address parameter is required
O aaa

since all addresses for the DL05 system are in octal.


3
Operand Data Type DL05 Range
4 Octal Address . . . . . . . . . . . . . . . . . . . . . . . . . . O
aaa
See memory map

5 Discrete Bit Flags Description


SP70 On anytime the value in the accumulator is negative.
6 SP76 On when the value loaded into the accumulator by any instruction is zero.

NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
7 accumulator stack.

In the following example when X1 is on, the octal number 40400 will be converted to a HEX
8 4100 and loaded into the accumulator using the Load Address instruction. The value in the
lower 16 bits of the accumulator is copied to V2000 using the Out instruction.
9
DirectSOFT 5

10 Direct SOFT32
X1 LDA Octal Hexadecimal
O 40400 4 0 4 0 0 4 1 0 0

11 Load The HEX equivalent to


the octal number into the The unused accumulator
lower 16 bits of the bits are set to zero

12 accumulator
Acc. 0 0 0 0 4 1 0 0

13 4 1 0 0
OUT

14 V2000 V2000

Copy the value in lower 16


bits of the accumulator to
A V2000

Handheld Programmer Keystrokes


B $
STR
B
1
ENT

C SHFT L
ANDST
D
3
A
0
E A E A A ENT
4 0 4 0 0
D GX
OUT
SHFT V
AND
C
2
A
0
A
0
A
0
ENT

556 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Out (OUT)
DS5 Used
The Out instruction is a 16 bit instruction that copies the OUT 1
HPP Used
value in the lower 16 bits of the accumulator to a specified A aaa
V-memory location (Aaaa). 2
Operand Data Type DL05 Range
....................................A aaa 3
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
4
Discrete Bit Flags Description
SP53 On when the pointer is outside of the available range. 5
In the following example, when X1 is on, the value in V2000 will be loaded into the lower 16
bits of the accumulator using the Load instruction. The value in the lower 16 bits of the 6
accumulator are copied to V2010 using the Out instruction.V2000
DirectSOFT
Direct SOFT32 5
X1 LD V2000
Handheld Programmer Keystrokes

$ B ENT
7
8 9 3 5 STR 1
V2000

Load the value in V2000 into


the lower 16 bits of the
accumulator
The unused accumulator
bits are set to zero
SHFT

C
L
ANDST
A
D

A
3
A ENT
8
2 0 0 0
Acc. 0 0 0 0 88 99 33 55
OUT
V2010
GX
OUT
SHFT V
AND
C
2
A
0
B
1
A
0
ENT
9
Copy the value in the lower
16 bits of the accumulator to 8 9 3 5

Out Double (OUTD)


V2010 V2010
10
DS5 Used
The Out Double instruction is a 32 bit instruction that
copies the value in the accumulator to two consecutive V
OUTD 11
HPP Used A aaa
memory locations at a specified starting location (Aaaa).
12
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 428)
aaa 13
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V-memory (See page 428)
14
Discrete Bit Flags Description
SP53 On when the pointer is outside of the available range.
A
In the following example, when X1 is on, the 32 bit value in V2000 and V2001 will be
loaded into the accumulator using the Load Double instruction. The value in the
accumulator is output to V2010 and V2011 using the Out Double instruction.
B
DirectSOFT 5
Direct SOFT32

X1 LDD
6
V2001
7 3 9 5
V2000
0 2 6
Handheld Programmer Keystrokes

$
STR
B
1
ENT
C
V2000
L D D
Load the value in V2000 and
V2001 into the accumulator Acc. 6 7 3 9 55 00 22 66
C
SHFT

2
ANDST
A
0
A
3

0
A
3

0
ENT
D
OUTD
GX SHFT D
V2010 OUT 3
Copy the value in the 6 7 3 9 5 0 2 6 C A B A ENT
accumulator to V2010 and V2011 V2010 2 0 1 0
V2011

DL05 Micro PLC User Manual, 6th Edition, Rev. C 557


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Out Formatted (OUTF)


1 DS5 Used The Out Formatted instruction outputs 132 bits from the
OUTF A aaa
HPP Used accumulator to the specified discrete memory locations. The
2 instruction requires a starting location (Aaaa) for the
destination and the number of bits (Kbbb) to be output.
K bbb

3 Operand Data Type DL05 Range


....................................A aaa bbb
4 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0377
0377


Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
5 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 132

In the following example, when C0 is on, the binary pattern of C10C16 (7 bits) will be
6 loaded into the accumulator using the Load Formatted instruction. The lower 7 bits of the
accumulator are output to Y0Y6 using the Out Formatted instruction.
7 DirectSOFT 5
Location Constant

8 C0 LDF
K7

Load the status of 7


C10
C10 K7
C16 C15 C14 C13 C12 C11 C10
OFF OFF OFF ON ON ON OFF

consecutive bits (C10C16) The unused accumulator bits are set to zero

9 into the accumulator


31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 1
2
1
1
1
0
0
OUTF Y20
Accumulator

10 K7

Copy the value of the


specified number of bits
from the accumulator to
Y20Y26 Location Constant Y26 Y25 Y24 Y23 Y22 Y21 Y20

11 Handheld Programmer Keystrokes


Y0 K7 OFF OFF OFF ON ON ON OFF

$ SHFT C A ENT

12 STR

SHFT L
ANDST
D
3
F
2

5
0

SHFT C B A H ENT
2 1 0 7

13 GX
OUT
SHFT F
5
A H ENT
0 7

14
A POP
The POP instruction moves the value from the first level of the
B DS5
HPP
Used
Used
accumulator stack (32 bits) to the accumulator and shifts each POP
value in the stack up one level.
C
D Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.

558 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Accumulator/Stack Load and Output Data Instructions

Pop Instruction (contd)


In the example below, when C0 is on, the value 4545 that was on top of the stack is moved 1
into the accumulator using the Pop instruction The value is output to V2000 using the Out
instruction. The next Pop moves the value 3792 into the accumulator and outputs the value
to V2001. The last Pop moves the value 7930 into the accumulator and outputs the value to
2
V2002. Please note if the value in the stack were greater than 16 bits (4 digits) the Out
Double instruction would be used and two V-memory locations for each Out Double must 3
be allocated.
DirectSOFT
Direct SOFT32 5
Previous Acc. value
4
C0 POP
Acc. X X X X XX XX XX XX

Pop the 1st. value on the stack into the


Current Acc. value

Acc. 0 0 0 0 44 55 44 55 Level 1 0
Accumulator Stack

0 0 0 3 7 9 2
5
accumulator and move stack values
up one location Level 2 0
0 0
0 0 0 7 9 3 0

OUT
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
6
V2000 Level 5 X X X X X X X X

Copy the value in the lower 16 bits of


the accumulator to V2000
V2000 4 5 4 5 Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
7
Level 8 X X X X X X X X

POP
Previous Acc. value
8
Acc. 0 0 0 0 44 55 44 55
Pop the 1st. value on the stack into the
accumulator and move stack values
up one location
Current Acc. value

Acc. 0 0 0 0 3 7 9 2 Level 1 0
Accumulator Stack

0 0 0 7 9 3 0
9
Level 2 X X X X X X X X
OUT
V2001
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
10
Copy the value in the lower 16 bits of Level 5 X X X X X X X X
the accumulator to V2001 V2001 3 7 9 2 Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
11
POP Level 8 X X X X X X X X

Pop the 1st. value on the stack into the Previous Acc. value
12
accumulator and move stack values
Acc. 0 0 0 0 3 7 9 2
up one location

OUT
Current Acc. value

Acc. 0 0 0 0 7 9 3 0 Level 1 X
Accumulator Stack

X X X X X X X
13
V2002 Level 2 X X X X X X X X

Copy the value in the lower 16 bits of


the accumulator to V2002
Level 3
Level 4
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
14
Level 5 X X X X X X X X

Handheld Programmer Keystrokes


V2002 7 9 3 0 Level 6
Level 7
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
A
$ SHFT C A ENT Level 8 X X X X X X X X

SHFT
STR
P
CV
SHFT O
2

INST#
P
0

CV
ENT
B
GX V C A A A
OUT

SHFT P
CV
SHFT

SHFT O
AND

INST#
P
2

CV
ENT
0 0 0
ENT
C
GX
OUT

SHFT P
SHFT

SHFT
V

O
AND
C

P
2
A

ENT
0
A
0
B
1
ENT
D
CV INST# CV
GX SHFT V C A A C ENT
OUT AND 2 0 0 2

DL05 Micro PLC User Manual, 6th Edition, Rev. C 559


Chapter 5: Standard RLL - Logical Instructions

1 Logical Instructions (Accumulator)


And (AND)
2 The And instruction is a 16 bit instruction that logically ands the
DS5 Used
value in the lower 16 bits of the accumulator with a specified AND
A aaa
3 HPP Used
V-memory location (Aaaa). The result resides in the accumulator.
The discrete status flag indicates if the result of the And is zero.
4 Operand Data Type DL05 Range
....................................A aaa
5 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map
See memory map

6 Discrete Bit Flags


SP63
Description
On if the result in the accumulator is zero.
SP70 On anytime the value in the accumulator is negative.
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8
In the following example, when X1 is on, the value in V2000 will be loaded into the
9 accumulator using the Load instruction. The value in the accumulator is anded with the value
in V2006 using the And instruction. The value in the lower 16 bits of the accumulator is
output to V2010 using the Out instruction.
10
DirectSOFT 5
11 Direct SOFT32
X1 LD
V2000
2
V2000
8 7 A

12 Load the value in V2000 into


the lower 16 bits of the
accumulator
The upper 16 bits of the accumulator
will be set to 0

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

13 AND
V2006 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

6A38

14 AND the value in the


accumulator with
the value in V2006
AND (V2006)

Acc.
0

0
0

0
0

0
0

0
0

0
0

0
1
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
1

0
1

1
0

0
1

1
0

0
1

0
0

0
0

0
0

0
1

1
1

1
1

1
0

0
0

0
0

A OUT
V2010
2 8 3 8
Copy the lower 16 bits of the
accumulator to V2010

B Handheld Programmer Keystrokes


V2010

$ B ENT
STR 1

C SHFT L
ANDST
D
3
C
2
A
0
A
0
A
0
ENT

V SHFT V C A A G ENT
AND AND 2 0 0 6

D GX
OUT
SHFT V
AND
C
2
A
0
B
1
A
0
ENT

560 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Logical Instructions

And Double (ANDD)


DS5 Used
The And Double is a 32 bit instruction that logically ands the 1
value in the accumulator with two consecutive V-memory
HPP Used
locations or an 8 digit (max.) constant value (Aaaa). The
result resides in the accumulator. Discrete status flags indicate
ANDD
K aaa 2
if the result of the And Double is zero or a negative number
(the most significant bit is on). 3
Operand Data Type DL05 Range
aaa
4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map 5
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFFFFFF

Discrete Bit Flags Description 6


SP63 On if the result in the accumulator is zero.
SP70 On anytime the value in the accumulator is negative 7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is anded
with 36476A38 using the And double instruction. The value in the accumulator is output to
9
V2010 and V2011 using the Out Double instruction.
10
DirectSOFT
Direct SOFT32
5 V2000 V2000
X1 LDD
V2000
5 4 7 E 2 8 7 A
11
Load the value in V2000 and
V2001 into the accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0
8
0
7
0
6 5
1 1
4 3
1 1
2
0
1
1
0
0
12
ANDD
K36476A38

AND the value in the


Acc. 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0 13
accumulator with AND 36476A38 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0
the constant value
36476A38 Acc. 0 0 0 0
1 0 1 0 0 0 0
1 0 0 0 1
0 1
0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0
14
OUTD
V2010

Copy the value in the


1 4

V2011
4 6 2 8

V2010
3 8 A
accumulator to V2010 and
V2011

B
Handheld Programmer Keystrokes
$
STR
L
B

D
1
D
ENT

C A A A
C
SHFT ENT
ANDST 3 3 2 0 0 0
V
AND
GX
SHFT D

D
3
SHFT

C
K

A
JMP
D

B
3
G

A
6
E
4
H
7
G
6
SHFT A
0
SHFT D
3
I
8
ENT
D
SHFT ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 561


Chapter 5: Standard RLL - Logical Instructions

Or (OR)
1 DS5 Used
The Or instruction is a 16 bit instruction that logically ors the
value in the lower 16 bits of the accumulator with a specified V- OR
2 HPP Used
memory location (Aaaa). The result resides in the accumulator.
The discrete status flag indicates if the result of the Or is zero.
A aaa

3 Operand Data Type


....................................A
DL05 Range
aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map
See memory map

5 Discrete Bit Flags


SP63 On if the result in the accumulator is zero.
Description

SP70 On anytime the value in the accumulator is negative.


6
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
7 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the accumulator is ored with V2006
8 using the Or instruction. The value in the lower 16 bits of the accumulator are output to
V2010 using the Out instruction.
9
10 DirectSOFT
Direct SOFT32 5
X1 V2000
LD
2 8 7 A

11 V2000

Load the value in V2000 into


the lower 16 bits of the
The upper 16 bits of the accumulator
will be set to 0
accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

12 OR
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

V2006 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

13 Or the value in the


accumulator with
the value in V2006
6A38
OR (V2006) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0

Acc. 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0

14 OUT
V2010

A Copy the value in the lower


16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes
6 A

V2010
7 A

B $

SHFT
STR
L
B

D
1
ENT

C A A A ENT
ANDST 3 2 0 0 0

C Q

GX
OR
SHFT V

V
AND
C

C
2
A

A
0
A

B
0
G

A
6
ENT

SHFT ENT
OUT AND 2 0 1 0

562 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Logical Instructions

Or Double (ORD)
DS5 Used
The Or Double is a 32 bit instruction that ors the value in 1
HPP Used
the accumulator with the value (Aaaa), which is either two ORD
consecutive V-memory locations or an 8 digit (max.)
constant value. The result resides in the accumulator.
K aaa 2
Discrete status flags indicate if the result of the Or Double is
zero or a negative number (the most significant bit is on). 3
Operand Data Type DL05 Range
aaa
4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map 5
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFFFFFF

Discrete Bit Flags Description 6


SP63 On if the result in the accumulator is zero.
SP70 On anytime the value in the accumulator is negative. 7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is ored 9
with 36476A38 using the Or Double instruction. The value in the accumulator is output to
V2010 and V2011 using the Out Double instruction.
10
DirectSOFT
Direct SOFT32 5
11
X1 V2001 V2000
LDD
V2000

Load the value in V2000 and


5 4 7 E 2 8 7 A
12
V2001 into accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0
8
0
7
0
6 5
1 1
4 3
1 1
2
0
1
1
0
0
13
ORD
K36476A38

OR the value in the


accumulator with
Acc.

OR 36476A38
0

0
1

0
0

1
1

1
0

0
1

1
0

1
0

0
0

0
1

1
1

0
1

0
1

0
1

1
1

1
0

1
0

0
0

1 1
1 0

0
1

1
0

0
0

1
0

0
0

0
1

0
1

1
1

1
1

1
0

0
1

0
0

0
14
the constant value
36476A38 Acc. 0 0
1 0
1 0
1 0 1 0
1 0 0 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0

OUTD
V2010
A
7 6 7 F 6 A 7 A
Copy the value in the
accumulator to V2010 and
V2011
V2011 V2010 B
Handheld Programmer Keystrokes

$
STR
L
B

D
1
D
ENT

C A A A
C
SHFT ENT
ANDST 3 3 2 0 0 0
Q

GX
OR
SHFT

SHFT
D

D
3
SHFT

C
K

A
JMP
D

B
3
G

A
6
E

ENT
4
H
7
G
6
SHFT A
0
SHFT D
3
I
8
ENT
D
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 563


Chapter 5: Standard RLL - Logical Instructions

Exclusive Or (XOR)
1 DS5 Used
The Exclusive Or instruction is a 16 bit instruction that
HPP Used
performs an exclusive or of the value in the lower 16 bits of XOR
2 the accumulator and a specified V-memory location (Aaaa).
The result resides in the in the accumulator. The discrete
A aaa

status flag indicates if the result of the XOR is zero.


3 Operand Data Type DL05 Range
aaa
4 ....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
5 Discrete Bit Flags Description
SP63 On if the result in the accumulator is zero.
6 SP70 On anytime the value in the accumulator is negative.

7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example, when X1 is on, the value in V2000 will be loaded into the
8 accumulator using the Load instruction. The value in the accumulator is exclusive ored with
V2006 using the Exclusive Or instruction. The value in the lower 16 bits of the accumulator
9 are output to V2010 using the Out instruction.

10
DirectSOFT
Direct SOFT32 5

11 X1 LD
V2000
2
V2000
8 7 A

Load the value in V2000 into The upper 16 bits of the accumulator

12 the lower 16 bits of the


accumulator
will be set to 0

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

13 XOR
V2006 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0

XOR the value in the 6A38

14 accumulator with
the value in V2006
XOR (V2006)

Acc.
0

0
0

0
0

0
0

0
0

0
0

0
1
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
0

0
1

1
1

0
0

0
1

0
0

0
1

1
0

0
0

0
0

1
1

0
1

0
1

0
0

0
0

1
0

OUT

A V2010

Copy the lower 16 bits of the


4 2 4 2
accumulator to V2010 V2010

B Handheld Programmer Keystrokes

$ X B
SHFT ENT
STR SET 1

C SHFT L
ANDST
X
D
3
Q
SHFT V
AND
C

V
2
A

C
0
A

A
0
A

A
0
ENT

G
SHFT SHFT SHFT ENT
SET OR AND 2 0 0 6

D GX
OUT
SHFT V
AND
C
2
A
0
B
1
A
0
ENT

564 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Logical Instructions

Exclusive Or Double (XORD)


DS5 Used
The Exclusive OR Double is a 32 bit instruction that 1
performs an exclusive or of the value in the accumulator
XORD
HPP Used
and the value (Aaaa), which is either two consecutive
V-memory locations or an 8 digit (max.) constant. The
K aaa 2
result resides in the accumulator. Discrete status flags
indicate if the result of the Exclusive Or Double is zero 3
or a negative number (the most significant bit is on).
Operand Data Type DL05 Range 4
....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map 5
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFFFFFF
6
Discrete Bit Flags Description
SP63
SP70
On if the result in the accumulator is zero.
On anytime the value in the accumulator is negative.
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into 9
the accumulator using the Load Double instruction. The value in the accumulator is
exclusively ored with 36476A38 using the Exclusive Or Double instruction. The value in the
accumulator is output to V2010 and V2011 using the Out Double instruction.
10
DirectSOFT 5
Direct SOFT32 V2001 V2000
X1 LDD
V2000
5 4 7 E 2 8 7 A
11
Load the value in V2000 and
V2001 into the accumulator

XORD Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0
8
0
7
0
6 5
1 1
4 3
1 1
2
0
1
1
0
0
12
K36476A38

XORD the value in the


accumulator with
the constant value
Acc. 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 0 13
36476A38 XORD 36476A38 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0

OUTD
V2010
Acc. 0 0
1 0
1 0 0 1
0 0
1 0 0 0 1
0 1
0 1
0 0 0 1
0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0
14
Copy the value in the
accumulator to V2010
and V2011 6 2

V2011
3 9 4 2

V2010
4 2 A
Handheld Programmer Keystrokes
$

SHFT
STR
L
B

D
1
D
ENT

C A A A ENT
B
ANDST 3 3 2 0 0 0

SHFT

D
X

G
SET
Q

E
OR
SHFT

H
D

G
3

SHFT
SHFT

A
K
JMP

SHFT D I ENT
C
3 6 4 7 6 0 3 8
GX
OUT
SHFT D
3
C
2
A
0
B
1
A
0
ENT
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 565


Chapter 5: Standard RLL - Logical Instructions

Compare (CMP)
1 DS5 Used
The compare instruction is a 16 bit instruction that compares the
value in the lower 16 bits of the accumulator with the value in a CMP
HPP Used
2 specified V-memory location (Aaaa). The corresponding status flag
will be turned on indicating the result of the comparison.
A aaa

3 Operand Data Type DL05 Range


....................................A aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map
See memory map

5 Discrete Bit Flags Description


SP60 On when the value in the accumulator is less than the instruction value.
6 SP61
SP62
On when the value in the accumulator is equal to the instruction value.
On when the value in the accumulator is greater than the instruction value.

7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example when X1 is on, the constant 4526 will be loaded into the lower 16
8 bits of the accumulator using the Load instruction. The value in the accumulator is compared
with the value in V2000 using the Compare instruction. The corresponding discrete status
9 flag will be turned on indicating the result of the comparison. In this example, if the value in
the accumulator is less than the value specified in the Compare instruction, SP60 will turn on
10 energizing C30.
DirectSOFT
Direct SOFT32 5

11 X1 LD
K4526 4
CONSTANT
5 ?
2 ?
6

Load the constant value The unused accumulator

12 4526 into the lower 16 bits of


the accumulator
bits are set to zero

Acc. 0 0 0 0 44 55 2?
2 66
?

13 Compared
with
CMP

14 V2000

Compare the value in the


8 9 4 5

accumulator with the value V2000


in V2000
A SP60 C30
OUT

B Handheld Programmer Keystrokes


$ B ENT

C SHFT
STR
L
ANDST
D
1

3
SHFT K
JMP
E
4
F
5
C
2
G
6
ENT

SHFT C SHFT M P C A A A ENT


D $
STR
2

SHFT
ORST
SP
STRN
G
CV

6
A
0
ENT
2 0 0 0

GX SHFT C D A ENT
OUT 2 3 0

566 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Logical Instructions

Compare Double (CMPD)


The Compare Double instruction is a 32bit instruction that 1
DS5 Used
compares the value in the accumulator with the value (Aaaa), CMPD
HPP Used
which is either two consecutive V-memory locations or an
8digit (max.) constant. The corresponding status flag will be
A aaa 2
turned on indicating the result of the comparison.
Operand Data Type DL05 Range
3
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
4
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFFFFFF 5
Discrete Bit Flags
SP60
Description
On when the value in the accumulator is less than the instruction value.
6
SP61 On when the value in the accumulator is equal to the instruction value.
SP62 On when the value in the accumulator is greater than the instruction value. 7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8
In the following example when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is 9
compared with the value in V2010 and V2011 using the CMPD instruction. The
corresponding discrete status flag will be turned on indicating the result of the comparison. In
this example, if the value in the accumulator is less than the value specified in the Compare
10
instruction, SP60 will turn on energizing C30.
DirectSOFT
Direct SOFT32 5
11
X1 V2001 V2000
LDD
V2000

Load the value in V2000 and


4 5 2 6 7 2 9 9
12
V2001 into the accumulator

Acc. 4 5 ?
2 6 77 72 9 9
13
Compared
CMPD with
V2010

Compare the value in the


6 7 3 9 5 0 2 6
14
accumulator with the value V2011 V2010
in V2010 and V2011

SP60 C30
A
OUT

Handheld Programmer Keystrokes


B
$
STR

SHFT L
B

D
1
D
ENT

C A A A ENT
C
ANDST 3 3 2 0 0 0

$
SHFT C
2
SHFT

SHFT
M
ORST
SP
P

G
CV
D

A
3

ENT
C
2
A
0
B
1
A
0
ENT
D
STR STRN 6 0
GX SHFT C D A ENT
OUT 2 3 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 567


Chapter 5: Standard RLL - Math Instructions

1 Math Instructions
Add (ADD)
2 Add is a 16 bit instruction that adds a BCD value in the ADD
DS5 Used A aaa
accumulator with a BCD value in a V-memory location (Aaaa).
3 HPP Used
The result resides in the accumulator.
Operand Data Type DL05 Range
4 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
5 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map

Discrete Bit Flags Description


6 SP63
SP66
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16 bit addition instruction results in a carry.
SP67 On when the 32 bit addition instruction results in a carry.
7 SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NONBCD number was encountered.
8
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
9 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the lower 16 bits of the accumulator are
10 added to the value in V2006 using the Add instruction. The value in the accumulator is
copied to V2010 using the Out instruction.
DirectSOFT
11 Direct SOFT32
X1 LD
4
V2000
9 3 5

12 V2000

Load the value in V2000 into


the lower 16 bits of the The unused accumulator
accumulator bits are set to zero

13 ADD
+
0 0 0 0 4

2
9

5 0
3 5

0
(Accumulator)

(V2006)
V2006

14 Add the value in the lower


16 bits of the accumulator
with the value in V2006
Acc. 7 4 3 5

A OUT
V2010 7 4 3 5

Copy the value in the lower V2010


B 16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes

C $
STR
L
B

D
1
ENT

C A A A
SHFT ENT
ANDST 3 2 0 0 0

D SHFT A
0
D
3
D
3
C
2
A
0
A
0
G
6
ENT

GX SHFT V C A B A ENT
OUT AND 2 0 1 0

568 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Add Double (ADDD)


DS5 Used
Add Double is a 32 bit instruction that adds the BCD 1
HPP Used
value in the accumulator with a BCD value (Aaaa), ADDD
which is either two consecutive V-memory locations or
an 8digit (max.) BCD constant. The result resides in
A aaa 2
the accumulator.
Operand Data Type DL05 Range
3
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
4
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 099999999 5
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero. 6
SP66 On when the 16 bit addition instruction results in a carry.
SP67
SP70
On when the 32 bit addition instruction results in a carry.
On anytime the value in the accumulator is negative.
7
SP75 On when a BCD instruction is executed and a NONBCD number was encountered.
8
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
9
the accumulator using the Load Double instruction. The value in the accumulator is added
with the value in V2006 and V2007 using the Add Double instruction. The value in the 10
accumulator is copied to V2010 and V2011 using the Out Double instruction.
Direct SOFT V2001 V2000
11
X1 6 7 3 9 5 0 2 6
LDD
V2000

Load the value in V2000 and


12
V2001 into the accumulator

ADDD
+ 2
6 7
0
3
0
9
0
5
4
0
0
2
4
6
6
(Accumulator)
(V2006 and V2007)
13
V2006

Add the value in the


accumulator with the value
in V2006 and V2007
Acc. 8 7 3 9 9 0 7 2
14
OUTD
V2010 8 7 3 9 9 0 7 2
A
Copy the value in the V2011 V2010
accumulator to V2010 and
V2011 B
Handheld Programmer Keystrokes
$
STR
B
1
ENT C
SHFT L D D C A A A ENT

SHFT
ANDST
A
0
D
3

3
D
3

3
D
3
2
C
0

2
A
0

0
A
0

0
G
6
ENT
D
GX SHFT D SHFT V C A B A ENT
OUT 3 AND 2 0 1 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 569


Chapter 5: Standard RLL - Math Instructions

Subtract (SUB)
1 DS5 Used
Subtract is a 16 bit instruction that subtracts the BCD value (Aaaa) SUB
in a V-memory location from the BCD value in the lower 16 bits of A aaa

2 HPP Used
the accumulator. The result resides in the accumulator.
Operand Data Type DL05 Range
3 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
4 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map

Discrete Bit Flags Description


5 SP63
SP64
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16 bit addition instruction results in a borrow
SP65 On when the 32 bit addition instruction results in a borrow
6 SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NONBCD number was encountered.
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in V2006 is subtracted from the value in
9 the accumulator using the Subtract instruction. The value in the accumulator is copied to
V2010 using the Out instruction.
10
DirectSOFT
11 Direct SOFT32

X1 LD
2
V2000
4 7 5

V2000

12 Load the value in V2000 into


the lower 16 bits of the
The unused accumulator
bits are set to zero
accumulator 0 0 0 0 2 4 7 5 (Accumulator)

13 SUB
V2006
_
1 5 9 2 (V2006)

Acc. 0 8 8 3

14 Subtract the value in V2006


from the value in the lower
16 bits of the accumulator

A OUT
V2010
0 8 8 3

V2010
Copy the value in the lower
B 16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes

C $
STR
B
1
ENT

SHFT L D C A A A ENT
D SHFT
ANDST
S U
3
B
2

SHFT
0
V
0
C
0
A A G ENT
RST ISG 1 AND 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0

570 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Subtract Double (SUBD)


DS5 Used
Subtract Double is a 32 bit instruction that subtracts the BCD value SUBD 1
A aaa
(Aaaa), which is either two consecutive V-memory locations or an 8-
HPP Used
digit (max.) constant, from the BCD value in the accumulator. 2
Operand Data Type DL05 Range
....................................A aaa 3
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map
099999999
4
Discrete Bit Flags Description 5
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP64
SP65
On when the 16 bit addition instruction results in a borrow
On when the 32 bit addition instruction results in a borrow
6
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NONBCD number was encountered. 7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in V2006 and V2007 is 9
subtracted from the value in the accumulator. The value in the accumulator is copied to
V2010 and V2011 using the Out Double instruction.
10
Direct SOFT V2001 V2000

X1 LDD
V2000
0 1 0 6 3 2 7 4
11
Load the value in V2000 and
V2001 into the accumulator
0 1 0 6 3 2 7 4 (Accumulator)
12
_ 6 7 2 3 7 5 (V2006 and V2007)
SUBD
V2006 ACC. 0 0 3 9 0 8 9 9 13
The in V2006 and V2007 is
subtracted from the value in
the accumulator 14
OUTD 0 0 3 9 0 8 9 9
V2010
V2011 V2010 A
Copy the value in the
accumulator to V2010 and
V2011
B
Handheld Programmer Keystrokes

$
STR
B
1
ENT C
SHFT L D D C A A A ENT

SHFT
ANDST
S SHFT
3
U
3
B D
2 0
C
0
A
0
A G ENT
D
RST ISG 1 3 2 0 0 6
GX SHFT D C A B A ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 571


Chapter 5: Standard RLL - Math Instructions

Multiply (MUL)
1 DS5 Used
Multiply is a 16 bit instruction that multiplies the BCD
MUL
A aaa
value (Aaaa), which is either a V-memory location or a
2 HPP Used
4digit (max.) constant, by the BCD value in the lower
16 bits of the accumulator The result can be up to 8 digits
and resides in the accumulator.
3 Operand Data Type DL05 Range
....................................A aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
5 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 09999

Discrete Bit Flags Description


6 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
7 SP75 On when a BCD instruction is executed and a NONBCD number was encountered.

8 NOTE: The status flags are only valid until another instruction that uses the same flags is executed.

In the following example, when X1 is on, the value in V2000 will be loaded into the
9 accumulator using the Load instruction. The value in V2006 is multiplied by the value in the
accumulator. The value in the accumulator is copied to V2010 and V2011 using the Out
10 Double instruction.
DirectSOFT 5
Direct SOFT32 V2000

1 0 0 0
11 X1 LD
V2000
The unused accumulator
Load the value in V2000 into

12 the lower 16 bits of the


accumulator
bits are set to zero
0 0 0 0 1 0 0 0 (Accumulator)
(V2006)
X 2 5
MUL

13 V2006

The value in V2006 is


Acc. 0 0 0 2 5 0 0 0

multiplied by the value in the

14 accumulator

0 0 0 2 5 0 0 0
OUTD

A V2010

Copy the value in the


V2011 V2010

accumulator to V2010 and

B V2011

Handheld Programmer Keystrokes

C $
STR
B
1
ENT

SHFT L D C A A A ENT
D SHFT
ANDST
M
ORST
U
ISG
3
L
ANDST
2
C
0

2
A
0

0
A
0

0
G
6
ENT

GX SHFT D C A B A ENT
OUT 3 2 0 1 0

572 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Multiply Double (MULD)


DS5 Used
Multiply Double is a 32 bit instruction that multiplies the 8- 1
digit BCD value in the accumulator by the 8-digit BCD
HPP Used
value in the two consecutive V-memory locations specified in
the instruction. The lower 8 digits of the results reside in the
MULD
A aaa
2
accumulator. Upper digits of the result reside in the
accumulator stack. 3
Operand Data Type DL05 Range
....................................A aaa
4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map 5
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero. 6
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NONBCD number was encountered. 7
NOTE: Status flags are valid only until another instruction uses the same flag. 8
In the following example, when X1 is on, the constant Kbc614e hex will be loaded into the
accumulator. When converted to BCD the number is 12345678. That number is stored in 9
V1400 and V1401. After loading the constant K2 into the accumulator, we multiply it times
12345678, which is 24691356.
DirectSOFT 5
Direct SOFT32 Display
(Accumulator)
10
1 2 3 4 5 6 7 8
X1 LDD
Kbc614e
Load the hex equivalent
of 12345678 decimal into
the accumulator. 11
Convert the value to V1401 V1400
BCD

OUTD
BCD format. It will
occupy eight BCD digits
(32 bits).
Output the number to
1

X
2 3 4 5 6 7 8

2 (Accumulator)
12
V1400 and V1401 using
V1400

LD
the OUTD instruction.

Load the constant K2


into the accumulator.
Acc. 2 4 6 9 1 3 5 6
13
K2

MULD
V1400
Multiply the accumulator
contents (2) by the
8-digit number in V1400
2 4 6

V1403
9 1 3

V1402
5 6
14
and V1401.

OUTD
V1402
Move the result in the
accumulator to V1402
and V1403 using the
OUTD instruction.
A
Handheld Programmer Keystrokes

$
STR
B
1
ENT B
SHFT L D D PREV SHFT B C SHFT G B E SHFT E ENT

SHFT
ANDST
B
1
C
3

2
D
3

3
ENT
1 2 6 1 4 4

C
GX SHFT D B E A A ENT
OUT 3 1 4 0 0

SHFT L
ANDST
D
3
PREV C
2
ENT D
SHFT M U L D B E A A ENT
ORST ISG ANDST 3 1 4 0 0
GX SHFT D B E A C ENT
OUT 3 1 4 0 2

DL05 Micro PLC User Manual, 6th Edition, Rev. C 573


Chapter 5: Standard RLL - Math Instructions

Divide (DIV)
1 DS5 Used
Divide is a 16 bit instruction that divides the BCD value
HPP Used
in the accumulator by a BCD value (Aaaa), which is
2 either a V-memory location or a 4-digit (max.) constant.
The first part of the quotient resides in the accumulator
DIV
A aaa
and the remainder resides in the first stack location.
3
Operand Data Type DL05 Range
4 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
5 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map
09999

6 Discrete Bit Flags Description


SP53 On when the value of the operand is larger than the accumulator can work with.
7 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
8 SP75 On when a BCD instruction is executed and a NONBCD number was encountered.

NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
9 In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the accumulator will be divided by the
10 value in V2006 using the Divide instruction. The value in the accumulator is copied to
V2010 using the Out instruction.
11 DirectSOFT
Direct SOFT32 5 V2000
5 0 0 0

12 X1 LD
V2000

Load the value in V2000 into The unused accumulator

13 the lower 16 bits of the


accumulator

DIV
bits are set to zero
0 0 0 0 5 0 0 0 (Accumulater)

4 9 V2006
V2006

14 The value in the


accumulator is divided by
Acc. 1 0 2 0 0 0 0 0 0 0
First stak location contains
2

the value in V2006 the remainder

A OUT 1 0 2
V2010 V2010

B Copy the value in the lower


16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes

C $
STR
B
1
ENT

L D C A A A

D SHFT

SHFT
ANDST
D
3
I
3

8
V
AND
2
C
0

2
A
0

0
A
0

0
G
ENT

6
ENT

GX SHFT V C A B A ENT
OUT AND 2 0 1 0

574 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Divide Double (DIVD)


DS5 Used
Divide Double is a 32 bit instruction that divides the BCD 1
HPP Used
value in the accumulator by a BCD value (Aaaa), which
must be obtained from two consecutive V-memory locations.
(You cannot use a constant as the parameter in the box.) The
DIVD
A aaa 2
first part of the quotient resides in the accumulator and the
remainder resides in the first stack location. 3
Operand Data Type
....................................A
DL05 Range
aaa
4
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map 5
Discrete Bit Flags
SP53
Description
On when the value of the operand is larger than the accumulator can work with.
6
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative. 7
SP75 On when a BCD instruction is executed and a NONBCD number was encountered.

NOTE: Status flags are valid only until another instruction uses the same flag.
8
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into 9
the accumulator using the Load Double instruction. The value in the accumulator is divided
by the value in V1420 and V1421 using the Divide Double instruction. The first part of the
quotient resides in the accumulator an the remainder resides in the first stack location. The
10
value in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
DirectSOFT 5 V1401 V1400
11
X1 LDD 0 1 5 0 0 0 0 0
V1400

Load the value in V1400 and The unused accumulator


12
V1401 into the accumulator bits are set to zero

DIVD v
0
0
1
0
5
0
0
0
0
0
0
0
0
5
0
0
(Accumulator)

(V1421 and V1420)


13
V1420
Acc. 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0
The value in the accumulator
is divided by the value in
V1420 and V1421
First stack location contains
the remainder
14
OUTD
0 0 0 3 0 0 0 0
A
V1500

Copy the value in the


accumulator to V1500
and V1501
V1501 V1500
B
Handheld Programmer Keystrokes

$
STR
B
1
ENT SHFT L
ANDST
D
3
D
3
C
B E A A D I V
1
B
4
E
0
C
0
ENT

A
SHFT

ENT GX
3

SHFT
8
D
AND
D
1 4 2 0 OUT 3
B F A A ENT
1 5 0 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 575


Chapter 5: Standard RLL - Math Instructions

Increment (INC)
1 DS5 Used The Increment instruction increments a BCD value in a INC
specified V-memory location by 1 each time the instruction A aaa
HPP Used
2 is executed.
Decrement (DEC)
3 DS5 Used
The Decrement instruction decrements a BCD value in a DEC
specified V-memory location by 1 each time the instruction
HPP Used A aaa
4 is executed.

Operand Data Type DL05 Range


5 ....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
6 Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map

Discrete Bit Flags Description


7 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP75 On when a BCD instruction is executed and a NONBCD number was encountered.
8
NOTE: Status flags are valid only until another instruction uses the same flag.
9
DirectSOFT 5
Direct SOFT32 V1400

10 C5 INC
8 9 3 5

V1400

11 Increment the value in


V1400 by 1. V1400
8 9 3 6
12 Handheld Programmer Keystrokes

$ F
NEXT NEXT NEXT NEXT ENT
STR 5

13 SHFT I
8
N
TMR
C
2
B
1
E
4
A
0
A
0
ENT

14 In the following increment example, when C5 is on the value in V1400 increases by one.
DirectSOFT 5
A Direct SOFT32

C5 DEC
8
V1400
9 3 5

B V1400

Decrement the value in


V1400 by 1.
V1400
C Handheld Programmer Keystrokes
8 9 3 4

D $
STR
D E
NEXT NEXT

C
NEXT NEXT

B
F

E
5
ENT

A A
SHFT ENT
3 4 2 1 4 0 0

576 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Increment Binary (INCB)


DS5 Used
The Increment Binary instruction increments a binary INCB 1
value in a specified V-memory location by 1 each time A aaa
HPP Used
the instruction is executed. 2
Operand Data Type DL05 Range
....................................A aaa 3
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
4
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero. 5
In the following example when C5 is on, the binary value in V2000 is increased by 1.
DirectSOFT 5
6
Direct SOFT32 V2000 Handheld Programmer Keystrokes
C5 INCB
V2000

Increment the binary value


4 A 3 C
$
STR

SHFT I
8
SHFT

N
TMR
C

C
2

2
F

B
5

1
ENT

C
2
A
0
A
0
A
0
ENT
7
in the accumulator by1 V2000
4 A 3 D
8
Decrement Binary (DECB)
DS5 Used
The Decrement Binary instruction decrements a binary
value in a specified V-memory location by 1 each time
DECB 9
HPP Used A aaa
the instruction is executed.
10
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
11
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
12
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero. 13
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
14
In the following example when C5 is on, the value in V2000 is decreased by 1.

DirectSOFT
Direct SOFT32
5 V2000
Handheld Programmer Keystrokes
A
4 A 3 C
C5 DECB $ C F

B
SHFT ENT
STR 2 5
V2000
SHFT D E C B C A A A ENT
Decrement the binary value 3 4 2 1 2 0 0 0
in the accumulator by1 V2000
4 A 3 B

C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 577


Chapter 5: Standard RLL - Math Instructions

Add Binary (ADDB)


1 DS5 Used
Add Binary is a 16 bit instruction that adds the binary value
HPP Used
in the lower 16 bits of the accumulator with a binary value ADDB
2 (Aaaa), which is either a V-memory location or a 16-bit
constant. The result can be up to 32 bits and resides in the
A aaa

accumulator.
3
Operand Data Type DL05 Range
4 ....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
5 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFF

6 Discrete Bit Flags


SP63
Description
On when the result of the instruction causes the value in the accumulator to be zero.
SP66 On when the 16 bit addition instruction results in a carry.
7 SP67 On when the 32 bit addition instruction results in a carry.
SP70 On anytime the value in the accumulator is negative.
8 SP73 On when a signed addition or subtraction results in a incorrect sign bit.

NOTE: Status flags are valid only until another instruction uses the same flag.
9 In the following example, when X1 is on, the value in V1400 will be loaded into the
accumulator using the Load instruction. The binary value in the accumulator will be added to
10 the binary value in V1420 using the Add Binary instruction. The value in the accumulator is
copied to V1500 and V1501 using the Out Double instruction.
11 DirectSOFT 5 Use either OR Constant
V-memory
V1400

12 X1 LD
V1400
LD
K2565
0 A 0 5

13 Load the value in V1400


into the lower 16 bits of
the accumulator
BIN The unused accumulator
bits are set to zero
0 0 0 0 0 A 0 5 (Accumulator)

14 ADDB
V1420
+

Acc.
1

1
2

C
C

C
4

9
(V1420)

The binary value in the

A accumulator is added to the


binary value in V1420

OUTD 1 C C 9
V1500
V1500

B Copy the value in the lower


16bits of the accumulator to
V1500 and V1501

C Handheld Programmer Keystrokes

STR X(IN) 1 ENT

D SHFT

SHFT
L

A
D

D
V

D B
1 4 0

V
0

1
ENT

4 2 0 ENT

OUT SHFT D V 1 5 0 0 ENT

578 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Subtract Binary (SUBB)


DS5 Used
Subtract Binary is a 16 bit instruction that subtracts the S UBB
1
HPP Used
binary value (Aaaa), which is either a V-memory location A aaa
or a 4-digit (max.) binary constant, from the binary value
in the accumulator. The result resides in the accumulator.
2
Operand Data Type DL05 Range 3
....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map
See memory map
4
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFF
5
Discrete Bit Flags Description
SP63
SP64
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16 bit addition instruction results in a borrow
6
SP65 On when the 32 bit addition instruction results in a borrow
SP70 On any time the value in the accumulator is negative. 7
NOTE: Status flags are valid only until another instruction uses the same flag.
8
In the following example, when X1 is on, the value in V1400 will be loaded into the
accumulator using the Load instruction. The binary value in V1420 is subtracted from the
binary value in the accumulator using the Subtract Binary instruction. The value in the
9
accumulator is copied to V1500 using the Out instruction.
DirectSOFT 5
DirectSOFT32 Display
10
Use either OR Constant
V-memory

X1
11
LD LD
K1024
V1400

Load the value in V1400


into the lower 16 bits of BIN 1
V1400
0 2 4
12
the accumulator

SUBB The unused accumulator


13
V1420 bits are set to zero

The binary value in V1420 is


subtracted from the value in
the accumulator
-
0 0 0 0 1

0
0 2

A 0
4

B
(Accumulator)

(V1420)
14
Acc. 0 6 1 9
OUT
V1500 A
Copy the value in the lower 16
bits of the accumulator to V1500
0 6 1

V1500
9
B
Handheld Programmer Keystrokes
STR

L
X(IN)

D
1

V
ENT

1 4 0 0 ENT
C
SHFT

SHFT

V
S

1
SHFT

4 2
U B

0
B

ENT
D
OUT SHFT D V 1 5 0 0 ENT

DL05 Micro PLC User Manual, 6th Edition, Rev. C 579


Chapter 5: Standard RLL - Math Instructions

Multiply Binary (MULB)


1 DS5 Used
Multiply Binary is a 16 bit instruction that multiplies the
binary value (Aaaa), which is either a V-memory location or a MULB
HPP Used
4-digit (max.) binary constant, by the binary value in the A aaa
2 accumulator. The result can be up to 32 bits and resides in
the accumulator.
3 Operand Data Type DL05 Range
....................................A aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map
See memory map
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1FFFF
5
Discrete Bit Flags Description
6 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On any time the value in the accumulator is negative.

7 NOTE: Status flags are valid only until another instruction uses the same flag.

8 In the following example, when X1 is on, the value in V1400 will be loaded into the
accumulator using the Load instruction. The binary value in V1420 is multiplied by the
binary value in the accumulator using the Multiply Binary instruction. The value in the
9 accumulator is copied to V1500 and V1501 using the Out Double instruction.

10 DirectSOFT
DirectSOFT325 Display
Use either
V-memory
OR Constant

11 X1 LD
V1400
LD
K2561
0
V1400
A 0 1

Load the value in V1400


12 into the lower 16 bits of
the accumulator BIN
The unused accumulator
bits are set to zero
0 0 0 0 0 A 0 1 (Accumulator)
13 MULB
V1420
x 0 0 2 E (V1420)

Acc. 0 0 0 1 C C 2 E

14 The binary value in V1420 is


multiplied by the binary
value in the accumulator

OUTD
A V1500 0 0 0 1 C C 2 E

Copy the value of the accumulator V1501 V1500

B to V1500 and V1501

Handheld Programmer Keystrokes

C STR X 1 ENT

SHFT L D V 1 4 0 0 ENT

D SHFT M U L B V 1 4 2 0 ENT

OUT SHFT D V 1 5 0 0 ENT

580 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Math Instructions

Divide Binary (DIVB)


Divide Binary is a 16 bit instruction that divides the binary
DS5
HPP
Used
Used
value in the accumulator by a binary value (Aaaa), which is DIVB
1
either a V-memory location or a 16-bit (max.) binary A aaa
constant. The first part of the quotient resides in the
accumulator and the remainder resides in the first stack
2
location.
3
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
4
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0FFFF 5
Discrete Bit Flags
SP53
Description
On when the value of the operand is larger than the accumulator can work with.
6
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative. 7
NOTE: Status flags are valid only until another instruction uses the same flag. 8
In the following example, when X1 is on, the value in V1400 will be loaded into the
accumulator using the Load instruction. The binary value in the accumulator is divided by 9
the binary value in V1420 using the Divide Binary instruction. The value in the accumulator
is copied to V1500 using the Out instruction. 10
DirectSOFT 5
Use either OR Constant
DirectSOFT32 Display V-memory
11
X1 V1400
LD LDD
V1400

Load the value in V1400


K64001
F A 0 1
12
into the lower 16 bits of BIN
the accumulator The unused accumulator
bits are set to zero
0 0 0 0 F A 0 1 (Accumulator)
13
DIVB
_..
V1420

The binary value in th Acc.


0

0
0

3
5

2
0

0
(V1420)

0 0 0 0 0 0 0 0
14
accumulator is divided by
First stack location contains
the binary value in V1420

OUT
the remainder
A
V1500 0 3 2 0

Copy the value in the lower 16


bits of the accumulator to V1500
V1500 B
Handheld Programmer Keystrokes
C
STR X 1 ENT

SHFT L D V 1 4 0 0 ENT D
SHFT D I V B V 1 4 2 0 ENT

OUT SHFT D V 1 5 0 0 ENT

DL05 Micro PLC User Manual, 6th Edition, Rev. C 581


Chapter 5: Standard RLL - Bit Operation Instructions

1 Bit Operation Instructions


Sum (SUM)
2 DS5
The Sum instruction counts number of bits that are
Used
SUM

set to 1 in the accumulator. The HEX result resides


3 HPP Used
in the accumulator.
Discrete Bit Flags Description
4 SP63 On when the result of the instruction causes the value in the accumulator to be zero.

In the following example, when X1 is on, the value formed by discrete locations X10X17 is
5 loaded into the accumulator using the Load Formatted instruction. The number of bits in the
accumulator set to 1 is counted using the Sum instruction. The value in the accumulator is
6 copied to V1500 using the Out instruction.

7 DirectSOFT 5
Direct SOFT32 Display
X17 X16 X15 X14 X13 X12 X11 X10
X1 ON ON OFF OFF ON OFF ON ON
LDF X10

8 K8

Load the value represented by


The unused accumulator
bits are set to zero
discrete locations X10X17
into the accumulator

9 Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
1
6 5
1 0
4 3
0 1
2
0
1
1
0
1

10 SUM
Acc. 0 0 0 0 0 0 0 5

11 Sum the number of bits in


the accumulator set to 1

12 OUT
V1500
0 0 0

V1500
5

Copy the value in the lower

13 16 bits of the accumulator


to V1500
Handheld Programmer Keystrokes

$ B

14 SHFT
STR
L
ANDST
D
1

3
F
ENT

5
B
1
A
0
I
8
ENT

A SHFT

GX
S
RST
SHFT

PREV
U
ISG

PREV
M
ORST

PREV B
ENT

F A A ENT
OUT 1 5 0 0

B
C
D

582 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Bit Operation Instructions

Shift Left (SHFL)


DS5 Used Shift Left is a 32 bit instruction that shifts the bits in the SHFL 1
accumulator a specified number (Aaaa) of places to the A aaa
HPP Used
left. The vacant positions are filled with zeros and the bits
shifted out of the accumulator are discarded.
2
Operand Data Type DL05 Range 3
....................................A aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map
1-32
4
Discrete Bit Flags Description 5
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative. 6
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The bit pattern in the accumulator is
shifted 2 bits to the left using the Shift Left instruction. The value in the accumulator is
7
copied to V2010 and V2011 using the Out Double instruction.
8
DirectSOFT
Direct SOFT325
V2001 V2000
X1 LDD
V2000
6 7 0 5 33 31 10 01
9
Load the value in V2000 and
V2001 into the accumulator

SHFL Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0
8
1
7
0
6 5
0 0
4 3
0 0
2
0
1
0
0
1
10
K2

The bit pattern in the


accumulator is shifted 2 bit
positions to the left Shifted out of the
accumulator
. . . . 11
OUTD
V2010
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0
1 0 0 0
1 0
1 1 0 0 0 0 0 0
1 0 0
1 0 0 1 1 0 0 0 1 0
8
0
7
0
6 5
0 0
4 3
0 0
2
1
1
0
0
0
12
Copy the value in the Acc.
accumulator to V2010 and
V2011
13
9 C 1 4 C 4 0 4
14
V2011 V2010
Handheld Programmer Keystrokes

$
STR
B
1
ENT A
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0

SHFT S
RST
SHFT H
7
F
5
L
ANDST
C
2
ENT B
GX SHFT D C A B A ENT
OUT 3 2 0 1 0

C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 583


Chapter 5: Standard RLL - Bit Operation Instructions

Shift Right (SHFR)


1 DS5 Used
Shift Right is a 32 bit instruction that shifts the bits in the SHFR
HPP Used
accumulator a specified number (Aaaa) of places to the right. A aaa
2 The vacant positions are filled with zeros and the bits shifted out
of the accumulator are lost.
3 Operand Data Type
....................................A
DL05 Range
aaa
4 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map
1-32

5 Discrete Bit Flags


SP63
Description
On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
6
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
7 the accumulator using the Load Double instruction. The bit pattern in the accumulator is
shifted 2 bits to the right using the Shift Right instruction. The value in the accumulator is
copied to V2010 and V2011 using the Out Double instruction.
8
9 DirectSOFT
Direct SOFT32
5
V2001 V2000
X1 Constant 6 7 0 5 33 11 00 11
LDD

10 V2000

Load the value in V2000 and


V2001 into the accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

11 SHFR
K2
Acc. 0 1 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1

The bit pattern in the

12 accumulator is shifted 2 bit


positions to the right ... . Shifted out of the
accumulator

OUTD

13 V2010

Copy the value in the


accumulator to V2010 and
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0
1 1
0 1
0 0 0
1 0
1 0
1 0 0 0 0 0 0
1 0 1 0 0 1 1 0
8
0
7
0
6 5
1 0
4 3
0 0
2
0
1
0
0
0

V2011

14
A 1 9

V2011
C 1 4 C

V2010
4 0

Handheld Programmer Keystrokes

B $
STR
B
1
ENT

SHFT L D D C A A A ENT

C SHFT
ANDST
S
RST
SHFT
3
H
3

7
F
5
R
ORN
2 0
C
0

2
0

ENT

GX SHFT D C A B A ENT
OUT 3 2 0 1 0

584 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Bit Operation Instructions

Encode (ENCO)
DS5 Used
The Encode instruction encodes the bit position in the 1
HPP Used
accumulator having a value of 1, and returns the appropriate
binary representation. If the most significant bit is set to 1 (Bit
31), the Encode instruction would place the value HEX 1F
ENCO 2
(decimal 31) in the accumulator. If the value to be encoded is
0000 or 0001, the instruction will place a zero in the 3
accumulator. If the value to be encoded has more than one bit
position set to a 1, the least significant 1 will be encoded
and SP53 will be set on.
4
Discrete Bit Flags Description 5
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
6
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
7
In the following example, when X1 is on, The value in V2000 is loaded into the accumulator
using the Load instruction. The bit position set to a 1 in the accumulator is encoded to the
corresponding 5 bit binary value using the Encode instruction. The value in the lower 16 bits
8
of the accumulator is copied to V2010 using the Out instruction.
9
DirectSOFT
Direct SOFT32 5

X1 LD
1
V2000
0 0 0
10
V2000

Load the value in V2000 into


the lower 16 bits of the
accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
11
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0

Bit postion 12 is
converted
12
to binary

ENCO

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
13
Encode the bit position set
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
to 1 in the accumulator to a
5 bit binary value
14
OUT
V2010
0 0 0 C
A
Copy the value in the lower 16 bits
of the accumulator to V2010

Handheld Programmer Keystrokes


V2010 Binary value
for 12.
B
$ B

SHFT
STR
L
ANDST
D
1

3
ENT

C
2
A
0
A
0
A
0
ENT
C
E N C O
SHFT

GX
OUT
4 TMR

SHFT V
AND
2 INST#
C
2
ENT

A
0
B
1
A
0
ENT
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 585


Chapter 5: Standard RLL - Bit Operation Instructions

Decode (DECO)
1 DS5 Used
The Decode instruction decodes a 5 bit binary value of 031
HPP Used
(01F HEX) in the accumulator by setting the appropriate bit DECO
2 position to a 1. If the accumulator contains the value F (HEX),
bit 15 will be set in the accumulator. If the value to be decoded
is greater than 31, the number is divided by 32 until the value
3 is less than 32 and then the value is decoded.
In the following example when X1 is on, the value formed by discrete locations X10X14 is
4 loaded into the accumulator using the Load Formatted instruction. The five bit binary
pattern in the accumulator is decoded by setting the corresponding bit position to a 1 using
5 the Decode instruction.

6 DirectSOFT
Direct SOFT32 5
X14 X13 X12 X11 X10

7 X1 LDF
K5
X10 OFF ON OFF ON ON

Load the value in

8 represented by discrete
locations X10X14 into the
accumulator
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 1
2
0
1
1
0
1

9 The binary vlaue


is converted to
bit position 11.
DECO

10 Decode the five bit binary


pattern in the accumulator
and set the corresponding
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
8
0
7
0
6 5
0 0
4 3
0 0
2
0
1
0
0
0

bit position to a 1

11 Handheld Programmer Keystrokes

$ B ENT
STR 1

12 SHFT L
ANDST
D
3
F
5
B
1
A
0
F
5
ENT

SHFT D E C O ENT
3 4 2 INST#

13
14
A
B
C
D

586 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Number Conversion Instructions

Number Conversion Instructions (Accumulator) 1


Binary (BIN)
DS5 Used
The Binary instruction converts a BCD value in the
BIN 2
accumulator to the equivalent binary value. The result
HPP Used
resides in the accumulator. 3
In the following example, when X1 is on, the value in V2000 and V2001 is loaded into the
accumulator using the Load Double instruction. The BCD value in the accumulator is
converted to the binary (HEX) equivalent using the BIN instruction. The binary value in the
4
accumulator is copied to V2010 and V2011 using the Out Double instruction. (The
handheld programmer will display the binary value in V2010 and V2011 as a HEX value.) 5
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
6
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NONBCD number was encountered. 7
DirectSOFT
DirectSOFT32 5 V2001 V2000

X1 LDD
V2000
0 0 0 2 8 5 2 9
8
Load the value in V2000 and
V2001 into the accumulator

8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
9
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1

BCD Value
10
28529 = 16384 + 8192 + 2048 + 1024 + 512 + 256 + 64 + 32 + 16 + 1

BIN Binary Equivalent Value


11
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Convert the BCD value in
the accumulator to the
binary equivalent value
Acc. 0
2
0 0
1 5
0
2
0
1
0
6 3
0 0
1
0
8
0
4
0
2
0 0
1 5
0
2
0
1
0
6
0
3
1 1
1 8
0
4
1
2
1
1
1 1
5 2
0
1 6
1 1
3
1 0
1 8
0
4
0
2
1
1
12
1 0 3 6 3 7 3 6 3 1 0 0 2 6 3 5 2 6 1 0 0 0 1 5 2 4 2 6
4 7 6 8 4 1 5 7 8 9 9 4 4 2 1 5 7 3 9 9 4 2 2 6 8
7
4
4
8
3
7
4
1
8
7
0
9
4
3
5
4
2
1
7
7
0
8
8
6
5
4
4
3
7
7
2
1
8
6
0
8
4
3
0
4
7
1
5
2
8
5
7
6
2
8
8
1
4
4
0
7
2
3
6
6
8
8
4
2 6 8 4
13
3 8 1 5 2 4 2 6
6
4
8
2
4
2 6 8
14
OUTD
V2010 The Binary (HEX)
A
0 0 0 0 6 F 7 1 value copied to
Copy the binary data in the
accumulator to V2010 and V2011 V2011 V2010
V2010
B
Standard RLL
Instructions

Handheld Programmer Keystrokes

$
STR
B
1
ENT
C
L D D C A A A
SHFT

SHFT
ANDST

B
1
I
3

8
N
TMR
3

ENT
2 0 0 0
ENT
D
GX SHFT D C A B A ENT
OUT 3 2 0 1 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 587


Chapter 5: Standard RLL - Number Conversions Instructions

Binary Coded Decimal (BCD)


1 DS5 Used The Binary Coded Decimal instruction converts a binary value BCD
HPP Used in the accumulator to the equivalent BCD value. The result
2 resides in the accumulator.
In the following example, when X1 is on, the binary (HEX) value in V2000 and V2001 is
3 loaded into the accumulator using the Load Double instruction. The binary value in the
accumulator is converted to the BCD equivalent value using the BCD instruction. The BCD
value in the accumulator is copied to V2010 and V2011 using the Out Double instruction.
4 Discrete Bit Flags Description
5 SP63
SP70
On when the result of the instruction causes the value in the accumulator to be zero.
On anytime the value in the accumulator is negative.

DirectSOFT
DirectSOFT325
6 X1 0
V2001
0 0 0 6
V2000
F 7 1
LDD

7 V2000

Load the value in V2000 and


V2001 into the accumulator
Binary Value

8 Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9

0
2
0
1
0
5
0 0
2 1
0
6
0
3 1
0 0 0
8 4
0
2
0
1
0
5 2
0 0
1
0
6
0
3
1
1
1
8
0 1
4 2
1
1
1
5
8

1
2
7 6 5

0 1
1 6
1
3
4 3

1
1
0
8
2

0 0
4
1

2 1
0

1 0 3 6 3 7 3 6 3 1 0 0 2 6 3 5 2 6 1 0 0 0 1 5 2 4 2 6

9 4
7
4
4
7
3
7
4
6
8
7
0
8
4
3
5
4
2
1
7
1
0
8
8
5
5
4
4
7
7
7
2
8
8
6
0
9
4
3
0
9
7
1
5
4
8
5
7
4
2
8
8
2
1
4
4
1
0
7
2
5
3
6
7
6
8
3
8
4
9
2
9
6
4
8
2
4
2 6 8

8 1 9 4 7 6 3 1 8 4 2 6

10 3
6
4
8
2
4
1
2
5
6
2
8
4 2 6

11 BCD
16384 + 8192 + 2048 + 1024 + 512 + 256 + 64 + 32 + 16 + 1 = 28529

12 Convert the binary value in


the accumulator to the BCD
equivalent value 8 4 2 1 8 4 2 1 8 4 2 1 8
BCD Equivalent Value

4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1

13
14 OUTD
V2010

Copy the BCD value in the 0 0 0 2 8 5 2 9 The BCD value

A accumulator to V2010 and V2011


V2011 V2010
copied to
V2010 and V2011

Handheld Programmer Keystrokes

B $
STR
B
1
ENT

L D D C A A A

C SHFT

SHFT
ANDST
B
1
C
3

2
D
3

3
ENT
2 0 0 0
ENT

D GX
OUT
SHFT D
3
C
2
A
0
B
1
A
0
ENT

588 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Number Conversions Instructions

Invert (INV)
DS5 Used The Invert instruction inverts or takes the ones INV
1
HPP Used complement of the 32 bit value in the accumulator. The
result resides in the accumulator. 2
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the Load Double instruction. The value in the accumulator is inverted
using the Invert instruction. The value in the accumulator is copied to V2010 and V2011
3
using the Out Double instruction.
4
5
DirectSOFT
Direct SOFT32 5 V2001 V2000
6
X1 0 4 0 5 00 22 55 00
LDD
V2000

Load the value in V2000 and


V2001 into the accumulator
7
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 8
INV

Invert the binary bit pattern


Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0
8
1
7
1
6 5
0 1
4 3
0 1
2
1
1
1
0
1
9
in the accumulator

OUTD F B F A F D A F
10
V2010 V2011 V2010
Copy the value in the
accumulator to V2010 and
V2011
11
Handheld Programmer Keystrokes
12
$ B ENT

SHFT
STR
L
ANDST
D
1

3
D
3
C
2
A
0
A
0
A
0
ENT
13
SHFT I N V ENT

GX
OUT
SHFT
8
D
TMR

3
AND
C
2
A
0
B
1
A
0
ENT 14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 589


Chapter 5: Standard RLL - Number Conversion Instructions

ASCII to HEX (ATH)


1 DS5 Used
The ASCII TO HEX instruction converts a table of ASCII
HPP Used
values to a specified table of HEX values. ASCII values are
2 two digits and their HEX equivalents are one digit. This
means an ASCII table of four V-memory locations would
ATH
V aaa
only require two V-memory locations for the equivalent
3 HEX table. The function parameters are loaded into the
accumulator stack and the accumulator by two additional
4 instructions. Listed below are the steps necessary to program
an ASCII to HEX table function. The example on the
following page shows a program for the ASCII to HEX table
5 function.
Step 1: Load the number of V-memory locations for the ASCII table into the first level of
6 the accumulator stack.
Step 2: Load the starting V-memory location for the ASCII table into the accumulator.
7 This parameter must be a HEX value.
Step 3: Specify the starting V-memory location (Vaaa) for the HEX table in the ATH
8 instruction.
Helpful Hint: For parameters that require HEX values when referencing memory
9 locations, the LDA instruction can be used to convert an octal address to the HEX equivalent
and load the value into the accumulator.
10 Operand Data Type DL05 Range
aaa
11 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map

Discrete Bit Flags Description


12 SP53 On when the value of the operand is larger than the accumulator can work with.

In the example on the following page, when X1 is ON the constant (K4) is loaded into the
13 accumulator using the Load instruction and will be placed in the first level of the accumulator
stack when the next Load instruction is executed. The starting location for the ASCII table
14 (V1400) is loaded into the accumulator using the Load Address instruction. The starting
location for the HEX table (V1600) is specified in the ASCII to HEX instruction. The table
A below lists valid ASCII values for ATH conversion.
ASCII Values Valid for ATH Conversion
B ASCII Value
30
HEX Value
0
ASCII Value
38
HEX Value
8
31 1 39 9
C 32 2 41 A
33 3 42 B
D 34
35
4
5
43
44
C
D
36 6 45 E
37 7 46 F

590 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Number Conversion Instructions

DirectSOFT 5
Direct SOFT32

X1 LD
K4
Load the constant value
into the lower 16 bits of the
accumulator. This value
ASCII TABLE
Hexadecimal
Equivalents
1
defines the number of V

LDA
memory location in the
ASCII table

Convert octal 1400 to HEX


V1400 33 34 2
O 1400
300 and load the value into
the accumulator
1234 V1600

ATH V1600 is the starting


location for the HEX table
V1401 31 32 3
V1600

Handheld Programmer Keystrokes


4
$
STR
B
1
ENT V1402 37 38
SHFT L
ANDST
L
D

D
3
A
PREV E

B
4
E
ENT

A A
5678 V1601 5
SHFT
ANDST 3 0 1 4 0 0
ENT
V1403 35 36
SHFT A
0
T
MLR
H
7
B
1
G
6
A
0
A
0
ENT
6
7
HEX to ASCII (HTA) 8
The HEX to ASCII instruction converts a table of HTA
DS5 Used
HEX values to a specified table of ASCII values.
HPP Used
HEX values are one digit and their ASCII
V aaa 9
equivalents are two digits.
This means a HEX table of two V-memory locations would require four V-memory locations 10
for the equivalent ASCII table. The function parameters are loaded into the accumulator
stack and the accumulator by two additional instructions. Listed below are the steps necessary
to program a HEX to ASCII table function. The example on the following page shows a
11
program for the HEX to ASCII table function.
Step 1: Load the number of V-memory locations in the HEX table into the first level of
12
the accumulator stack.
Step 2: Load the starting V-memory location for the HEX table into the accumulator. This 13
parameter must be a HEX value.
Step 3: Specify the starting V-memory location (Vaaa) for the ASCII table in the HTA 14
instruction.
Helpful Hint: For parameters that require HEX values when referencing memory A
locations, the LDA instruction can be used to convert an octal address to the HEX equivalent
and load the value into the accumulator. B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 591


Chapter 5: Standard RLL - Number Conversion Instructions

Operand Data Type DL05 Range


1 aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
2 Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
3
In the following example, when X1 is ON the constant (K2) is loaded into the accumulator
4 using the Load instruction. The starting location for the HEX table (V1500) is loaded into
the accumulator using the Load Address instruction. The starting location for the ASCII table
(V1400) is specified in the HEX to ASCII instruction.
5 DirectSOFT
Direct SOFT32 5
Hexadecimal

6 X1 LD
K2
Equivalents ASCII TABLE

Load the constant value into


the lower 16 bits of the

7 accumulator. This value


defines the number of V
locations in the HEX table.
33 34 V1400

V1500 1234
8 LDA
O 1500
31 32 V1401

Convert octal 1500 to HEX

9 340 and load the value into


the accumulator

10 HTA
V1400
37 38 V1402

V1400 is the starting


V1501 5678
11 location for the ASCII table.
The conversion is executed
by this instruction.
35 36 V1403

12 Handheld Programmer Keystrokes

$
STR
B
1
ENT

L D K E

13 SHFT

SHFT
ANDST
L
ANDST
D
3

3
A
0
SHFT

B
JMP

1
F
4

5
ENT

A
0
A
0
ENT

H T A B E A A

14 SHFT
7 MLR 0 1 4 0 0
ENT

The table below lists valid ASCII values for HTA conversion.
A ASCII Values Valid for HTA Conversion
Hex Value ASCII Value Hex Value ASCII Value
B 0 30 8 38
1 31 9 39
C 2
3
32
33
A
B
41
42

D 4
5
34
35
C
D
43
44
6 36 E 45
7 37 F 46

592 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Number Conversion Instructions

Gray Code (GRAY)


DS5 Used
The Gray code instruction converts a 16 bit gray code 1
HPP Used
value to a BCD value. The BCD conversion requires 10
bits of the accumulator. The upper 22 bits are set to 0.
This instruction is designed for use with devices
2
(typically encoders) that use the grey code numbering GRAY
scheme. The Gray Code instruction will directly convert 3
a gray code number to a BCD number for devices
having a resolution of 512 or 1024 counts per
revolution. If a device having a resolution of 360 counts
4
per revolution is to be used you must subtract a BCD
value of 76 from the converted value to obtain the 5
proper result. For a device having a resolution of 720
counts per revolution you must subtract a BCD value of 6
152.
In the following example, when X1 is ON the binary value represented by X10X27 is loaded
into the accumulator using the Load Formatted instruction. The gray code value in the
7
accumulator is converted to BCD using the Gray Code instruction. The value in the lower 16
bits of the accumulator is copied to V2010. 8
Discrete Bit Flags
SP63
Description
On when the result of the instruction causes the value in the accumulator to be zero.
9
SP70 On anytime the value in the accumulator is negative.
DirectSOFT
Direct SOFT325
X27 X26 X25 X12 X11 X10
10
X1 OFF OFF OFF ON OFF ON
LDF
X10
K16

Load the value represented


11
by X10X27 into the lower
16 bits of the accumulator

Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8
0
7
0
6 5
0 0
4 3
0 0
2
1
1
0
0
1
12
GRAY

Convert the 16 bit grey code


value in the accumulator to a
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
13
BCD value

OUT
V2010
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
14
Copy the value in the lower
16 bits of the accumulator to
V2010
Gray Code

0000000000
BCD

0000 0 0 0 6
A
Handheld Programmer Keystrokes 0000000001 0001 V2010

$
STR
B
1
ENT
0000000011
0000000010
0002
0003
B
L D F B A B G 0000000110 0004
SHFT ENT

SHFT
ANDST
G
6
R
ORN
3
A
5

0
Y
MLS
ENT
1 0 1 6
0000000111
0000000101
0005
0006
C
GX V C A B A 0000000100 0007
SHFT ENT
OUT AND 2 0 1 0
D
1000000001 1022
1000000000 1023

DL05 Micro PLC User Manual, 6th Edition, Rev. C 593


Chapter 5: Standard RLL - Number Conversion Instructions

Shuffle Digits (SFLDGT)


1 DS5 Used
The Shuffle Digits instruction shuffles a maximum of 8 SFLDGT

HPP Used
digits rearranging them in a specified order. This function
2 requires parameters to be loaded into the first level of the
accumulator stack and the accumulator with two additional instructions. Listed below are
the steps necessary to use the shuffle digit function. The example on the following page
3 shows a program for the Shuffle Digits function.
Step 1: Load the value (digits) to be shuffled into the first level of the accumulator stack.
4 Step 2: Load the order that the digits will be shuffled to into the accumulator.
Step 3: Insert the SFLDGT instruction.
5
NOTE: If the number used to specify the order contains a 0 or 9-F, the corresponding position will
6 be set to 0.

Discrete Bit Flags Description


7 SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP70 On anytime the value in the accumulator is negative.
8 Shuffle Digits Block Diagram Digits to be
There are a maximum of 8 digits that can be
9 shuffled. The bit positions in the first level of the
shuffled (first stack location)

9 A B C D E F 0
accumulator stack defines the digits to be shuffled.
10 They correspond to the bit positions in the
accumulator that define the order the digits will be
11 shuffled. The digits are shuffled and the result
resides in the accumulator.
1 2 8 7 3 6

Specified order (accumulator)


5 4

12 Bit Positions 8 7 6 5 4 3 2 1

13 B C E F

Result (accumulator)
0 D A 9

14
A
B
C
D

594 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Number Conversion Instructions

In the following example when X1 is on, The value in the first level of the accumulator stack
will be reorganized in the order specified by the value in the accumulator. 1
Example A shows how the shuffle digits works when 0 or 9 F is not used when specifying
the order the digits are to be shuffled. Also, there are no duplicate numbers in the specified
order.
2
Example B shows how the shuffle digits works when a 0 or 9F is used when specifying the
order the digits are to be shuffled. Notice when the Shuffle Digits instruction is executed, the
3
bit positions in the first stack location that had a corresponding 0 or 9F in the accumulator
(order specified) are set to 0. 4
Example C shows how the shuffle digits works when duplicate numbers are used specifying
the order the digits are to be shuffled. Notice when the Shuffle Digits instruction is executed, 5
the most significant duplicate number in the order specified is used in the result.

DirectSOFT
Direct SOFT32 5
6
A B C
X1 LDD
V2000 9 A
V2001
B C D
V2000
E F 0 0
V2001
F E D C
V2000
B A 9 9
V2001
A B C D
V2000
E F 0 7
Load the value in V2000 and
V2001 into the accumulator
Original
bit
Positions
8
9 A
7 6
B C
5 4
D
3
E
2
F
1
0 Acc.
8 7 6 5
0 F E D
4
C
3
B
2
A
1
9 Acc.
8
9
7
A
6
B
5
C
4
D
3
E
2
F
1
0 Acc. 8
V2007 V2006 V2007 V2006 V2007 V2006
LDD
V2006

Load the value in V2006 and


1 2 8 7 3 6 5 4 0 0 4 3 0 0 2 1 4 3 2 1 4 3 2 1
9
V2007 into the accumulator Specified 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1
order
1 2 8 7 3 6 5 4 Acc.
8
0
7
0
6
4
5
3
4
0
3
0
2
2
1
1 Acc. 4 3 2 1 4 3 2 1 Acc. 10
New bit 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1
SFLDGT

Shuf fle the digits in the first


Positions
B C E F 0 D A 9 Acc. 0 0 0 0 E D A 9 Acc. 0 0 0 0 9 A B C Acc.
11
level of the accumulator
stack based on the pattern
in the accumulator. The
result is in the accumulator . 12
OUTD
B C E F 0 D A 9 0 0 0 0 E D A 9 0 0 0 0 9 A B C
V2010

Copy the value in the


accumulator to V2010 and
V2011 V2010 V2011 V2010 V2011 V2010
13
V2011

Handheld Programmer Keystrokes


14
$
STR

SHFT L
ANDST
B

D
1

3
D
ENT

3
C
2
A
0
A
0
A
0
ENT
A
SHFT

SHFT
L
ANDST
S
RST
D

SHFT
3
D

F
3

5
L
ANDST
C

D
2

3
A

G
0

6
A

T
MLR
0
G

ENT
6
ENT
B
GX
OUT
SHFT D
3
C
2
A
0
B
1
A
0
ENT
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 595


Chapter 5: Standard RLL - Table Instructions

1 Table Instructions
Move (MOV)
2 The Move instruction moves the values from a V-memory
MOV
V aaa
DS5 Used
table to another V-memory table the same length (a table is
3 HPP Used
a consecutive group of V-memory locations). The function
parameters are loaded into the first level of the accumulator stack and the accumulator by two
4 additional instructions. The MOV instruction can be used to write data to non-volatile V-
memory (see Appendix F). Listed below are the steps necessary to program the MOV
function.
5 Step 1: Load the number of V-memory locations to be moved into the first level of the
accumulator stack. This parameter is a HEX value (K40 max, 100 octal).
6 Step 2: Load the starting V-memory location for the locations to be moved into the accumulator.
This parameter is a HEX value.
7 Step 3: Insert the MOVE instruction which specifies starting V-memory location (Vaaa) for the
destination table.

8 Helpful Hint: For parameters that require HEX values when referencing memory
locations, the LDA instruction can be used to convert an octal address to the HEX equivalent
and load the value into the accumulator.
9 Operand Data Type DL05 Range
....................................A aaa
10 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P See memory map
11 Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
12 In the following example, when X1 is on, the constant value (K6) is loaded into the
accumulator using the Load instruction. This value specifies the length of the table and is
13 placed in the first stack location after the Load Address instruction is executed. The octal
address 2000 (V2000), the starting location for the source table is loaded into the
accumulator. The destination table location (V2030) is specified in the Move instruction.
14 DirectSOFT
Direct SOFT325

X1 Load the constant value 6


LD

A K6
(HEX) into the lower 16 bits
of the accumulator

Convert octal 2000 to HEX 0 1 2 3 V2000


X
X
0
X
X
1
X
X
2
X V2026
X V2027
3 V2030
LDA 400 and load the value into
0 5 0 0 V2001 0 5 0 0 V2031

B MOV
O 2000 the accumulator

Copy the specified table


locations to a table
9
3
9
0
9
7
9 V2002
4 V2003
9
3
9
0
9
7
9 V2032
4 V2033
V2030 beginning at location V2030
8 9 8 9 V2004 8 9 8 9 V2034

C Handheld Programmer Keystrokes

$ B
1
X
0
X
1
X
0 V2005
X V2006
1
X
0
X
1
X
0 V2035
X V2036
ENT X X X X V2007 X X X X V2037
STR 1

D SHFT L
ANDST
L
D

D
3
A
SHFT K

C
JMP
G

A
6
A
ENT

A
SHFT ENT
ANDST 3 0 2 0 0 0

SHFT M O V C A D A ENT
ORST INST# AND 2 0 3 0

596 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Table Instructions

Move Memory Cartridge (MOVMC)


and
1
Load Label (LDLBL) 2
The Move Memory Cartridge and the Load Label instructions are MOVMC
DS5
HPP
Used
Used
used to copy data from program ladder memory to V-memory. The
Load Label instruction is used with the MOVMC instruction when
V aaa
3
copying data from program ladder memory to V-memory.
To copy data from the program ladder memory to V-memory, the
4
function parameters are loaded into the first two levels of the LDLBL
accumulator stack and the accumulator by two additional K aaa 5
instructions. Listed below are the steps necessary to program the
Move Memory Cartridge and Load Label functions.
Step 1: Load the number of words to be copied into the second level of the accumulator stack.
6
Step 2: Load the offset for the data label area in ladder memory and the beginning of the
V-memory block into the first level of the stack.
7
Step 3: Load the source data label (LDLBL Kaaa) into the accumulator when copying data from
ladder memory to V-memory. This is the source location of the value. 8
Step 4: Insert the MOVMC instruction which specifies destination in V-memory (Vaaa). This is
the copy destination. 9
Operand Data Type DL05 Range
....................................A aaa 10
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 597


Chapter 5: Standard RLL - Table Instructions

Copy Data From a Data Label Area to V-memory


1 In the example to the right, data is copied from a Data Label Area to V-memory. When X1 is
on, the constant value (K4) is loaded into the accumulator using the Load instruction. This
2 value specifies the length of the table and is placed in the second stack location after the next
Load and Load Label (LDLBL) instructions are executed. The constant value (K0) is loaded
into the accumulator, specifying the offset for the source and destination data. It is placed in
3 the first stack location after the LDLBL instruction is executed. The source address where
data is being copied from is loaded into the accumulator using the LDLBL instruction. The
4 MOVMC instruction specifies the destination starting location and executes the copying of
data from the Data Label Area to V-memory.
5
DirectSOFT 5
6 Data label area
programmed after
Direct SOFT32
X1 LD
the END instruction K4
7 DLBL K1
.
. Load the value 4 into the
accumulator specifying the
1 2 3 4
8 N
K
C
1
O
2
N
3 4
V2000 number of locations to be
copied.

N C O N 4 5 3 2 V2001 LD

9 K

N
4

C
5

O
3

N
2
6 1 5 1 V2002
K0

Load the value 0 into the


accumulator specifying the
10 K

N
6

C
1

O
5

N
1
8 8 4 5 V2003
offset for source and
destination locations
K 8 8 4 5
LDLBL
11 X X
.
X X V2004 K1

. Load the value 1 into the


12 accumulator specifying the
Data Label Area K1 as the
starting address of the data
to be copied.

13 Handheld Programmer Keystrokes

$ B
MOVMC
ENT V2000
STR 1

14 SHFT L
ANDST
D
3
SHFT K
JMP
E
4
ENT V2000 is the destination
starting address for the data
to be copied.
L D K A
A SHFT
ANDST
L D
3
L
SHFT

B L
JMP 0
ENT

B
SHFT ENT
ANDST 3 ANDST 1 ANDST 1

B SHFT M
ORST
O
INST#
V
AND
M
ORST
C
2
C
2
A
0
A
0
A
0
ENT

C
D

598 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - CPU Control Instructions

CPU Control Instructions 1


No Operation (NOP)
DS5 Used
The No Operation is an empty (not programmed) memory location. NOP 2
DirectSOFT 5
HPP N/A Direct SOFT32 Handheld Programmer Keystrokes

N O P
3
SHFT ENT
NOP TMR INST# CV

4
End (END) 5
The End instruction marks the termination point of the normal
DS5 Used
HPP N/A
program scan. An End instruction is required at the end of the main
program body. If the End instruction is omitted an error will occur and
END 6
the CPU will not enter the Run Mode. Data labels, subroutines and
interrupt routines are placed after the End instruction. The End 7
instruction is not conditional; therefore, no input contact is allowed.

DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes
8
END
SHFT E
4
N
TMR
D
3
ENT
9
10
Stop (STOP)
The Stop instruction changes the operational mode of the CPU
11
DS5 Used STOP
from Run to Program (Stop) mode. This instruction is typically
HPP N/A
used to stop PLC operation in an error condition. 12
In the following example, when C0 turns on, the CPU will stop
operation and switch to the program mode. 13
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes

$ C A
14
C0 SHFT ENT
STR 2 0
STOP
SHFT S
RST
SHFT T
MLR
O
INST#
P
CV
ENT
A
B
Discrete Bit Flags Description
SP16 On when the DL05 goes into the TERM_PRG mode.
C
SP53 On when the DL05 goes into the PRG mode.
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 599


Chapter 5: Standard RLL - CPU Control Instructions

Reset Watch Dog Timer (RSTWT)


1 DS5 Used
The Reset Watch Dog Timer instruction resets the CPU scan
timer. The default setting for the watch dog timer is 200ms.
2 HPP N/A
Scan times very seldom exceed 200ms, but it is possible.
For/next loops, subroutines, interrupt routines, and table
RSTWT

instructions can be programmed such that the scan becomes


3 longer than 200ms. When instructions are used in a manner
that could exceed the watch dog timer setting, this
4 instruction can be used to reset the timer.
A software timeout error (E003) will occur and the CPU will enter the program mode if the
5 scan time exceeds the watch dog timer setting. Placement of the RSTWT instruction in the
program is very important. The instruction has to be executed before the scan time exceeds
the watch dog timers setting.
6 If the scan time is consistently longer than the watch dog timers setting, the timeout value
may be permanently increased from the default value of 200ms by AUX 55 on the HPP or
7 the appropriate auxiliary function in your programming package. This eliminates the need for
the RSTWT instruction.
8 In the following example the CPU scan timer will be reset to 0 when the RSTWT instruction
is executed. See the For/Next instruction for a detailed example.
9 DirectSOFT 5
Direct SOFT 32 Handheld Programmer Keystrokes

R S T W T
10 RSTWT
SHFT
ORN RST MLR ANDN MLR
ENT

11
12
13
14
A
B
C
D

5100 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Program Control Instructions

Program Control Instructions 1


For / Next (FOR) (NEXT)
The For and Next instructions are used to execute a section of 2
DS5 Used
ladder logic between the For and Next instruction a specified A aaa
HPP Used
numbers of times. When the For instruction is enabled, the FOR 3
program will loop the specified number of times. If the For
instruction is not energized the section of ladder logic between the
For and Next instructions is not executed.
4
For / Next instructions cannot be nested. The normal I/O update
and CPU housekeeping is suspended while executing the For / 5
Next loop. The program scan can increase significantly, depending
on the amount of times the logic between the For and Next
NEXT
6
instruction is executed. With the exception of immediate I/O
instructions, I/O will not be updated until the program execution
is completed for that scan. Depending on the length of time
7
required to complete the program execution, it may be necessary
to reset the watch dog timer inside of the For / Next loop using 8
the RSTWT instruction.
9
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
10
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-9999
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5101


Chapter 5: Standard RLL - Program Control Instructions

In the following example, when X1 is on, the application program inside the For / Next loop
1 will be executed three times. If X1 is off the program inside the loop will not be executed.
The immediate instructions may or may not be necessary depending on your application.
2 Also, The RSTWT instruction is not necessary if the For / Next loop does not extend the
scan time larger the Watch Dog Timer setting. For more information on the Watch Dog
Timer, refer to the RSTWT instruction.
3 DirectSOFT 5
Direct SOFT32
X1 1 2 3
K3
4 FOR

5 RSTWT

6 X20 Y5

7 OUT

8 NEXT

9
Handheld Programmer Keystrokes

10 $
STR
B
1
ENT

11 SHFT F

R
5
O
INST#
S
R

T
ORN
W
D

T
3
ENT

SHFT ENT
ORN RST MLR ANDN MLR

12 $
STR
SHFT I
8
C
2
A
0
ENT

GX F
13 OUT

SHFT N E
5
ENT

X T ENT
TMR 4 SET MLR

14
A
B
C
D

5102 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Program Control Instructions

Goto Subroutine (GTS) (SBR)


DS5 Used
The Goto Subroutine instruction allows a section of ladder 1
logic to be placed outside the main body of the program K aaa
HPP Used
execute only when needed. There can be a maximum of 64
GTS instructions and 64 SBR instructions used in a program.
GTS
2
The GTS instructions can be nested up to 8 levels. An error
E412 will occur if the maximum limits are exceeded. Typically 3
this will be used in an application where a block of program
logic may be slow to execute and is not required to execute
every scan. The subroutine label and all associated logic is SBR K aaa
4
placed after the End statement in the program. When the
subroutine is called from the main program, the CPU will 5
execute the subroutine (SBR) with the same constant number
(K) as the GTS instruction which called the subroutine. 6
By placing code in a subroutine it is only scanned and executed when needed since it resides
after the End instruction. Code which is not scanned does not impact the overall scan time of
the program.
7
Operand Data Type DL05 Range
8
....................................A aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-FFFF 9
Subroutine Return (RT) 10
When a Subroutine Return is executed in the subroutine the
DS5
HPP
Used
Used
CPU will return to the point in the main body of the program RT 11
from which it was called. The Subroutine Return is used as
termination of the subroutine which must be the last
instruction in the subroutine and is a stand alone instruction
12
(no input contact on the rung).
Subroutine Return Conditional (RTC)
13
The Subroutine Return Conditional instruction is a optional
DS5
HPP
Used
Used
instruction used with a input contact to implement a RTC 14
conditional return from the subroutine. The Subroutine Return
(RT) is still required for termination of the Subroutine. A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5103


Chapter 5: Standard RLL - Program Control Instructions

In the following example, when X1 is on, Subroutine K3 will be called. The CPU will jump
1 to the Subroutine Label K3 and the ladder logic in the subroutine will be executed. If X35 is
on the CPU will return to the main program at the RTC instruction. If X35 is not on
2 Y0Y17 will be reset to off and then the CPU will return to the main body of the program.
DirectSOFT
Direct 5
SOFT32 Display X1 K3

3 C0
LD
GTS

K10

4
END
5 SBR K3

6 X20 Y5
OUTI

7 X21 Y10
OUTI

8 X35
RTC

X35 Y0 Y17

9 RSTI

10 RT

Handheld Programmer Keystrokes

11 $
STR
B
1
ENT

SHFT G T S D ENT
6 MLR RST 3
12 ?
?

SHFT E N D ENT
4 TMR 3
13 SHFT S
RST
SHFT B
1
R
ORN
D
3
ENT

$ SHFT I C A ENT
14 GX
OUT
STR

SHFT I
8

8
F
2

5
ENT
0

$ I C B
A GX
STR
SHFT

SHFT I
8
B
2
A
1
ENT

ENT
OUT 8 1 0

B $
STR
SHFT

R
I

T
8
C
D
3
F
5
ENT

SHFT ENT
ORN MLR 2

C SP
STRN
SHFT I
8
D
3
F
5
ENT

S SHFT I A B H ENT
RST 8 0 1 7
D SHFT R
ORN
T
MLR
ENT

5104 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Program Control Instructions

In the following example, when X1 is on, Subroutine K3 will be called. The CPU will jump
to the Subroutine Label K3 and the ladder logic in the subroutine will be executed. The CPU 1
will return to the main body of the program after the RT instruction is executed.
DirectSOFT
Direct SOFT532 2
X1 K3

GTS 3
4
END 5
6
SBR K3

7
X20 Y5

OUT
8
X21 Y10
9
OUT
10
RT 11
Handheld Programmer Keystrokes
12
$ B
STR
G T
1
S
ENT

D
13
SHFT ENT
6 MLR RST 3
l
l
14
l

SHFT E
4
N
TMR
D
3
ENT A
SHFT S SHFT B R D ENT

$
RST

SHFT I
1
C
ORN
A ENT
3
B
STR 8 2 0
GX
OUT
F
5
ENT
C
$ SHFT I C B ENT
STR 8 2 1
GX
OUT
B
1
A
0
ENT
D
SHFT R T ENT
ORN MLR

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5105


Chapter 5: Standard RLL - Program Control Instructions

Master Line Set (MLS)


1 DS5 Used
The Master Line Set instruction allows the program to control
HPP Used
sections of ladder logic by forming a new power rail controlled K aaa
2 by the main left power rail. The main left rail is always master
line 0. When a MLS K1 instruction is used, a new power rail is
MLS

created at level 1. Master Line Sets and Master Line Resets can
3 be used to nest power rails up to seven levels deep.

4 Operand Data Type


....................................A
DL05 Range
aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-7
5 Master Line Reset (MLR)
6 DS5 Used
The Master Line Reset instruction marks the end of control
for the corresponding MLS instruction. The MLR reference
K aaa
HPP Used MLR
is one less than the corresponding MLS.
7 Understanding Master Control Relays
8 Operand Data Type
....................................A
DL05 Range
aaa
9 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
The Master Line Set (MLS) and Master Line Reset (MLR) instructions allow you to quickly
0-7

enable (or disable) sections of the RLL program. This provides program control flexibility.
10 The following example shows how the MLS and MLR instructions operate by creating a sub
power rail for control logic.
11
12 DirectSOFT 5
Direct SOFT32
X0 K1
When contact X0 is ON, logic under the first MLS
13 MLS will be executed.

X1 Y7

14 OUT

X2 K2

A MLS
When contact X0 and X2 are ON, logic under the
second MLS will be executed.

X3 Y10

B OUT

K1

C MLR
The MLR instructions note the end of the Master
K0 Control area.

D MLR

X10 Y11
OUT

5106 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Program Control Instructions

MLS/MLR Example
In the following MLS/MLR example logic between the first MLS K1 (A) and MLR K0 (B) 1
will function only if input X0 is on. The logic between the MLS K2 (C) and MLR K1 (D)
will function only if input X10 and X0 is on. The last rung is not controlled by either of the
MLS coils.
2
DirectSOFT 5
DirectSOFT32
X0
Handheld Programmer Keystrokes 3
K1
A $ A ENT
MLS
Y
STR
B
0

ENT
4
X1 C0 MLS 1

OUT $
STR
B
1
ENT 5
X2 GX C A
C1

OUT
$
OUT
C
SHFT

ENT
2 0
ENT
6
STR 2
X3 Y0

OUT
GX
OUT
SHFT C
2
B
1
ENT 7
$ D
X10 K2
C
GX
STR
A
3
ENT
8
MLS ENT
OUT 0

X5 Y1
$
STR
B
1
A
0
ENT 9
OUT Y C

X4 Y2 $
MLS
F
2
ENT
10
ENT
STR 5
OUT

K1
GX
OUT
B
1
ENT 11
D $ E
MLR

GX
STR
C
4
ENT
12
X5 C2 ENT
OUT 2
OUT T
MLR
B
1
ENT
13
X6 Y3

OUT
$

GX
STR
F
5
C
ENT

C
14
SHFT ENT
OUT 2 2
K0

MLR
B
$
STR
G
6
ENT
A
X7 Y4

OUT
GX
OUT
D
3
ENT
B
T A ENT
MLR 0
$
STR
H
7
ENT
C
GX
OUT
E
4
C
2
ENT
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5107


Chapter 5: Standard RLL - Interrupt Instructions

1 Interrupt Instructions
Interrupt (INT)
2 The Interrupt instruction allows a section of ladder INT O aaa
DS5 Used
logic to be placed below the main body of the program
3 HPP Used
and executed only when needed. High-Speed I/O
Modes 10, 20, and 40 can generate an interrupt. With INT 1
4 Mode 40, you may select an external interrupt (input
X0), or a time-based interrupt (5999 mS).
Typically, interrupts are used in an application when a fast response to an input is needed or a
5 program section must execute faster than the normal CPU scan. The interrupt label and all
associated logic must be placed after the End statement in the program. When an interrupt
6 occurs, the CPU will complete execution of the current instruction it is processing in ladder
logic, then execute the interrupt routine. After interrupt routine execution, the ladder
7 program resumes from the point at which it was interrupted.
See Chapter 3, the section on Mode 40 (Interrupt) Operation for more details on interrupt
configuration. In the DL05, only one hardware interrupt is available.
8 Operand Data Type DL05 Range
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . O 0, 1
9
Interrupt Return (IRT)
10 DS5
An Interrupt Return is normally executed as the last instruction in the interrupt routine. It
Used
returns the CPU to the point in the main program from which
HPP Used
it was called. The Interrupt Return is a stand-alone instruction
11 (no input contact on the rung). IRT

12 Interrupt Return Conditional (IRTC)


The Interrupt Return Conditional instruction is a optional instruction used with an input
DS5 Used
contact to implement a conditional return from the interrupt
13 HPP Used
routine. The Interrupt Return is required to terminate the
IRTC
interrupt routine.
14 Enable Interrupts (ENI)
The Enable Interrupt instruction is placed in the main ladder program (before the End
A DS5
HPP
Used
instruction), enabling the interrupt. The interrupt remains
Used
enabled until the program executes a Disable Interrupt
ENI
instruction.
B
C
D

5108 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Interrupt Instructions

Disable Interrupts (DISI)


DS5 Used
A Disable Interrupt instruction in the main body of the 1
HPP Used
application program (before the End instruction) will disable
the interrupt (either external or timed). The interrupt remains
disabled until the program executes an Enable Interrupt
DISI
2
instruction.
External Interrupt Program Example
3
In the following example, we do some initialization on the first scan, using the first-scan
contact SP0. The interrupt feature is the HSIO Mode 40. Then we configure X0 as the
4
external interrupt by writing to its configuration register, V7634. See Chapter 3, Mode 40
Operation for more details. 5
During program execution, when X2 is on the interrupt is enabled. When X2 is off the
interrupt will be disabled. When an interrupt signal (X0) occurs the CPU will jump to the 6
interrupt label INT O 0. The application ladder logic in the interrupt routine will be
performed. The CPU will return to the main body of the program after the IRT instruction is
executed.
7
DirectSOFT

Handheld Programmer Keystrokes


8
SP0 LD Load the constant value
K40 (K40) into the lower 16 bits
of the accumulator
$
STR
L
SHFT

D
SP
STRN
A
0
ENT

K E A
9
OUT Copy the value in the lower SHFT SHFT ENT
16 bits of the accumulator to ANDST 3 JMP 4 0

LD
V7633
V7633

Load the constant value (K4)


GX
OUT
SHFT V
AND
H
7
G
6
D
3
D
3
ENT 10
K4 into the lower 16 bits of the L D K E
SHFT SHFT ENT
accumulator ANDST 3 JMP 4

OUT Copy the value in the lower


16 bits of the accumulator to
GX
OUT
SHFT V
AND
H
7
G
6
D
3
E
4
ENT
11
V7634
V7634 $ C ENT
X2
ENI SHFT
STR
E N
2
I ENT
12
4 TMR 8
X2
DISI
SP
STRN
D
C

I
2
S
ENT

I
13
SHFT ENT
3 8 RST 8

l
l
l
l
l
14
l
SHFT E N D ENT
END
SHFT I
4

8
N
TMR

TMR
T
MLR
3
A
0
ENT
A
INT O0
$ I B

X1 Y5
X
STR
SHFT

SHFT I
8
F
1
ENT

ENT
B
SETI SET 8 5

X3 Y7
SETI
$
STR
SHFT I
8
D
3
ENT
C
X SHFT I H ENT
SET 8 7

IRT SHFT I
8
R
ORN
T
MLR
ENT D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5109


Chapter 5: Standard RLL - Interrupt Instructions

Timed Interrupt Program Example


1 In the following example, we do some initialization on the first scan, using the first-scan
contact SP0. The interrupt feature is the HSIO Mode 40. Then we configure the HSIO timer
2 as a 10 mS interrupt by writing K104 to the configuration register for X0 (V7634). See
Chapter 3, Mode 40 Operation for more details.
3 When X4 turns on, the interrupt will be enabled. When X4 turns off, the interrupt will be
disabled. Every 10 mS the CPU will jump to the interrupt label INT O 0. The application
ladder logic in the interrupt routine will be performed. If X3 is not on Y0Y7 will be reset to
4 off and then the CPU will return to the main body of the program.
DirectSOFT 5
Direct SOFT32 Handheld Programmer Keystrokes

5 SP0
LD
K40
Load the constant value
(K40) into the lower 16 bits
of the accumulator
$
STR
B
1
ENT

SHFT L D SHFT K E A ENT

6 OUT
V7633
Copy the value in the lower
16 bits of the accumulator to
V7633
GX
OUT
ANDST

SHFT
3
V
AND
H
7
G
JMP

6
D
4

3
D
0

3
ENT

SHFT L D SHFT K B A E ENT

7 LD
K104
Load the constant value
(K10) into the lower 16 bits
GX
OUT
ANDST

SHFT
3
V
AND
H
7
G
JMP

6
D
1

3
E
0

4
ENT
4

of the accumulator
$ E

8 OUT Copy the value in the lower


16 bits of the accumulator to
SHFT
STR
E
4
N
TMR
4
I
ENT

8
ENT
V7634 V7634
SP E

9 X4

ENI
STRN

SHFT D
3
I
4

8
S
ENT

RST
I
8
ENT

10 X4
DISI
SHFT E N D ENT
4 TMR 3

11 END
SHFT I
8
N
TMR
T
MLR
A
0
ENT

$ SHFT I C ENT
STR 8 2

12 INT O0
X
SET
SHFT I
8
F
5
ENT

SP SHFT I D ENT
X2

13 Y5

SETI
STRN
X
SET
SHFT I
8

8
A
3

0
H
7
ENT

SHFT I R T ENT
X3 Y0 Y7

14 RSTI
8 ORN MLR

A IRT

B Independent Timed Interrupt


Interrupt O1 is also available as an interrupt. This interrupt is independent of the HSIO
C features. Interrupt O1 uses an internal timer that is configured in V-memory location V7647.
The interrupt period can be adjusted from 5 to 9999 mS. Once the interrupt period is set and the
interrupt is enabled in the program, the CPU will continuously call the interrupt routine based on the time
D setting in V7647.
Input Configuration Register Function Hex Code Required
V7647 High-Speed Timed Interrupt xxxx (xxxx = timer setting) 5 - 9999 mS (BCD)

5110 DL05 Micro PLC User Manual, 5th Edition, 6/04


Chapter 5: Standard RLL - Message Instructions

Message Instructions 1
Fault (FAULT)
DS5 Used
The Fault instruction is used to display a message on the handheld 2
programmer or in the DirectSOFT 5 status bar. The message has a FAULT
HPP Used
maximum of 23 characters and can be either V-memory data, A aaa 3
numerical constant data or ASCII text.
To display the value in a V-memory location, specify the V-memory location in the
instruction. To display the data in ACON (ASCII constant) or NCON (Numerical constant)
4
instructions, specify the constant (K) value for the corresponding data label area.
5
Operand Data Type DL05 Range
....................................A
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
aaa
See memory map
6
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-FFFF
7
Discrete Bit Flags
SP50 On when the FAULT instruction is executed
Description
8
Fault Example 9
In the following example when X1 is on, the message
DS5
HPP
Used
Used
SW 146 will display on the handheld programmer. FAULT :
10
The NCONs use the HEX ASCII equivalent of the *SW 146

text to be displayed. (The HEX ASCII for a blank is


20, a 1 is 31, 4 is 34 ...)
11
12
DirectSOFT 5
Direct SOFT32

X1
Handheld Programmer Keystrokes
13
FAULT $ B ENT
K1 STR 1

SHFT F
5
A
0
U
ISG
L
ANDST
T
MLR
B
1
ENT 14
DLBL
END

E N D
A
K1 SHFT ENT
4 TMR 3

ACON
A SW
SHFT D
3
L
ANDST
B
1
L
ANDST
B
1
ENT B
SHFT A C O N S W ENT

NCON
K 2031
SHFT N
TMR
0
C
2

2
INST#
O
INST#
N
TMR

TMR
C
RST

2
ANDN
A
0
D
3
B
1
ENT
C
N C O N D E D G
SHFT
TMR 2 INST# TMR 3 4 3 6
ENT
D
NCON
K 3436

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5111


Chapter 5: Standard RLL - Message Instructions

Data Label (DLBL)


1 DS5 Used
The Data Label instruction marks the beginning of an
HPP Used
ASCII/numeric data area. DLBLs are programmed DLBL K aaa
2 after the End statement. A maximum of 64 DLBL
instructions can be used in a program. Multiple
NCONs and ACONs can be used in a DLBL area.
3
Operand Data Type DL05 Range
4 ....................................A aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 1-FFFF
5
ASCII Constant (ACON)
6 DS5 Used
The ASCII Constant instruction is used with the
DLBL instruction to store ASCII text for use with
HPP Used ACON
other instructions. Two ASCII characters can be
7 stored in an ACON instruction. If only one character
A aaa

is stored in an ACON a leading space will be inserted.


8
Operand Data Type DL05 Range
9 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A
aaa
0-9 A-Z

10 Numerical Constant (NCON)


11 DS5 Used
The Numerical Constant instruction is used with the
DLBL instruction to store the HEX ASCII equivalent
NCON
HPP Used K aaa
of numerical data for use with other instructions. Two
12 digits can be stored in an NCON instruction.

13 Operand Data Type DL05 Range


aaa
14 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 0-FFFF

A
B
C
D

5112 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Message Instructions

Data Label Example


In the following example, an ACON and two NCON instructions are used within a DLBL 1
instruction to build a text message. See the FAULT instruction for information on displaying
messages. The DV-1000 Manual also has information on displaying messages. 2
DirectSOFT 5
Direct SOFT32
3
4
END
5
DLBL
K1 6
ACON
A SW
7
8
NCON
K 2031
9
10
NCON
K 3436
11
Handheld Programmer Keystrokes
12
13
SHFT E N D ENT

SHFT D
4
L
TMR
B
3
L B ENT
14
3 ANDST 1 ANDST 1

SHFT A
0
C
2
O
INST#
N
TMR
S
RST
W
ANDN
ENT A
N C O N C A D B
SHFT

SHFT N
TMR
C
2 INST#
O N
TMR
D
2
E
0
D
3
G
1
ENT

ENT
B
TMR 2 INST# TMR 3 4 3 6

C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5113


Chapter 5: Standard RLL - Message Instructions

Print Message (PRINT)


1 DS5 Used
The Print Message instruction prints the embedded text PRINT A aaa
HPP N/A
or text/data variable message to the specified, configured, Hello, this is a PLC message
2 communications port (Port 2 on the DL05 CPU).

3 Operand Data Type


....................................A
DL05 Range
aaa
Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K 2
4
You may recall from the CPU specifications in Chapter 4 that the DL05s ports are capable of
5 several protocols. Port 1 cannot be configured for the non-sequence protocol. To configure
port 2 using the Handheld Programmer, use AUX 56 and follow the prompts, making the
same choices as indicated below on this page. To configure a port in DirectSOFT, choose the
6 PLC > Setup > Setup Secondary Comm Port.
Port: From the port number list box at the top, choose Port 2.
7 Protocol: Click the check box to the left of Non-sequence, and then youll see the dialog box
shown below.
8
9
10
11
12
13
14
Baud Rate: Choose the baud rate that matches your printer.
A Stop Bits, Parity: Choose number of stop bits and parity setting to match your printer.
Memory Address: Choose a V-memory address to be used by DirectSOFT to store the port setup
B information. You will need to reserve 66 contiguous words in V-memory for this purpose.

NOTE: See Chapter 4 for a detail of the non-sequence setup.


C
Then click the button indicated to send the Port 2 configuration to the CPU,
D and click Close. Then see Chapter 3 for port wiring information, in order to
connect your printer to the DL05.

5114 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Message Instructions

Port 2 on the DL05 has standard RS232 levels, and should work with most printer serial
input connections. 1
Text element this is used for printing character strings. The character strings are defined as
the character (more than 0) ranged by the double quotation marks. Two hex numbers
preceded by the dollar sign means an 8-bit ASCII character code. Also, two characters
2
preceded by the dollar sign is interpreted according to the following table:
3
# Character code Description
1
2
$$
$
Dollar sign ($)
Double quotation ()
4
3 $L or $l Line feed (LF)
4 $N or $n Carriage return line feed (CRLF) 5
5 $P or $p Form feed
6
7
$R or $r
$T or $t
Carriage return (CR)
Tab
6
The following examples show various syntax conventions and the length of the output to the 7
printer.
Example: 8
Length 0 without character
A Length 1 with character A 9
Length 1 with blank
$ Length 1 with double quotation mark 10
$R$L Length 2 with one CR and one LF
$0D$0A Length 2 with one CR and one LF 11
$$ Length 1 with one $ mark
In printing an ordinary line of text, you will need to include double quotation marks before
12
and after the text string. Error code 499 will occur in the CPU when the print instruction
contains invalid text or no quotations. It is important to test your PRINT instruction data 13
during the application development.
The following example prints the message to port 2. We use a PD contact, which causes the 14
message instruction to be active for just one scan. Note the $N at the end of the message,
which produces a carriage return / line feed on the printer. This prepares the printer to print
the next line, starting from the left margin.
A
X1
B
PRINT K2 Print the message to Port 2 when
Hello, this is a PLC message.$N X1 makes an off-to-on transition. C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5115


Chapter 5: Standard RLL - Message Instructions

V-memory element - this is used for printing V-memory contents in the integer format or
1 real format. Use V-memory number or V-memory number with - and data type. The data
types are shown in the table below. The Character code must be capital letters.
2 NOTE: There must be a space entered before and after the V-memory address to separate it from the
text string. Failure to do this will result in an error code 499.
3 # Character code Description
1 none 16-bit binary (decimal number)
4 2 :B 4 digit BCD
3 :D 32-bit binary (decimal number)
5 4 :DB 8 digit BCD

Example:
6 V2000 Print binary data in V2000 for decimal number
V2000 : B Print BCD data in V2000
7 V2000 : D Print binary number in V2000 and V2001 for decimal number
8 V2000 : D B Print BCD data in V2000 and V2001
Example: The following example prints a message containing text and a variable. The reactor
9 temperature labels the data, which is at V2000. You can use the : B qualifier after the V2000
if the data is in BCD format, for example. The final string adds the units of degrees to the
line of text, and the $N adds a carriage return / line feed.
10 X1 PRINT K2 Print the message to Port 2
Reactor temperature = V2000 deg. $N when X1 makes an off-to-on
11 Message will read:
transition.
represents a space

Reactor temperature = 0156 deg


12 V-memory text element This is used for printing text stored in V-memory. Use the %
followed by the number of characters after V-memory number for representing the text. If
13 you assign 0 as the number of characters, the print function will read the character count
from the first location. Then it will start at the next V-memory location and read that number
14 of ASCII codes for the text from memory.
Example:
A V2000 % 16 16 characters in V2000 to V2007 are printed.
V2000 % 0 The characters in V2001 to Vxxxx (determined by the number in V2000)
B will be printed.

C
D

5116 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Message Instructions

Bit element this is used for printing the state of the designated bit in V-memory or a relay
bit. The bit element can be assigned by the designating point (.) and bit number preceded by 1
the V-memory number or relay number. The output type is described as shown in the table
below. 2
# Data format Description
1 none Print 1 for an ON state, and 0 for an
OFF state
3
2 : BOOL Print TRUE for an ON state, and

3 : ONOFF
FALSE for an OFF state
Print ON for an ON state, and
4
OFF for an OFF state

Example:
5
V2000 . 15 Prints the status of bit 15 in V2000, in 1/0 format
C100 Prints the status of C100 in 1/0 format
6
C100 : BOOL Prints the status of C100 in TRUE/FALSE format 7
C100 : ON/OFF Prints the status of C00 in ON/OFF format
V2000.15 : BOOL Prints the status of bit 15 in V2000 in TRUE/FALSE format 8
The maximum numbers of characters you can print is 128. The number of characters for
each element is listed in the table below: 9
Element Type Maximum Characters
Text, 1 character 1 10
16 bit binary 6
32 bit binary
4 digit BCD
11
4
11
8 digit BCD 8
Floating point (real number) 12 12
Floating point (real with exponent) 12
V-memory/text
Bit (1/0 format)
2
1
13
Bit (TRUE/FALSE format) 5
Bit (ON/OFF format) 3 14
The handheld programmers mnemonic is PRINT, followed by the DEF field.
Special relay flags SP116 and SP117 indicate the status of the DL05 CPU ports (busy, or
A
communications error). See the appendix on special relays for a description.
B
NOTE: You must use the appropriate special relay in conjunction with the PRINT command to ensure
the ladder program does not try to PRINT to a port that is still busy from a previous PRINT or WX or
RX instruction.
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5117


Chapter 5: Standard RLL - Intelligent I/O Instructions

1 Intelligent I/O Instructions


Read from Intelligent Module (RD)
2 DS32
The Read from Intelligent Module instruction reads a block of
Used
data (1-128 bytes maximum) from an intelligent I/O module RD
HPP Used
3 into the CPUs V-memory. It loads the function parameters into
the first and second level of the accumulator stack and the
V aaa

accumulator by three additional instructions.


4 Listed below are the steps to program the Read from Intelligent module function.
5 Step 1: Load the base number (0-3) into the first byte and the slot number (0-7) into the
second byte of the second level of the accumulator stack.
Step 2: Load the number of bytes to be transferred into the first level of the accumulator
6 stack (maximum of 128 bytes).
Step 3: Load the address from which the data will be read into the accumulator. This
7 parameter must be a HEX value.
Step 4: Insert the RD instruction which specifies the starting V-memory location (Vaaa)
8 where the data will be read into.
Helpful Hint: Use the LDA instruction to convert an octal address to its HEX equivalent
9 and load it into the accumulator when the HEX format is required.
Operand Data Type DL06 Range
10 aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map
11 Discrete Bit Flags Description
SP54 On when RX, WX RD, WT instructions are executed with the wrong parameters.
12 NOTE: Status flags are valid only until another instruction uses the same flag.

13 In the following example when X1 is ON, the RD instruction will read six bytes of data from
a intelligent module in base 1, slot 2 starting at address 0 in the intelligent module and copy
the information into V-memory loacations V1400-V1402.
14 CPU Intelligent Module
Direct SOFT 5
Data

A X1 LD
The constant value K0102

}
specifies the base number V1400 3 4 1 2 12 Address 0

{
K0102 (01) and the base slot V1401 7 8 5 6 34 Address 1
number (02).
V1402 0 1 9 0 56 Address 2

B LD
K6
The constant value K6
specifies the number of
bytes to be read.
V1403
V1404
X
X
X
X
X
X
X
X
78
90
01
Address 3
Address 4
Address 5

The constant value K0

C LD
K0
specifies the starting address
in the intelligent module.
Handheld Programmer Keystrokes

$
STR
B
1
ENT

V1400 is the starting location L D A B A C


RD

D V1400
in the CPU where the specified
data will be stored.
SHFT

SHFT
ANDST
L
ANDST
D
3

3
PREV

PREV G
0

6
ENT
1 0 2
ENT

L D A
SHFT PREV ENT
ANDST 3 0

R D B E A A
SHFT ENT
ORN 3 1 4 0 0

5118 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Intelligent I/O Instructions

Write to Intelligent Module (WT)


DS32 Used
The Write to Intelligent Module instruction writes a block of 1
data (1-128 bytes maximum) to an intelligent I/O module WT
HPP Used
from a block of V-memory in the CPU. The function
parameters are loaded into the first and second level of the
V aaa 2
accumulator stack and the accumulator by three additional
instructions. 3
Listed below are the steps to program the Read from Intelligent module function.
Step 1: Load the base number (0-3) into the first byte and the slot number (0-7) into the
4
second byte of the second level of the accumulator stack.
Step 2: Load the number of bytes to be transferred into the first level of the accumulator 5
stack (maximum of 128 bytes).
Step 3: Load the intelligent module address which will receive the data into the 6
accumulator. This parameter must be a HEX value.
Step 4: Insert the WT instruction which specifies the starting V-memory location (Vaaa) 7
where the data will be written from in the CPU.
Helpful Hint: Use the LDA instruction to convert an octal address to its HEX equivalent 8
and load it into the accumulator when the HEX format is required.
Operand Data Type DL06 Range 9
aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See memory map 10
Discrete Bit Flags Description
SP54 On when RX, WX RD, WT instructions are executed with the wrong parameters. 11
NOTE: Status flags are valid only until another instruction uses the same flag. 12
In the following example, when X1 is on, the WT instruction will write six bytes of data to an
intelligent module in base 1, slot 2 starting at address 0 in the intelligent module and copy 13
Direct SOFT 5
CPU Intelligent Module
Data
14
V1377 12 Address 0
X X X X

{
The constant value K0102
X1 LD
K0102
specifies the base number
(01) and the base slot
number (02).
V1400
V1401
V1402
3
7
0
4
8
1
1
5
9
2
6
0 }
34
56
78
Address 1
Address 2
Address 3
A
The constant value K6 90 Address 4
V1403 X X X X
LD
K6
specifies the number of
bytes to be written. V1404 X X X X
01 Address 5
B
LD The constant value K0
Handheld Programmer Keystrokes
K0
specifies the starting address
in the intelligent module. $
STR
B
1
ENT C
V1400 is the starting location L D A B A C
WT SHFT PREV ENT
in the CPU where the specified ANDST 3 0 1 0 2
V1400 data will be written from.
SHFT L
ANDST
D
3
PREV G
6
ENT D
L D A
SHFT PREV ENT
ANDST 3 0
W T B E A A
SHFT ENT
ANDN MLR 1 4 0 0

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5119


Chapter 5: Standard RLL - Network Instructions

1 Network Instructions
Read from Network (RX)
2 The Read from Network instruction causes the master device on a
DS5 Used
network to read a block of data from a slave device on the same
3 HPP Used
network. The function parameters are loaded into the accumulator
RX
A aaa
and the first and second level of the stack. Listed below are the
4 program steps necessary to execute the Read from Network
function.
Step 1: Load the slave address (090 BCD) into the low byte and F2 into the high byte
5 of the accumulator (the next two instructions push this word down to the second layer of the
stack).
6 Step 2: Load the number of bytes to be transferred into the accumulator, 2 - 128 bytes are
allowed, (the next instruction pushes this word onto the top of the stack).
7 Step 3: Load the starting Master CPU address into the accumulator. This is the memory
location where the data read from the slave will be put. This parameter requires a HEX value.
8 Step 4: Insert the RX instruction which specifies the starting V-memory location (Aaaa)
where the data will be read from in the slave.
9 Helpful Hint: For parameters that require HEX values, the LDA instruction can be used to
convert an octal address to the HEX equivalent and load the value into the accumulator.
10 Operand Data Type DL05 Range
A aaa
11 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 328)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V-memory. (See page 328)
12 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0377
0377

13 Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0777
0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
14 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP
0177
0777

A Program Memory . . . . . . . . . . . . . . . . . . . . . . . $ 02047 (2K program mem.)

B
C
D

5120 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Network Instructions

In the following example, when X1 is on and the port busy relay SP116 (see special relays) is
not on, the RX instruction will access port 2 operating as a master. Ten consecutive bytes of 1
data (V2000 V2004) will be read from a CPU at station address 5 and copied into
V-memory locations V2300V2304 in the CPU with the master port.
DirectSOFT 5
2
DirectSOFT

X1 SP116 LD
KF205
3
Master Slave
The constant value KF205
specifies the port number (2)
and the slave address (5)
CPU CPU 4
LD
K10
V2277 X X X X X X X X V1777
5
The constant value K10
specifies the number of
bytes to be read (2-128
V2300
V2301
3
8
4
5
5
3
7
4
3
8
4
5
5
3
7
4
V2000
V2001
6
bytes allowed) V2302 1 9 3 6 1 9 3 6 V2002

LDA V2303 9
1
5
4
7
2
1
3
9
1
5
4
7
2
1
3
V2003 7
O 2300 V2304 V2004

Octal address 2300 is


converted to 4C0 HEX and
V2305 X X X X X X X X V2005
8
loaded into the accumulator
.
V2300 is the starting
location for the Master CPU
where the specified data will
9
be read into

RX
10
V2000

V2000 is the starting


location in the for the Slave
11
CPU where the specified
data will be read from

HandheldProgrammer Keystrokes
12
$
STR
B
1
ENT 13
W SHFT SP B B G ENT
ANDN

SHFT L D
STRN

SHFT
1
K
1 6

SHFT F SHFT C A F ENT


14
ANDST 3 JMP 5 2 0 5

SHFT L
ANDST
D
3
SHFT K
JMP
B
1
A
0
ENT A
SHFT L D A C D A A ENT

SHFT
ANDST
R X
3 0
C A
2
A
3
A
0

ENT
0
B
ORN SET 2 0 0 0

C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5121


Chapter 5: Standard RLL - Network Instructions

Write to Network (WX)


1 DS5 Used
The Write to Network instruction is used to write a
block of data from the master device to a slave device on
2 HPP Used
the same network. The function parameters are loaded
into the accumulator and the first and second level of
WX
A aaa
the stack. Listed below are the program steps necessary
3 to execute the Write to Network function.
Step 1: Load the slave address (090 BCD) into the low byte and F2 into the high byte
4 of the accumulator (the next two instructions push this word down to the second layer of the
stack).
5 Step 2: Load the number of bytes to be transferred into the accumulator, 2-128 bytes are
allowed, (the next instruction pushes this word onto the top of the stack).
6 Step 3: Load the starting Master CPU address into the accumulator. This is the memory
location where the data will be written from. This parameter requires a HEX value.
7 Step 4: Insert the WX instruction which specifies the starting V-memory location (Aaaa)
where the data will be written to in the slave.
8 Helpful Hint: For parameters that require HEX values, the LDA instruction can be used to
convert an octal address to the HEX equivalent and load the value into the accumulator.
9 Operand Data Type DL05 Range
....................................A aaa
10 V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V All (See page 328)
Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P All V-memory (See page 328)
11 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y
0377
0377
Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C 0777
12 Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 0377
Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T 0177
13 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CT
Special Relay . . . . . . . . . . . . . . . . . . . . . . . . . . SP
0177
0777
Program Memory . . . . . . . . . . . . . . . . . . . . . . . $ 02048 (2K program mem.)
14
A
B
C
D

5122 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Standard RLL - Network Instructions

In the following example when X1 is on and the module busy relay SP116 (see special relays)
is not on, the WX instruction will access port 2 operating as a master. Ten consecutive bytes 1
of data is read from the Master CPU and copied to V-memory locations V2000V2004 in
the slave CPU at station address 5.
DirectSOFT
DirectSOFT5
2
X1 SP116 LD
KF205
3
Master Slave
The constant value KF205
specifies the port number (2)
and the slave address (5)
CPU CPU 4
LD
K10
V2277 X X X X X X X X V1777
5
The constant value K10 V2300 3 4 5 7 3 4 5 7 V2000
specifies the number of
bytes to be written (2-128 V2301 8 5 3 4 8 5 3 4 V2001 6
bytes allowed) V2302 1 9 3 6 1 9 3 6 V2002

LDA
O 2300
V2303
V2304
9
1
5
4
7
2
1
3
9
1
5
4
7
2
1
3
V2003
V2004
7
V2305 X X X X X X X X V2005
Octal address 2300 is
converted to 4C0 HEX and
. 8
loaded into the accumulator
V2300 is the starting
location for the Master CPU
where the specified data will
9
be read from.

WX
V2000
10
V2000 is the starting
location in the for the Slave
CPU where the specified
11
data will be written to

HandheldProgrammer Keystrokes
12
$
STR
B
1
ENT
13
W SHFT SP B C E ENT
ANDN STRN 1 1 6

SHFT L
ANDST
D
3
SHFT K
JMP
SHFT F SHFT
C
2
A
0
F
5
ENT
14
5

SHFT L
ANDST
D
3
SHFT K
JMP
B
1
A
0
ENT A
SHFT L D A C D A A ENT
ANDST 3 0 2 3 0 0

SHFT W X C A A A ENT
B
ANDN SET 2 0 0 0

C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5123


Chapter 5: Intelligent Box (IBox) Instructions

1 Intelligent Box (IBox) Instructions


The Intelligent Box Instructions (commonly refered to as IBox Instructions) listed in this
section are additional, and much different looking, instructions made available with the
2 release of DirectSOFT 5. The DL05 PLC requires firmware version v5.10 or later to use the
new DirectSOFT 5 features. For more information on DirectSOFT 5, please visit our website
3 at: www.automationdirect.com.

Analog Helper IBoxes


4 Instruction Ibox # Page
Analog Input / Output Combo Module Pointer Setup (ANLGCMB) IB-462 5-126
5 Analog Input Module Pointer Setup (ANLGIN) IB-460 5-128
Analog Output Module Pointer Setup (ANLGOUT) IB-461 5-130
6 Analog Scale 12 Bit BCD to BCD (ANSCL)
Analog Scale 12 Bit Binary to Binary (ANSCLB)
IB-423
IB-403
5-132
5-134
Filter Over Time - BCD (FILTER) IB-422 5-136
7 Filter Over Time - Binary (FILTERB) IB-402 5-138
Hi/Low Alarm - BCD (HILOAL) IB-421 5-140
8 Hi/Low Alarm - Binary (HILOALB) IB-401 5-142

Discrete Helper IBoxes


9 Instruction Ibox # Page
Off Delay Timer (OFFDTMR) IB-302 5-144
10 On Delay Timer (ONDTMR)
One Shot (ONESHOT)
IB-301
IB-303
5-146
5-148
Push On / Push Off Circuit (PONOFF) IB-300 5-149
11
Memory IBoxes
12 Instruction Ibox # Page
Move Single Word (MOVEW) IB-200 5-150

13 Move Double Word (MOVED) IB-201 5-151

Math IBoxes
14 Instruction Ibox # Page
Math - BCD (MATHBCD) IB-521 5-152
A Math - Binary (MATHBIN)
Square BCD (SQUARE)
IB-501
IB-523
5-154
5-156
Square Binary (SQUAREB) IB-503 5-157
B Sum BCD Numbers (SUMBCD) IB-522 5-158
Sum Binary Numbers (SUMBIN) IB-502 5-159
C
D

5124 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) Instructions

Communication IBoxes
1
Instruction Ibox # Page
ECOM100 Configuration (ECOM100) IB-710 5-160
2
ECOM100 Disable DHCP (ECDHCPD) IB-736 5-162
ECOM100 Enable DHCP (ECDHCPE) IB-735 5-164 3
ECOM100 Query DHCP Setting (ECDHCPQ) IB-734 5-166
ECOM100 Send E-mail (ECEMAIL)
ECOM100 Restore Default E-mail Setup (ECEMRDS)
IB-711
IB-713
5-168
5-171
4
ECOM100 E-mail Setup (ECEMSUP) IB-712 5-174
ECOM100 IP Setup (ECIPSUP) IB-717 5-178 5
ECOM100 Read Description (ECRDDES) IB-726 5-180
ECOM100 Read Gateway Address (ECRDGWA)
ECOM100 Read IP Address (ECRDIP)
IB-730
IB-722
5-182
5-184
6
ECOM100 Read Module ID (ECRDMID) IB-720 5-186
ECOM100 Read Module Name (ECRDNAM) IB-724 5-188 7
ECOM100 Read Subnet Mask (ECRDSNM) IB-732 5-190
ECOM100 Write Description (ECWRDES)
ECOM100 Write Gateway Address (ECWRGWA)
IB-727
IB-731
5-192
5-194
8
ECOM100 Write IP Address (ECWRIP) IB-723 5-196
ECOM100 Write Module ID (ECWRMID) IB-721 5-198 9
ECOM100 Write Name (ECWRNAM) IB-725 5-200
ECOM100 Write Subnet Mask (ECWRSNM)
ECOM100 RX Network Read (ECRX)
IB-733
IB-740
5-202
5-204
10
ECOM100 WX Network Write(ECWX) IB-741 5-207
NETCFG Network Configuration (NETCFG) IB-700 5-210 11
Network RX Read (NETRX) IB-701 5-212
Network WX Write (NETWX) IB-702 5-215
12
Counter I/O IBoxes (Work with H0-CTRIO and H0-CTRIO2)
Instruction Ibox # Page 13
CTRIO Configuration (CTRIO) IB-1000 5-218
CTRIO Add Entry to End of Preset Table (CTRADPT)
CTRIO Clear Preset Table (CTRCLRT)
IB-1005
IB-1007
5-220
5-223
14
CTRIO Edit Preset Table Entry (CTREDPT) IB-1003 5-226
CTRIO Edit Preset Table Entry and Reload (CTREDRL) IB-1002 5-230 A
CTRIO Initialize Preset Table (CTRINPT) IB-1004 5-234
CTRIO Initialize Preset Table (CTRINTR)
CTRIO Load Profile (CTRLDPR)
IB-1010
IB-1001
5-238
5-242
B
CTRIO Read Error (CTRRDER) IB-1014 5-244
CTRIO Run to Limit Mode (CTRRTLM) IB-1011 5-246 C
CTRIO Run to Position Mode (CTRRTPM) IB-1012 5-249
CTRIO Velocity Mode (CTRVELO)
CTRIO Write File to ROM (CTRWFTR)
IB-1013
IB-1006
5-251
5-254
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5125


Chapter 5: Intelligent Box (IBox) - Analog Helper

Analog Input/Output Combo Module Pointer Setup (ANLGCMB) (IB-462)


1 DS5 Used
The Analog Input/Output Combo Module Pointer Setup instruction generates the logic to
configure the pointer method for an analog input/output combination module on the first
2 HPP N/A PLC scan following a Program to Run transition.
The ANLGCMB IBox instruction
3 determines the data format and Pointer
addresses based on the CPU type, the
Base# and the module Slot#.
4 The Input Data Address is the starting
location in user V-memory where the
5 analog input data values will be stored,
one location for each input channel
6 enabled.
The Output Data Address is the starting
7 location in user V-memory where the
analog output data values will be placed
by ladder code or external device, one location for each output channel enabled.
8 Since the IBox logic only executes on the first scan, the instruction cannot have any input logic.

9 ANLGCMB Parameters
Base # (K0-Local): must be 0 for DL05 PLC
10 Slot #: specifies the single PLC option slot that is occupied by the module
Number of Input Channels: specifies the number of analog input channels to scan
11 Input Data Format (0-BCD 1-BIN): specifies the analog input data format (BCD or Binary) - the
binary format may be used for displaying data on some OI panels
12 Input Data Address: specifies the starting V-memory location that will be used to store the analog
input data
13 Number of Output Channels: specifies the number of analog output channels that will be used
Output Data Format (0-BCD 1-BIN): specifies the format of the analog output data (BCD or
14 Binary)
Output Data Address: specifies the starting V-memory location that will be used to source the
analog output data
A
B Parameter
Base # (K0-Local) . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0 (local base only)
Slot # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K1
C Number of Input Channels . . . . . . . . . . . . . . . . K K1-8
Input Data Format (0-BCD 1-BIN) . . . . . . . . . . . K BCD: K0; Binary: K1
D Input Data Address . . . . . . . . . . . . . . . . . . . . . . V
Number of Output Channels . . . . . . . . . . . . . . . K
See DL05 V-memory map - Data Words
K1-8
Output Data Format (0-BCD 1-BIN) . . . . . . . . . K BCD: K0; Binary: K1
Output Data Address . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

5126 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

ANLGCMB Example
In the following example, the ANLGCMB instruction is used to setup the pointer method 1
for an analog I/O combination module that is installed in option slot 2. Four input channels
are enabled and the analog data will be written to V2000 - V2003 in BCD format. Two
output channels are enabled and the analog values will be read from V2100 - V2101 in BCD
2
format.
3
4
5
No permissive contact or input logic is
used with this instruction 6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5127


Chapter 5: Intelligent Box (IBox) - Analog Helper

Analog Input Module Pointer Setup (ANLGIN) (IB-460)


1 Analog Input Module Pointer Setup generates the logic to configure the pointer method for
DS5 Used one analog input module on the first PLC scan following a Program to Run transition.
2 HPP N/A
This IBox determines the data format and Pointer addresses based on the CPU type, the
Base#, and the Slot#.
3 The Input Data Address is the starting
location in user V-memory where the
4 analog input data values will be stored,
one location for each input channel
enabled.
5 Since this logic only executes on the
first scan, this IBox cannot have any
6 input logic.

7 ANLGIN Parameters
Base # (K0-Local): must be 0 for DL05 PLC
8 Slot #: specifies the single PLC option slot that is occupied by the module
Number of Input Channels: specifies the number of input channels to scan
9 Input Data Format (0-BCD 1-BIN): specifies the analog input data format (BCD or Binary) - the
binary format may be used for displaying data on some OI panels
10 Input Data Address: specifies the starting V-memory location that will be used to store the analog
input data

11 Parameter DL05 Range


Base # (K0-Local) . . . . . . . . . . . . . . . . . . . . . . . K K0 (local base only)
12 Slot # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Number of Input Channels . . . . . . . . . . . . . . . . K
K1
K1-8
Input Data Format (0-BCD 1-BIN) . . . . . . . . . . . K BCD: K0; Binary: K1
13 Input Data Address . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

14
A
B
C
D

5128 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

ANLGIN Example
In the following example, the ANLGIN instruction is used to setup the pointer method for 1
an analog input module that is installed in option slot 1. Eight input channels are enabled
and the analog data will be written to V2000 - V2007 in BCD format. 2
3
4
No permissive contact or input logic is
5
used with this instruction
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5129


Chapter 5: Intelligent Box (IBox) - Analog Helper

Analog Output Module Pointer Setup (ANLGOUT) (IB-461)


1 Analog Output Module Pointer Setup generates the logic to configure the pointer method for
DS5 Used one analog output module on the first PLC scan following a Program to Run transition.
2 HPP N/A This IBox determines the data format and Pointer addresses based on the CPU type, the
Base#, and the Slot#.
3 The Output Data Address is the starting
location in user V-memory where the
4 analog output data values will be placed
by ladder code or external device, one
location for each output channel
5 enabled.
Since this logic only executes on the first
6 scan, this IBox cannot have any input
logic.
7
ANLGOUT Parameters
8 Base # (K0-Local): must be 0 for DL05 PLC
Slot #: specifies the single PLC option slot that is occupied by the module
9 Number of Output Channels: specifies the number of analog output channels that will be used
Output Data Format (0-BCD 1-BIN): specifies the format of the analog output data (BCD or
10 Binary)
Output Data Address: specifies the starting V-memory location that will be used to source the
analog output data
11
Parameter DL05 Range
12 Base # (K0-Local) . . . . . . . . . . . . . . . . . . . . . . . K K0 (local base only)
Slot # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K1

13 Number of Output Channels . . . . . . . . . . . . . . . K


Output Data Format (0-BCD 1-BIN). . . . . . . . . . K
K1-8
BCD: K0; Binary: K1
Output Data Address . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
14
A
B
C
D

5130 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

ANLGOUT Example
In the following example, the ANLGOUT instruction is used to setup the pointer method 1
for an analog output module that is installed in option slot 3. Two output channels are
enabled and the analog data will be read from V2100 - V2101 in BCD format. 2
3
4
5
No permissive contact or input logic is
used with this instruction
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5131


Chapter 5: Intelligent Box (IBox) - Analog Helper

Analog Scale 12 Bit BCD to BCD (ANSCL) (IB-423)


1 Analog Scale 12 Bit BCD to BCD scales a 12 bit BCD analog value (0-4095 BCD) into
DS5 Used BCD engineering units. You specify the engineering unit high value (when raw is 4095), and
2 HPP N/A the engineering low value (when raw is 0), and the output V memory address you want the to
place the scaled engineering unit value. The
engineering units are generated as BCD and can
3 be the full range of 0 to 9999 (see ANSCLB -
Analog Scale 12 Bit Binary to Binary if your raw
4 units are in Binary format).
Note that this IBox only works with unipolar
5 unsigned raw values. It does NOT work with
bipolar or sign plus magnitude raw values.
6 ANSCL Parameters
7 Raw (0-4095 BCD): specifies the V-memory location of the unipolar unsigned raw 0-4095
unscaled value
High Engineering: specifies the high engineering value when the raw input is 4095
8 Low Engineering: specifies the low engineering value when the raw input is 0
Engineering (BCD): specifies the V-memory location where the scaled engineering BCD value will
9 be placed

10 Parameter DL05 Range


Raw (0-4095 BCD) . . . . . . . . . . . . . . . . . . . . . V,P See DL05 V-memory map - Data Words

11 High Engineering . . . . . . . . . . . . . . . . . . . . . . . . K
Low Engineering . . . . . . . . . . . . . . . . . . . . . . . . K
K0-9999
K0-9999
Engineering (BCD). . . . . . . . . . . . . . . . . . . . . . V,P See DL05 V-memory map - Data Words
12
13
14
A
B
C
D

5132 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

ANSCL Example
In the following example, the ANSCL instruction is used to scale a raw value (0-4095 BCD) 1
that is in V2000. The engineering scaling range is set 0-100 (low engineering value - high
engineering value). The scaled value will be placed in V2100 in BCD format. 2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5133


Chapter 5: Intelligent Box (IBox) - Analog Helper

Analog Scale 12 Bit Binary to Binary (ANSCLB) (IB-403)


1 Analog Scale 12 Bit Binary to Binary scales a 12 bit binary analog value (0-4095 decimal)
DS5 Used into binary (decimal) engineering units. You specify the engineering unit high value (when
2 HPP N/A raw is 4095), and the engineering low value (when raw is 0), and the output V-memory
address you want to place the scaled engineering unit value. The engineering units are
generated as binary and can be the full range of 0 to 65535 (see ANSCL - Analog Scale 12 Bit
3 BCD to BCD if your raw units are in BCD format).
Note that this IBox only works with unipolar
4 unsigned raw values. It does NOT work with
bipolar, sign plus magnitude, or signed 2's
5 complement raw values.

6
7 ANSCLB Parameters
Raw (12 bit binary): specifies the V-memory location of the unipolar unsigned raw decimal
8 unscaled value (12 bit binary = 0-4095 decimal)
High Engineering: specifies the high engineering value when the raw input is 4095 decimal
9 Low Engineering: specifies the low engineering value when the raw input is 0 decimal
Engineering (binary): specifies the V-memory location where the scaled engineering decimal value
10 will be placed

11
12 Parameter DL05 Range
Raw (12 bit binary) . . . . . . . . . . . . . . . . . . . . V,P See DL05 V-memory map - Data Words
13 High Engineering . . . . . . . . . . . . . . . . . . . . . . . . K K0-65535
Low Engineering . . . . . . . . . . . . . . . . . . . . . . . . K K0-65535
14 Engineering (binary) . . . . . . . . . . . . . . . . . . . . V,P See DL05 V-memory map - Data Words

A
B
C
D

5134 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

ANSCLB Example
In the following example, the ANSCLB instruction is used to scale a raw value (0-4095 1
binary) that is in V2000. The engineering scaling range is set 0-1000 (low engineering value -
high engineering value). The scaled value will be placed in V2100 in binary format. 2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5135


Chapter 5: Intelligent Box (IBox) - Analog Helper

Filter Over Time - BCD (FILTER) (IB-422)


1 DS5 Used
Filter Over Time BCD will perform a first-order filter on the Raw Data on a defined time
interval. The equation is:
2 HPP N/A
New = Old + [(Raw - Old) / FDC] where,
New: New Filtered Value
3 Old: Old Filtered Value
FDC: Filter Divisor Constant
4 Raw: Raw Data
The Filter Divisor Constant is an integer in the
5 range K1 to K100, such that if it equaled K1
then no filtering would be done.
6 The rate at which the calculation is performed is specified by time in hundredths of a second
(0.01 seconds) as the Filter Freq Time parameter. Note that this Timer instruction is
7 embedded in the IBox and must NOT be used anywhere else in your program. Power flow
controls whether the calculation is enabled. If it is disabled, the Filter Value is not updated.
On the first scan from Program to Run mode, the Filter Value is initialized to 0 to give the
8 calculation a consistent starting point.

9 FILTER Parameters
Filter Frequency Timer: specifies the Timer (T) number which is used by the Filter instruction
10 Filter Frequency Time (0.01sec): specifies the rate at which the calculation is performed
Raw Data (BCD): specifies the V-memory location of the raw unfiltered BCD value
11 Filter Divisor (1-100): this constant used to control the filtering effect. A larger value will increase
the smoothing effect of the filter. A value of 1 results with no filtering.
12 Filtered Value (BCD): specifies the V-memory location where the filtered BCD value will be placed

13 Parameter DL05 Range


Filter Frequency Timer . . . . . . . . . . . . . . . . . . . T T0-177
14 Filter Frequency Time (0.01 sec) . . . . . . . . . . . K
Raw Data (BCD) . . . . . . . . . . . . . . . . . . . . . . . . V
K0-9999
See DL05 V-memory map - Data Words
Filter Divisor (1-100) . . . . . . . . . . . . . . . . . . . . . K K1-100
A Filtered Value (BCD) . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

B
C
D

5136 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

FILTER Example
In the following example, the Filter instruction is used to filter a BCD value that is in V2000. 1
Timer(T0) is set to 0.5 sec, the rate at which the filter calculation will be performed. The
filter constant is set to 2. A larger value will increase the smoothing effect of the filter. A value
of 1 results with no filtering. The filtered value will be placed in V2100.
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5137


Chapter 5: Intelligent Box (IBox) - Analog Helper

Filter Over Time - Binary (FILTERB) (IB-402)


1 Filter Over Time in Binary (decimal) will perform a first-order filter on the Raw Data on a
defined time interval. The equation is:
2 DS5
HPP
Used
N/A New = Old + [(Raw - Old) / FDC] where

3 New: New Filtered Value


Old: Old Filtered Value
4 FDC: Filter Divisor Constant
Raw: Raw Data
5 The Filter Divisor Constant is an integer in the
range K1 to K100, such that if it equaled K1
6 then no filtering would be done.
The rate at which the calculation is performed is specified by time in hundredths of a second
7 (0.01 seconds) as the Filter Freq Time parameter. Note that this Timer instruction is
embedded in the IBox and must NOT be used anywhere else in your program. Power flow
8 controls whether the calculation is enabled. If it is disabled, the Filter Value is not updated.
On the first scan from Program to Run mode, the Filter Value is initialized to 0 to give the
9 calculation a consistent starting point.

10 FILTERB Parameters
Filter Frequency Timer: specifies the Timer (T) number which is used by the Filter instruction
11 Filter Frequency Time (0.01sec): specifies the rate at which the calculation is performed
Raw Data (Binary): specifies the V-memory location of the raw unfiltered binary (decimal) value
12 Filter Divisor (1-100): this constant used to control the filtering effect. A larger value will increase
the smoothing effect of the filter. A value of 1 results with no filtering.

13 Filtered Value (Binary): specifies the V-memory location where the filtered binary (decimal) value
will be placed

14 Parameter DL05 Range


Filter Frequency Timer . . . . . . . . . . . . . . . . . . . T T0-177
A Filter Frequency Time (0.01 sec) . . . . . . . . . . . K
Raw Data (Binary) . . . . . . . . . . . . . . . . . . . . . . . V
K0-9999
See DL05 V-memory map - Data Words
Filter Divisor (1-100) . . . . . . . . . . . . . . . . . . . . . K K1-100
B Filtered Value (Binary) . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

C
D

5138 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

FILTERB Example
In the following example, the FILTERB instruction is used to filter a binary value that is in 1
V2000. Timer(T1) is set to 0.5 sec, the rate at which the filter calculation will be performed.
The filter constant is set to 3. A larger value will increase the smoothing effect of the filter. A
value of 1 results with no filtering. The filtered value will be placed in V2100.
2
3
4
SP1 5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5139


Chapter 5: Intelligent Box (IBox) - Analog Helper

Hi/Low Alarm - BCD (HILOAL) (IB-421)


1 Hi/Low Alarm - BCD monitors a BCD value V-memory location and sets four possible alarm
DS5 Used
states, High-High, High, Low, and Low-Low whenever the IBox has power flow. You enter
2 HPP N/A the alarm thresholds as constant K BCD values (K0-K9999) and/or BCD value V-memory
locations.
3 You must ensure that threshold limits are valid,
that is HH >= H > L >= LL. Note that when the
4 High-High or Low-Low alarm condition is true,
that the High and Low alarms will also be set,
5 respectively. This means you may use the same
threshold limit and same alarm bit for the High-
High and the High alarms in case you only need
6 one "High" alarm. Also note that the boundary
conditions are inclusive. That is, if the Low
7 boundary is K50, and the Low-Low boundary is
K10, and if the Monitoring Value equals 10, then
8 the Low Alarm AND the Low-Low alarm will both be ON. If there is no power flow to the
IBox, then all alarm bits will be turned off regardless of the value of the Monitoring Value
9 parameter.

10 HILOAL Parameters
Monitoring Value (BCD): specifies the V-memory location of the BCD value to be monitored
11 High-High Limit: V-memory location or constant specifies the high-high alarm limit
High-High Alarm: On when the high-high limit is reached
12 High Limit: V-memory location or constant specifies the high alarm limit
High Alarm: On when the high limit is reached
13 Low Limit: V-memory location or constant specifies the low alarm limit
Low Alarm: On when the low limit is reached
14 Low-Low Limit: V-memory location or constant specifies the low-low alarm limit
Low-Low Alarm: On when the low-low limit is reached
A Parameter DL05 Range
B Monitoring Value (BCD) . . . . . . . . . . . . . . . . . . V
High-High Limit . . . . . . . . . . . . . . . . . . . . . . . V, K
See DL05 V-memory map - Data Words
K0-9999; or see DL05 V-memory map - Data Words
High-High Alarm . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map
C High Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . V, K K0-9999; or see DL05 V-memory map - Data Words
High Alarm . . . . . . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map

D Low Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . V, K
Low Alarm . . . . . . . . . . . . . . . . X, Y, C, GX,GY,B
K0-9999; or see DL05 V-memory map - Data Words
See DL05 V-memory map
Low-Low Limit . . . . . . . . . . . . . . . . . . . . . . . V, K K0-9999; or see DL05 V-memory map - Data Words
Low-Low Alarm. . . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map

5140 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

HILOAL Example
In the following example, the HILOAL instruction is used to monitor a BCD value that is in 1
V2000. If the value in V2000 meets/exceeds the high limit of K900, C101 will turn on. If the
value continues to increase to meet/exceed the high-high limit, C100 will turn on. Both bits
would be on in this case. The high and high-high limits and alarms can be set to the same
2
value if one high limit or alarm is desired to be used.
If the value in V2000 meets or falls below the low limit of K200, C102 will turn on. If the
3
value continues to decrease to meet or fall below the low-low limit of K100, C103 will turn
on. Both bits would be on in this case. The low and low-low limits and alarms can be set to 4
the same value if one low limit or alarm is desired to be used.
5
6
SP1
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5141


Chapter 5: Intelligent Box (IBox) - Analog Helper

Hi/Low Alarm - Binary (HILOALB) (IB-401)


1 DS5 Used
Hi/Low Alarm - Binary monitors a binary (decimal) V-memory location and sets four
possible alarm states, High-High, High, Low, and Low-Low whenever the IBox has power
2 HPP N/A
flow. You enter the alarm thresholds as constant K decimal values (K0-K65535) and/or binary
(decimal) V-memory locations.
3 You must ensure that threshold limits are valid,
that is HH >= H > L >= LL. Note that when the
4 High-High or Low-Low alarm condition is true,
that the High and Low alarms will also be set,
5 respectively. This means you may use the same
threshold limit and same alarm bit for the High-
High and the High alarms in case you only need
6 one "High" alarm. Also note that the boundary
conditions are inclusive. That is, if the Low
7 boundary is K50, and the Low-Low boundary is
K10, and if the Monitoring Value equals 10,
8 then the Low Alarm AND the Low-Low alarm will both be ON. If there is no power flow to
the IBox, then all alarm bits will be turned off regardless of the value of the Monitoring Value
9 parameter.

10 HILOALB Parameters
Monitoring Value (Binary): specifies the V-memory location of the Binary value to be monitored
11 High-High Limit: V-memory location or constant specifies the high-high alarm limit
High-High Alarm: On when the high-high limit is reached
12 High Limit: V-memory location or constant specifies the high alarm limit
High Alarm: On when the high limit is reached
13 Low Limit: V-memory location or constant specifies the low alarm limit
Low Alarm: On when the low limit is reached
14 Low-Low Limit: V-memory location or constant specifies the low-low alarm limit
Low-Low Alarm: On when the low-low limit is reached
A
Parameter DL05 Range
B Monitoring Value (Binary) . . . . . . . . . . . . . . . . V
High-High Limit . . . . . . . . . . . . . . . . . . . . . . . V, K
See DL05 V-memory map - Data Words
K0-65535; or see DL05 V-memory map - Data Words
High-High Alarm . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map
C High Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . V, K K0-65535; or see DL05 V-memory map - Data Words
High Alarm . . . . . . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map

D Low Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . V, K
Low Alarm . . . . . . . . . . . . . . . . X, Y, C, GX,GY,B
K0-65535; or see DL05 V-memory map - Data Words
See DL05 V-memory map
Low-Low Limit . . . . . . . . . . . . . . . . . . . . . . . V, K K0-65535; or see DL05 V-memory map - Data Words
Low-Low Alarm. . . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map

5142 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Analog Helper

HILOALB Example
In the following example, the HILOALB instruction is used to monitor a binary value that is
1
in V2000. If the value in V2000 meets/exceeds the high limit of the binary value in V2011,
C101 will turn on. If the value continues to increase to meet/exceed the high-high limit value 2
in V2010, C100 will turn on. Both bits would be on in this case. The high and high-high
limits and alarms can be set to the same V-memory location/value if one high limit or alarm
is desired to be used.
3
If the value in V2000 meets or falls below the low limit of the binary value in V2012, C102
will turn on. If the value continues to decrease to meet or fall below the low-low limit in 4
V2013, C103 will turn on. Both bits would be on in this case. The low and low-low limits
and alarms can be set to the same V-memory location/value if one low limit or alarm is 5
desired to be used.
6
SP1
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5143


Chapter 5: Intelligent Box (IBox) - Discrete Helper

Off Delay Timer (OFFDTMR) (IB-302)


1 Off Delay Timer will delay the "turning off" of the Output parameter by the specified Off
DS5 Used Delay Time (in hundredths of a second) based on the power flow into the IBox. Once the
2 HPP N/A IBox receives power, the Output bit will turn on immediately. When the power flow to the
IBox turns off, the Output bit WILL REMAIN ON for the specified amount of time (in
hundredths of a second). Once the Off Delay
3 Time has expired, the output will turn Off. If
the power flow to the IBox comes back on
4 BEFORE the Off Delay Time, then the timer
is RESET and the Output will remain On - so
you must continuously have NO power flow to
5 the IBox for AT LEAST the specified Off
Delay Time before the Output will turn Off.
6 This IBox utilizes a Timer resource (TMRF), which cannot be used anywhere else in your
program.
7
OFFDTMR Parameters
8 Timer Number: specifies the Timer(TMRF) number which is used by the OFFDTMR instruction
Off Delay Time (0.01sec): specifies how long the Output will remain on once power flow to the
9 Ibox is removed
Output: specifies the output that will be delayed turning off by the Off Delay Time.
10 Parameter DL05 Range
11 Timer Number . . . . . . . . . . . . . . . . . . . . . . . . . T
Off Delay Time . . . . . . . . . . . . . . . . . . . . . . . . K,V
T0-177
K0-9999; See DL05 V-memory map - Data Words
Output . . . . . . . . . . . . . . . . . . . . X, Y, C, GX,GY, B See DL05 V-memory map
12
13
14
A
B
C
D

5144 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Discrete Helper

OFFDTMR Example
In the following example, the OFFDTMR instruction is used to delay the turning off of 1
output C20. Timer 2 (T2) is set to 5 seconds, the off-delay period.
When C100 turns on, C20 turns on and will remain on while C100 is on. When C100 turns 2
off, C20 will remain for the specified Off Delay Time (5s), and then turn off.
3
4
5
6
7
8
9
10
Example timing diagram
11
C100
12
5 sec 5 sec
13
C20
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5145


Chapter 5: Intelligent Box (IBox) - Discrete Helper

On Delay Timer (ONDTMR) (IB-301)


1 On Delay Timer will delay the "turning on" of the Output parameter by the specified
amount of time (in hundredths of a second) based on the power flow into the IBox. Once the
2 DS5 Used
IBox loses power, the Output is turned off immediately. If the power flow turns off BEFORE
the On Delay Time, then the timer is RESET and the Output is never turned on, so you
HPP N/A
must have continuous power flow to the IBox for at least the specified On Delay Time before
3 the Output turns On.
This IBox utilizes a Timer resource
4 (TMRF), which cannot be used anywhere
else in your program.
5
6 ONDTMR Parameters
Timer Number: specifies the Timer(TMRF) number which is used by the ONDTMR instruction
7 On Delay Time (0.01sec): specifies how long the Output will remain on once power flow to the
Ibox is removed
8 Output: specifies the output that will be delayed turning on by the On Delay Time.

9 Parameter DL05 Range


Timer Number . . . . . . . . . . . . . . . . . . . . . . . . . T T0-177

10 On Delay Time . . . . . . . . . . . . . . . . . . . . . . . . K,V


Output . . . . . . . . . . . . . . . . . . . . X, Y, C, GX,GY, B
K0-9999; See DL05 V-memory map - Data Words
See DL05 V-memory map

11
12
13
14
A
B
C
D

5146 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Discrete Helper

ONDTMR Example
In the following example, the ONDTMR instruction is used to delay the turning on of 1
output C21. Timer 1 (T1) is set to 2 seconds, the on-delay period.
When C101 turns on, C21 is delayed turning on by 2 seconds. When C101 turns off, C21 2
turns off imediately.
3
4
5
6
7
8
9
10
11
Example timing diagram
12
C101 13
2 sec 2 sec

C21
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5147


Chapter 5: Intelligent Box (IBox) - Discrete Helper

One Shot (ONESHOT) (IB-303)


1 One Shot will turn on the given bit output parameter for one scan on an OFF to ON
DS5 Used transition of the power flow into the IBox. This IBox is simply a different name for the PD
2 HPP N/A Coil (Positive Differential).

3 ONESHOT Parameters
Discrete Output: specifies the output that
4 will be on for one scan

5 Parameter DL05 Range


Discrete Output . . . . . . . . . . . . . . . . . . . . . X, Y, C See DL05 V-memory map
6
7 ONESHOT Example
In the following example, the ONESHOT instruction is used to turn C100 on for one PLC
8 scan after C0 goes from an off to on transition. The input logic must produce an off to on
transition to execute the One Shot instruction.

9
10
11
12 Example timing diagram

13 C0

14 Scan time

C100
A
B
C
D

5148 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Discrete Helper

Push On / Push Off Circuit (PONOFF) (IB-300)


Push On/Push Off Circuit toggles an output state whenever its input power flow transitions 1
DS5 Used from off to on. Requires an extra bit parameter for scan-to-scan state information. This extra
HPP N/A bit must NOT be used anywhere else in the program. This is also known as a flip-flop
circuit.
2
PONOFF Parameters
3
Discrete Input: specifies the input that will
toggle the specified output
4
Discrete Output: specifies the output that will
be turned on/off or toggled 5
Internal State: specifies a work bit that is used
by the instruction 6
Parameter
Discrete Input . . . . X,Y,C,S,T,CT,GX,GY,SP,B,PB
DL05 Range
See DL05 V-memory map
7
Discrete Output . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Internal State . . . . . . . . . . . . . . . . . . . . . . . X, Y, C See DL05 V-memory map 8
9
PONOFF Example
In the following example, the PONOFF instruction is used to control the on and off states of
10
the output C20 with a single input C10. When C10 is pressed once, C20 turns on. When
C10 is pressed again, C20 turns off. C100 is an internal bit used by the instruction. 11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5149


Chapter 5: Intelligent Box (IBox) - Memory

Move Single Word (MOVEW) (IB-200)


1 Move Single Word moves (copies) a word to a memory location directly or indirectly via a
DS5 Used pointer, either as a HEX constant, from a memory location, or indirectly through a pointer.
2 HPP N/A

MOVEW Parameters
3 From WORD: specifies the word that will be
moved to another location
4 To WORD: specifies the location where the
From WORD will be move to

5
6 Parameter
From WORD . . . . . . . . . . . . . . . . . . . . . . . . V,P,K
DL05 Range
K0-FFFF; See DL05 V-memory map - Data Words

7 To WORD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,P See DL05 V-memory map - Data Words

8
MOVEW Example
9 In the following example, the MOVEW instruction is used to move 16-bits of data from
V2000 to V3000 when C100 turns on.
10
11
12
13
14
A
B
C
D

5150 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Memory

Move Double Word (MOVED) (IB-201)


Move Double Word moves (copies) a double word to two consecutive memory locations 1
DS5 Used directly or indirectly via a pointer, either as a double HEX constant, from a double memory
HPP N/A location, or indirectly through a pointer to a double memory location. 2
MOVED Parameters 3
From DWORD: specifies the double word that
will be moved to another location
To DWORD: specifies the location where the
4
From DWORD will be move to
5
Parameter DL05 Range
6
From DWORD . . . . . . . . . . . . . . . . . . . . . . V,P,K K0-FFFFFFFF; See DL05 V-memory map - Data Words
To DWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . V,P See DL05 V-memory map - Data Words 7
8
MOVED Example
In the following example, the MOVED instruction is used to move 32-bits of data from 9
V2000 and V2001 to V3000 and V3001 when C100 turns on.
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5151


Chapter 5: Intelligent Box (IBox) Math

Math - BCD (MATHBCD) (IB-521)


1 Math - BCD Format lets you enter complex
mathematical expressions like you would in Visual Basic,
2 DS5
HPP
Used
N/A
Excel, or C++ to do complex calculations, nesting
parentheses up to 4 levels deep. In addition to + - * /,
you can do Modulo (% aka Remainder), Bit-wise And
3 (&) Or (|) Xor (^), and some BCD functions - Convert
to BCD (BCD), Convert to Binary (BIN), BCD
4 Complement (BCDCPL), Convert from Gray Code
(GRAY), Invert Bits (INV), and BCD/HEX to Seven
Segment Display (SEG).
5 Example: ((V2000 + V2001) / (V2003 - K100)) * GRAY(V3000 & K001F)
6 Every V-memory reference MUST be to a single word BCD formatted value. Intermediate
results can go up to 32 bit values, but as long as the final result fits in a 16 bit BCD word, the
calculation is valid. Typical example of this is scaling using multiply then divide, (V2000 *
7 K1000) / K4095. The multiply term most likely will exceed 9999 but fits within 32 bits. The
divide operation will divide 4095 into the 32-bit accumulator, yielding a result that will
8 always fit in 16 bits.
You can reference binary V-memory values by using the BCD conversion function on a
9 V-memory location but NOT an expression. That is BCD(V2000) is okay and will convert
V2000 from Binary to BCD, but BCD(V2000 + V3000) will add V2000 as BCD, to V3000
as BCD, then interpret the result as Binary and convert it to BCD - NOT GOOD.
10 Also, the final result is a 16 bit BCD number and so you could do BIN around the entire
operation to store the result as Binary.
11
MATHBCD Parameters
12 WORD Result: specifies the location where the BCD result of the mathematical expression will be
placed (result must fit into 16 bit single V-memory location)
13 Expression: specifies the mathematical expression to be executed and the result is stored in specified
WORD Result. Each V-memory location used in the expression must be in BCD format.
14 Parameter DL05 Range
WORD Result . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
A Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text

B
C
D

5152 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Math

MATHBCD Example
In the following example, the MATHBCD instruction is used to calculate the math 1
expression which multiplies the BCD value in V1200 by 1000 then divides by 4095 and
loads the resulting value in V2000. 2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5153


Chapter 5: Intelligent Box (IBox) - Math

Math - Binary (MATHBIN) (IB-501)


1 Math - Binary Format lets you enter complex
DS5 Used mathematical expressions like you would in Visual Basic,
2 HPP N/A Excel, or C++ to do complex calculations, nesting
parentheses up to 4 levels deep. In addition to + - * /,
you can do Modulo (% aka Remainder), Shift Right
3 (>>) and Shift Left (<<), Bit-wise And (&) Or (|) Xor
(^), and some binary functions - Convert to BCD
4 (BCD), Convert to Binary (BIN), Decode Bits
(DECO), Encode Bits (ENCO), Invert Bits (INV),
HEX to Seven Segment Display (SEG), and Sum Bits
5 (SUM).
Example: ((V2000 + V2001) / (V2003 - K10)) * SUM(V3000 & K001F)
6 Every V-memory reference MUST be to a single word binary formatted value. Intermediate
results can go up to 32 bit values, but as long as the final result fits in a 16 bit binary word,
7 the calculation is valid. Typical example of this is scaling using multiply then divide, (V2000 *
K1000) / K4095. The multiply term most likely will exceed 65535 but fits within 32 bits.
8 The divide operation will divide 4095 into the 32-bit accumulator, yielding a result that will
always fit in 16 bits.
9 You can reference BCD V-memory values by using the BIN conversion function on a
V-memory location but NOT an expression. That is, BIN(V2000) is okay and will convert
V2000 from BCD to Binary, but BIN(V2000 + V3000) will add V2000 as Binary, to V3000
10 as Binary, then interpret the result as BCD and convert it to Binary - NOT GOOD.
Also, the final result is a 16 bit binary number and so you could do BCD around the entire
11 operation to store the result as BCD.

12 MATHBIN Parameters
WORD Result: specifies the location where the binary result of the mathematical expression will be
13 placed (result must fit into 16 bit single V-memory location)
Expression: specifies the mathematical expression to be executed and the result is stored in specified
14 WORD Result. Each V-memory location used in the expression must be in binary format.

A Parameter DL05 Range


WORD Result . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
B Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text

C
D

5154 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Math

MATHBIN Example
In the following example, the MATHBIN instruction is used to calculate the math expression 1
which multiplies the Binary value in V1200 by 1000 then divides by 4095 and loads the
resulting value in V2000. 2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5155


Chapter 5: Intelligent Box (IBox) - Math

Square BCD (SQUARE) (IB-523)


1 Square BCD squares the given 4-digit WORD BCD number and writes it in as an 8-digit
DS5 Used DWORD BCD result.
2 HPP N/A

SQUARE Parameters
3 Value (WORD BCD): specifies the BCD Word
or constant that will be squared
4 Result (DWORD BCD): specifies the location
where the squared DWORD BCD value will be
placed
5
Parameter DL05 Range
6 Value (WORD BCD) . . . . . . . . . . . . . . . . . . V,P,K K0-9999 ; See DL05 V-memory map - Data Words
Result (DWORD BCD) . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
7
8
SQUARE Example
9 In the following example, the SQUARE instruction is used to square the 4-digit BCD value
in V2000 and store the 8-digit double word BCD result in V3000 and V3001
10
11
12
13
14
A
B
C
D

5156 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Math

Square Binary (SQUAREB) (IB-503)


Square Binary squares the given 16-bit WORD Binary number and writes it as a 32-bit 1
DS5 Used DWORD Binary result.
HPP N/A 2
SQUAREB Parameters
Value (WORD Binary): specifies the binary 3
Word or constant that will be squared
Result (DWORD Binary): specifies the
location where the squared DWORD binary
4
value will be placed
5
Parameter DL05 Range
Value (WORD Binary) . . . . . . . . . . . . . . . . V,P,K K0-65535; See DL05 V-memory map - Data Words 6
Result (DWORD Binary) . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
7
8
SQUAREB Example
In the following example, the SQUAREB instruction is used to square the single word Binary 9
value in V2000 and store the 8-digit double word Binary result in V3000 and V3001.
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5157


Chapter 5: Intelligent Box (IBox) - Math

Sum BCD Numbers (SUMBCD) (IB-522)


1 Sum BCD Numbers sums up a list of consecutive 4-digit WORD BCD numbers into an
DS5 Used 8-digit DWORD BCD result.
2 HPP N/A
You specify the group's starting and ending
V- memory addresses (inclusive). When
3 enabled, this instruction will add up all the
numbers in the group (so you may want to
place a differential contact driving the
4 enable).
SUMBCD could be used as the first part of
5 calculating an average.

6 SUMBCD Parameters
Start Address: specifies the starting address of a block of V-memory location values to be added
7 together (BCD)
End Addr (inclusive): specifies the ending address of a block of V-memory location values to be
8 added together (BCD)
Result (DWORD BCD): specifies the location where the sum of the block of V-memory BCD
values will be placed
9
Parameter DL05 Range
10 Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . V
End Address (inclusive) . . . . . . . . . . . . . . . . . . V
See DL05 V-memory map - Data Words
See DL05 V-memory map - Data Words
Result (DWORD BCD) . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
11
12
SUMBCD Example
13 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
14 V3000 and V3001.

A
B
C
D

5158 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Math

Sum Binary Numbers (SUMBIN) (IB-502)


Sum Binary Numbers sums up a list of consecutive 16-bit WORD Binary numbers into a 1
DS5 Used 32-bit DWORD binary result.
HPP N/A
You specify the group's starting and ending 2
V- memory addresses (inclusive). When
enabled, this instruction will add up all the
numbers in the group (so you may want to
3
place a differential contact driving the
enable). 4
SUMBIN could be used as the first part of
calculating an average. 5
SUMBIN Parameters 6
Start Address: specifies the starting address of a block of V-memory location values to be added
together (Binary) 7
End Addr (inclusive): specifies the ending address of a block of V-memory location values to be
added together (Binary)
Result (DWORD Binary): specifies the location where the sum of the block of V-memory binary
8
values will be placed
9
Parameter DL05 Range
Start Address . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words 10
End Address (inclusive) . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Result (DWORD Binary) . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
11
12
SUMBIN Example 13
In the following example, the SUMBIN instruction is used to total the sum of all Binary
values in words V2000 thru V2007 and store the resulting 8-digit double word Binary value
in V3000 and V3001.
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5159


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Configuration (ECOM100) (IB-710)


1 DS5 Used
ECOM100 Configuration defines all the common information for one specific ECOM100
module which is used by the other ECOM100 IBoxes; for example, ECRX - ECOM100
2 HPP N/A
Network Read , ECEMAIL - ECOM100 Send EMail, ECIPSUP - ECOM100 IP Setup, etc.
You MUST have the ECOM100
3 Configuration IBox at the top of your
ladder/stage program with any other
configuration IBoxes. The Message Buffer
4 parameter specifies the starting address of a
65 WORD buffer. This is 101 Octal
5 addresses (e.g. V1400 thru V1500).
If you have more than one ECOM100 in
6 your PLC, you must have a different
ECOM100 Configuration IBox for EACH
ECOM100 module in your system that utilizes any ECOM IBox instructions.
7 The Workspace and Status parameters and the entire Message Buffer are internal, private
registers used by the ECOM100 Configuration IBox and MUST BE UNIQUE in this one
8 instruction and MUST NOT be used anywhere else in your program.
In order for MOST ECOM100 IBoxes to function, you must turn ON dip switch 7 on the
9 ECOM100 circuit board. You can keep dip switch 7 off if you are ONLY using ECOM100
Network Read and Write IBoxes (ECRX, ECWX).
10
ECOM100 Parameters
11 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
12 Slot: specifies the option slot the module occupies
Status: specifies a V-memory location that will be used by the instruction
13 Workspace: specifies a V-memory location that will be used by the instruction
Msg Buffer: specifies the starting address of a 65 word buffer that will be used by the module for
14 configuration

A Parameter
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K1-4
B Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
C Msg Buffer (65 words used) . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

5160 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Example
The ECOM100 Config IBox coordinates all of the interaction with other ECOM100 based 1
IBoxes (ECxxxx). You must have an ECOM100 Config IBox for each ECOM100 module in
your system. Configuration IBoxes must be at the top of your program and must execute
every scan.
2
This IBox defines ECOM100# K0 to be in slot 3. Any ECOM100 IBoxes that need to
reference this specific module (such as ECEMAIL, ECRX, ...) would enter K0 for their
3
ECOM100# parameter.
The Status register is for reporting any completion or error information to other ECOM100
4
IBoxes. This V-memory register must not be used anywhere else in the entire program.
The Workspace register is used to maintain state information about the ECOM100, along 5
with proper sharing and interlocking with the other ECOM100 IBoxes in the program. This
V-memory register must not be used anywhere else in the entire program. 6
The Message Buffer of 65 words (130 bytes) is a common pool of memory that is used by
other ECOM100 IBoxes (such as ECEMAIL). This way, you can have a bunch of
ECEMAIL IBoxes, but only need 1 common buffer for generating and sending each EMail.
7
These V-memory registers must not be used anywhere else in your entire program.
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5161


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Disable DHCP (ECDHCPD) (IB-736)


1 ECOM100 Disable DHCP will setup the ECOM100 to use its internal TCP/IP settings on a
DS5 Used leading edge transition to the IBox. To configure the ECOM100's TCP/IP settings manually,
2 HPP N/A use the NetEdit3 utility, or you can do it
programmatically from your PLC program using
the ECOM100 IP Setup (ECIPSUP), or the
3 individual ECOM100 IBoxes: ECOM Write IP
Address (ECWRIP), ECOM Write Gateway
4 Address (ECWRGWA), and ECOM100 Write
Subnet Mask (ECWRSNM).
5 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
6 NOT be used anywhere else in your program.
Either the Success or Error bit parameter will turn on once the command is complete. If there
7 is an error, the Error Code parameter will report an ECOM100 error code (less than 100), or
a PLC logic error (greater than 1000).
8 The "Disable DHCP" setting is stored in Flash-ROM in the ECOM100 and the execution of
this IBox will disable the ECOM100 module for at least a half second until it writes the
9 Flash-ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox
ONCE, on second scan. Since it requires a LEADING edge to execute, use a NORMALLY
CLOSED SP0 (STR NOT First Scan) to drive the power flow to the IBox.
10 In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
11
ECDHCPD Parameters
12 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
13 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
14 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
A Error Code: specifies the location where the Error Code will be written

B Parameter DL05 Range


ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
C Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map - Data Words
See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
D Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

5162 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECDHCPD Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, disable DHCP in the ECOM100. DHCP is the same protocol 8
used by PCs for using a DHCP Server to automatically assign the ECOM100's IP Address,
Gateway Address, and Subnet Mask. Typically disabling DHCP is done by assigning a hard- 9
coded IP Address either in NetEdit or using one of the ECOM100 IP Setup IBoxes, but this
IBox allows you to disable DHCP in the ECOM100 using your ladder program. The
ECDHCPD is leading edge triggered, not power-flow driven (similar to a counter input leg).
10
The command to disable DHCP will be sent to the ECOM100 whenever the power flow
into the IBox goes from OFF to ON. If successful, turn on C100. If there is a failure, turn on 11
C101. If it fails, you can look at V2000 for the specific error code.
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5163


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Enable DHCP (ECDHCPE) (IB-735)


1 ECOM100 Enable DHCP will tell the ECOM100 to obtain its TCP/IP setup from a DHCP
Server on a leading edge transition to the IBox.
2 DS5
HPP
Used
N/A The IBox will be successful once the ECOM100 has
received its TCP/IP settings from the DHCP server.
3 Since it is possible for the DHCP server to be
unavailable, a Timeout parameter is provided so the
IBox can complete, but with an Error (Error Code =
4 1004 decimal).
See also the ECOM100 IP Setup (ECIPSUP) IBox 717
5 to directly setup ALL of the TCP/IP parameters in a
single instruction - IP Address, Subnet Mask, and
6 Gateway Address.
The Workspace parameter is an internal, private register used by this IBox and MUST BE
7 UNIQUE in this one instruction and MUST NOT be used anywhere else in your program.
Either the Success or Error bit parameter will turn on once the command is complete. If there
is an error, the Error Code parameter will report an ECOM100 error code (less than 100), or
8 a PLC logic error (greater than 1000).
The "Enable DHCP" setting is stored in Flash-ROM in the ECOM100 and the execution of
9 this IBox will disable the ECOM100 module for at least a half second until it writes the
Flash-ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox
10 ONCE, on second scan. Since it requires a LEADING edge to execute, use a NORMALLY
CLOSED SP0 (STR NOT First Scan) to drive the power flow to the IBox.
11 In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECDHCPE Parameters
12 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
13 reference this logical number
Timeout(sec): specifies a timeout period so that the instruction may have time to complete
14 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the request is completed successfully
A Error: specifies a bit that will turn on if the instruction is not successfully completed
Error Code: specifies the location where the Error Code will be written
B Parameter DL05 Range
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
C Timeout (sec) . . . . . . . . . . . . . . . . . . . . . . . . . . K K5-127
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

5164 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECDHCPE Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
8
Rung 2: On the 2nd scan, enable DHCP in the ECOM100. DHCP is the same protocol
used by PCs for using a DHCP Server to automatically assign the ECOM100's IP Address, 9
Gateway Address, and Subnet Mask. Typically this is done using NetEdit, but this IBox
allows you to enable DHCP in the ECOM100 using your ladder program. The ECDHCPE
is leading edge triggered, not power-flow driven (similar to a counter input leg). The
10
commands to enable DHCP will be sent to the ECOM100 whenever the power flow into the
IBox goes from OFF to ON. The ECDHCPE does more than just set the bit to enable 11
DHCP in the ECOM100, but it then polls the ECOM100 once every second to see if the
ECOM100 has found a DHCP server and has a valid IP Address. Therefore, a timeout
parameter is needed in case the ECOM100 cannot find a DHCP server. If a timeout does
12
occur, the Error bit will turn on and the error code will be 1005 decimal. The Success bit will
turn on only if the ECOM100 finds a DHCP Server and is assigned a valid IP Address. If 13
successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at V2000
for the specific error code. 14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5165


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Query DHCP Setting (ECDHCPQ) (IB-734)


1 ECOM100 Query DHCP Setting will determine if DHCP is enabled in the ECOM100 on a
DS5 Used leading edge transition to the IBox. The DHCP Enabled bit parameter will be ON if DHCP
2 HPP N/A is enabled, OFF if disabled.
The Workspace parameter is an internal, private
3 register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST NOT
be used anywhere else in your program.
4 Either the Success or Error bit parameter will turn
on once the command is complete.
5 In order for this ECOM100 IBox to function, you
must turn ON dip switch 7 on the ECOM100
6 circuit board.

7 ECDHCPQ Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
8 specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number

9 Workspace: specifies a V-memory location that will be used by the instruction


Success: specifies a bit that will turn on once the instruction is completed successfully

10 Error: specifies a bit that will turn on if the instruction is not successfully completed
DHCP Enabled: specifies a bit that will turn on if the ECOM100s DHCP is enabled or remain off
if disabled - after instruction query, be sure to check the state of the Success/Error bit state along
11 with DHCP Enabled bit state to confirm a successful module query

12 Parameter DL05 Range


ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
13 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

14 Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
DHCP Enabled . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map

A
B
C
D

5166 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECDHCPQ Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
8
Rung 2: On the 2nd scan, read whether DHCP is enabled or disabled in the ECOM100 and
store it in C5. DHCP is the same protocol used by PCs for using a DHCP Server to 9
automatically assign the ECOM100's IP Address, Gateway Address, and Subnet Mask. The
ECDHCPQ is leading edge triggered, not power-flow driven (similar to a counter input leg).
The command to read (Query) whether DHCP is enabled or not will be sent to the
10
ECOM100 whenever the power flow into the IBox goes from OFF to ON. If successful, turn
on C100. If there is a failure, turn on C101. 11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5167


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Send E-mail (ECEMAIL) (IB-711)


1 DS5 Used
ECOM100 Send EMail, on a leading edge transition, will behave as an EMail client and send
an SMTP request to your SMTP Server to send the EMail message to the EMail addresses in
HPP N/A the To: field and also to those listed in the Cc: list hard coded in the ECOM100. It will send
2 the SMTP request based on the specified ECOM100#,
which corresponds to a specific unique ECOM100
3 Configuration (ECOM100) at the top of your program.
The Body: field supports what the PRINT and VPRINT
4 instructions support for text and embedded variables,
allowing you to embed real-time data in your EMail (e.g.
"V2000 = " V2000:B).
5 The Workspace parameter is an internal, private register
used by this IBox and MUST BE UNIQUE in this one
6 instruction and MUST NOT be used anywhere else in your
program.
7 Either the Success or Error bit parameter will turn on once the request is complete. If there is
an error, the Error Code parameter will report an ECOM100 error code (less than 100), an
SMPT protocol error (between 100 and 999), or a PLC logic error (greater than 1000).
8 Since the ECOM100 is only an EMail Client and requires access to an SMTP Server, you
MUST have the SMTP parameters configured properly in the ECOM100 via the
9 ECOM100's Home Page and/or the EMail Setup instruction (ECEMSUP). To get to the
ECOM100's Home Page, use your favorite Internet browser and browse to the ECOM100's
10 IP Address, e.g. http://192.168.12.86
You are limited to approximately 100 characters of message data for the entire instruction,
11 including the To: Subject: and Body: fields. To save space, the ECOM100 supports a hard
coded list of EMail addresses for the Carbon Copy field (cc:) so that you can configure those
IN the ECOM100, and keep the To: field small (or even empty), to leave more room for the
12 Subject: and Body: fields.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
13 ECOM100 circuit board.
ECEMAIL Parameters
14 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
A reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction

B Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed

C Error Code: specifies the location where the Error Code will be written
To: specifies an E-mail address that the message will be sent to

D Subject: subject of the e-mail message


Body: supports what the PRINT and VPRINT instructions support for text and embedded
variables, allowing you to embed real-time data in the EMail message

5168 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

Parameter
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
1
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map - Data Words
See DL05 V-memory map
2
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
To: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
See DL05 V-memory map
Text
3
Subject:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Body:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text
See PRINT and VPRINT instructions
4
ECEMAIL Example
5
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as 6
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
is used as a global result status register for the other ECxxxx IBoxes using this specific
7
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer 8
available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
9
10
11
12
13
(example continued on next page) 14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5169


Chapter 5: Intelligent Box (IBox) - Communication

ECEMAIL Example (contd)


1 Rung 2: When a machine goes down, send an email to Joe in maintenance and to the VP
over production showing what machine is down along with the date/time stamp of when it
2 went down.
The ECEMAIL is leading edge triggered, not power-flow driven (similar to a counter input
3 leg). An email will be sent whenever the power flow into the IBox goes from OFF to ON.
This helps prevent self inflicted spamming.
4 If the EMail is sent, turn on C100. If there is a failure, turn on C101. If it fails, you can look
at V2000 for the SMTP error code or other possible error codes.

5
6
7
8
9
10
11
12
13
14
A
B
C
D

5170 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Restore Default E-mail Setup (ECEMRDS) (IB-713)


ECOM100 Restore Default EMail Setup, on a leading edge transition, will restore the 1
DS5 Used original EMail Setup data stored in the ECOM100 back to the working copy based on the
HPP N/A specified ECOM100#, which corresponds to a specific unique ECOM100 Configuration
(ECOM100) at the top of your program.
2
When the ECOM100 is first powered up, it copies
the EMail setup data stored in ROM to the working
3
copy in RAM. You can then modify this working
copy from your program using the ECOM100 4
EMail Setup (ECEMSUP) IBox. After modifying
the working copy, you can later restore the original
setup data via your program by using this IBox.
5
The Workspace parameter is an internal, private
register used by this IBox and MUST BE UNIQUE
6
in this one instruction and MUST NOT be used
anywhere else in your program. 7
Either the Success or Error bit parameter will turn on once the command is complete. If there
is an error, the Error Code parameter will report an ECOM100 error code (less than 100), or 8
a PLC logic error (greater than 1000).
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the 9
ECOM100 circuit board.
10
ECEMRDS Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
11
reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction 12
Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
13
Error Code: specifies the location where the Error Code will be written
14
Parameter DL05 Range
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
A
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map B
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5171


Chapter 5: Intelligent Box (IBox) - Communication

ECEMRDS Example
1 Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
2 ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
is used as a global result status register for the other ECxxxx IBoxes using this specific
3 ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
4 available for use by the other ECxxxx IBoxes using this specific ECOM100 module.

5
6
7
8 Rung 2: Whenever an EStop is pushed, ensure that president of the company gets copies of
all EMails being sent.
9 The ECOM100 EMail Setup IBox allows you to set/change the SMTP EMail settings stored
in the ECOM100.
10
11
12
13
14
A
B
C
D

5172 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECEMRDS Example
Rung 3: Once the EStop is pulled out, take the president off the cc: list by restoring the 1
default EMail setup in the ECOM100.
The ECEMRDS is leading edge triggered, not power-flow driven (similar to a counter input 2
leg). The ROM based EMail configuration stored in the ECOM100 will be copied over the
"working copy" whenever the power flow into the IBox goes from OFF to ON (the working
copy can be changed by using the ECEMSUP IBox).
3
If successful, turn on C102. If there is a failure, turn on C103. If it fails, you can look at
V2001 for the specific error code.
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5173


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 E-mail Setup (ECEMSUP) (IB-712)


1 ECOM100 EMail Setup, on a leading edge transition, will modify the working copy of the
DS5 Used EMail setup currently in the ECOM100 based on the specified ECOM100#, which
2 HPP N/A corresponds to a specific unique ECOM100 Configuration (ECOM100) at the top of your
program.
3 You may pick and choose any or all fields to be
modified using this instruction. Note that these
changes are cumulative: if you execute multiple
4 ECOM100 EMail Setup IBoxes, then all of the
changes are made in the order they are executed.
5 Also note that you can restore the original
ECOM100 EMail Setup that is stored in the
ECOM100 to the working copy by using the
6 ECOM100 Restore Default EMail Setup
(ECEMRDS) IBox.
7 The Workspace parameter is an internal, private register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST NOT be used anywhere else in your program.
8 Either the Success or Error bit parameter will turn on once the command is complete. If there
is an error, the Error Code parameter will report an ECOM100 error code (less than 100), or
9 a PLC logic error (greater than 1000).
You are limited to approximately 100 characters/bytes of setup data for the entire instruction.
10 So if needed, you could divide the entire setup across multiple ECEMSUP IBoxes on a field-
by-field basis, for example do the Carbon Copy (cc:) field in one ECEMSUP IBox and the
remaining setup parameters in another.
11 In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
12
ECEMSUP Parameters
13 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
14 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
A Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
B Error Code: specifies the location where the Error Code will be written
SMTP Server IP Addr: optional parameter that specifies the IP Address of the SMTP Server on the
C ECOM100s network
Sender Name: optional parameter that specifies the sender name that will appear in the From:
field to those who receive the e-mail
D Sender EMail: optional parameter that specifies the sender EMail address that will appear in the
From: field to those who receive the e-mail

5174 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECEMSUP Parameters
Port Number: optional parameter that specifies the TCP/IP Port Number to send SMTP requests; 1
usually this does not to be configured (see your network administrator for information on this
setting)
Timeout (sec): optional parameter that specifies the number of seconds to wait for the SMTP Server
2
to send the EMail to all the recipients
Cc: optional parameter that specifies a list of carbon copy Email addresses to send all EMails to
3
Parameter DL05 Range 4
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map - Data Words
See DL05 V-memory map
5
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words 6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5175


Chapter 5: Intelligent Box (IBox) - Communication

ECEMSUP Example
1 Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
2 ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
is used as a global result status register for the other ECxxxx IBoxes using this specific
3 ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
4 available for use by the other ECxxxx IBoxes using this specific ECOM100 module.

5
6
7
8
9
10
11
12
13
14
A
B
C
D

5176 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECEMSUP Example
Rung 2: Whenever an EStop is pushed, ensure that president of the company gets copies of 1
all EMails being sent.The ECOM100 EMail Setup IBox allows you to set/change the SMTP
EMail settings stored in the ECOM100. The ECEMSUP is leading edge triggered, not
power-flow driven (similar to a counter input leg). At power-up, the ROM based EMail
2
configuration stored in the ECOM100 is copied to a RAM based "working copy". You can
change this working copy by using the ECEMSUP IBox. To restore the original ROM based 3
configuration, use the Restore Default EMail Setup ECEMRDS IBox.
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at 4
V2000 for the specific error code.
5
6
7
8
9
10
11
Rung 3: Once the EStop is pulled out, take the president off the cc: list by restoring the
default EMail setup in the ECOM100. 12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5177


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 IP Setup (ECIPSUP) (IB-717)


1 DS5 Used
ECOM100 IP Setup will configure the three TCP/IP parameters in the ECOM100: IP
Address, Subnet Mask, and Gateway Address, on a leading edge transition to the IBox. The
N/A
2 HPP ECOM100 is specified by the ECOM100#, which corresponds to a specific unique
ECOM100 Configuration (ECOM100) IBox at the top of your program.
The Workspace parameter is an internal, private register
3 used by this IBox and MUST BE UNIQUE in this one
instruction and MUST NOT be used anywhere else in
4 your program.
Either the Success or Error bit parameter will turn on
5 once the command is complete. If there is an error, the
Error Code parameter will report an ECOM100 error
code (less than 100), or a PLC logic error (greater than
6 1000).
This setup data is stored in Flash-ROM in the
7 ECOM100 and will disable the ECOM100 module for at least a half second until it writes
the Flash-ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this
8 IBox ONCE on second scan. Since it requires a LEADING edge to execute, use a
NORMALLY CLOSED SP0 (NOT First Scan) to drive the power flow to the IBox.
9 In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECIPSUP Parameters
10 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
11 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
12 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
13 Error Code: specifies the location where the Error Code will be written
IP Address: specifies the modules IP Address
14 Subnet Mask: specifies the Subnet Mask for the module to use
Gateway Address: specifies the Gateway Address for the module to use
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
C Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D IP Address . . . . . . . . . . . . . . . . . . . . . IP Address 0.0.0.1. to 255.255.255.254
Subnet Mask Address . . . . . . . IP Address Mask 0.0.0.1. to 255.255.255.254
Gateway Address . . . . . . . . . . . . . . . . IP Address 0.0.0.1. to 255.255.255.254

5178 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECIPSUP Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module.V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, configure all of the TCP/IP parameters in the ECOM100: 8
IP Address: 192.168. 12.100
Subnet Mask: 255.255. 0. 0
9
Gateway Address: 192.168. 0. 1
The ECIPSUP is leading edge triggered, not power-flow driven (similar to a counter input
10
leg). The command to write the TCP/IP configuration parameters will be sent to the
ECOM100 whenever the power flow into the IBox goes from OFF to ON. 11
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at
V2000 for the specific error code. 12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5179


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Read Description (ECRDDES) (IB-726)


1 ECOM100 Read Description will read the ECOM100's Description field up to the number
DS5 Used of specified characters on a leading edge transition to the IBox.
2 HPP N/A
The Workspace parameter is an internal, private
register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
3 NOT be used anywhere else in your program.
Either the Success or Error bit parameter will turn
4 on once the command is complete.
In order for this ECOM100 IBox to function, you
5 must turn ON dip switch 7 on the ECOM100
circuit board.
6
ECRDDES Parameters
7 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
8 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the request is completed successfully
9 Error: specifies a bit that will turn on if the instruction is not successfully completed

10 Description: specifies the starting buffer location where the ECOM100s Module Name will be
placed
Num Char: specifies the number of characters (bytes) to read from the ECOM100s Description
11 field

12
Parameter DL05 Range
13 ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
14 Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
A Num Chars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K1-128

B
C
D

5180 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRDDES Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
1
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400 2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module.V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
4
5
6
7
8
Rung 2: On the 2nd scan, read the Module Description of the ECOM100 and store it in
V3000 thru V3007 (16 characters). This text can be displayed by an HMI.
The ECRDDES is leading edge triggered, not power-flow driven (similar to a counter input
9
leg). The command to read the module description will be sent to the ECOM100 whenever
the power flow into the IBox goes from OFF to ON. 10
If successful, turn on C100. If there is a failure, turn on C101.
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5181


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Read Gateway Address (ECRDGWA) (IB-730)


1 DS5
HPP
Used
N/A
ECOM100 Read Gateway Address will read the 4 parts of the Gateway IP address and store
them in 4 consecutive V-memory locations in decimal format, on a leading edge transition to
the IBox.
2 The Workspace parameter is an internal,
private register used by this IBox and MUST
3 BE UNIQUE in this one instruction and
MUST NOT be used anywhere else in your
4 program.
Either the Success or Error bit parameter will
turn on once the command is complete.
5 In order for this ECOM100 IBox to function,
you must turn ON dip switch 7 on the
6 ECOM100 circuit board.

7 ECRDGWA Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
8 specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
9 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the request is completed successfully
10 Error: specifies a bit that will turn on if the instruction is not successfully completed
Gateway IP Addr: specifies the starting address where the ECOM100s Gateway Address will be
11 placed in 4 consecutive V-memory locations

12 Parameter DL05 Range


ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
13 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map - Data Words
See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
14 Gateway IP Address (4 Words) . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

A
B
C
D

5182 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRDGWA Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, read the Gateway Address of the ECOM100 and store it in V3000 8
thru V3003 (4 decimal numbers). The ECOM100's Gateway Address could be displayed by
an HMI. 9
The ECRDGWA is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to read the Gateway Address will be sent to the ECOM100 whenever the
power flow into the IBox goes from OFF to ON.
10
If successful, turn on C100. If there is a failure, turn on C101. 11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5183


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Read IP Address (ECRDIP) (IB-722)


1 DS5 Used ECOM100 Read IP Address will read the 4 parts of the IP address and store them in 4
HPP N/A consecutive V-memory locations in decimal format, on a leading edge transition to the IBox.
2 The Workspace parameter is an internal,
private register used by this IBox and MUST
3 BE UNIQUE in this one instruction and
MUST NOT be used anywhere else in your
program.
4 Either the Success or Error bit parameter will
turn on once the command is complete.
5 In order for this ECOM100 IBox to function,
you must turn ON dip switch 7 on the
6 ECOM100 circuit board.

7 ECRDIP Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
8 specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
9 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
10 IP Address: specifies the starting address where the ECOM100s IP Address will be placed in 4
consecutive V-memory locations
11
Parameter DL05 Range
12 ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
13 Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
IP Address (4 Words) . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
14
A
B
C
D

5184 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRDIP Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
8
Rung 2: On the 2nd scan, read the IP Address of the ECOM100 and store it in V3000 thru
V3003 (4 decimal numbers). The ECOM100's IP Address could be displayed by an HMI. 9
The ECRDIP is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to read the IP Address will be sent to the ECOM100 whenever the power
flow into the IBox goes from OFF to ON.
10
If successful, turn on C100. If there is a failure, turn on C101. 11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5185


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Read Module ID (ECRDMID) (IB-720)


1 DS5 Used ECOM100 Read Module ID will read the binary (decimal) WORD sized Module ID on a
HPP N/A leading edge transition to the IBox.
2 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
3 NOT be used anywhere else in your program.
Either the Success or Error bit parameter will
4 turn on once the command is complete.
In order for this ECOM100 IBox to function,
5 you must turn ON dip switch 7 on the
ECOM100 circuit board.
6
ECRDMID Parameters
7 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
8 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the request is completed successfully
9 Error: specifies a bit that will turn on if the instruction is not successfully completed
Module ID: specifies the location where the ECOM100s Module ID (decimal) will be placed
10
11 Parameter DL05 Range
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
12 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
13 Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Module ID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
See DL05 V-memory map
See DL05 V-memory map - Data Words

14
A
B
C
D

5186 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRDMID Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module.V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
8
Rung 2: On the 2nd scan, read the Module ID of the ECOM100 and store it in V2000.
The ECRDMID is leading edge triggered, not power-flow driven (similar to a counter input 9
leg). The command to read the module ID will be sent to the ECOM100 whenever the
power flow into the IBox goes from OFF to ON. 10
If successful, turn on C100. If there is a failure, turn on C101.
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5187


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Read Module Name (ECRDNAM) (IB-724)


1 DS5 Used ECOM100 Read Name will read the Module Name up to the number of specified characters
HPP N/A on a leading edge transition to the IBox.
2 The Workspace parameter is an internal, private
register used by this IBox and MUST BE UNIQUE in
3 this one instruction and MUST NOT be used
anywhere else in your program.
4 Either the Success or Error bit parameter will turn on
once the command is complete.

5 In order for this ECOM100 IBox to function, you


must turn ON dip switch 7 on the ECOM100 circuit
board.
6
ECRDNAM Parameters
7 ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
8 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
9 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
10 Module Name: specifies the starting buffer location where the ECOM100s Module Name will be
placed

11 Num Chars: specifies the number of characters (bytes) to read from the ECOM100s Name field

12 Parameter
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
13 Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
14 Module Name . . . . . . . . . . . . . . . . . . . . . . . . . . V
Num Chars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See DL05 V-memory map - Data Words
K1-128

A
B
C
D

5188 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRDNAM Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, read the Module Name of the ECOM100 and store it in V3000 8
thru V3003 (8 characters). This text can be displayed by an HMI.
The ECRDNAM is leading edge triggered, not power-flow driven (similar to a counter input 9
leg). The command to read the module name will be sent to the ECOM100 whenever the
power flow into the IBox goes from OFF to ON. 10
If successful, turn on C100. If there is a failure, turn on C101.
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5189


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Read Subnet Mask (ECRDSNM) (IB-732)


1 DS5 Used ECOM100 Read Subnet Mask will read the 4 parts of the Subnet Mask and store them in 4
HPP N/A consecutive V-memory locations in decimal format, on a leading edge transition to the IBox.
2 The Workspace parameter is an internal,
private register used by this IBox and MUST
3 BE UNIQUE in this one instruction and
MUST NOT be used anywhere else in your
program.
4 Either the Success or Error bit parameter will
turn on once the command is complete.
5 In order for this ECOM100 IBox to function,
you must turn ON dip switch 7 on the
6 ECOM100 circuit board.

7 ECRDSNM Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
8 specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number

9 Workspace: specifies a V-memory location that will be used by the instruction


Success: specifies a bit that will turn on once the request is completed successfully

10 Error: specifies a bit that will turn on if the instruction is not successfully completed
Subnet Mask: specifies the starting address where the ECOM100s Subnet Mask will be placed in 4
consecutive V-memory locations
11
Parameter DL05 Range
12 ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
13 Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map

14 Subnet Mask (4 Words). . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

A
B
C
D

5190 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRDSNM Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, read the Subnet Mask of the ECOM100 and store it in V3000 8
thru V3003 (4 decimal numbers). The ECOM100's Subnet Mask could be displayed by an
HMI. 9
The ECRDSNM is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to read the Subnet Mask will be sent to the ECOM100 whenever the
power flow into the IBox goes from OFF to ON.
10
If successful, turn on C100. If there is a failure, turn on C101. 11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5191


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Write Description (ECWRDES) (IB-727)


1 DS5 Used ECOM100 Write Description will write the given Description to the ECOM100 module on
HPP N/A a leading edge transition to the IBox. If you use a dollar sign ($) or double quote ("), use the
2 PRINT/VPRINT escape sequence of TWO dollar
signs ($$) for a single dollar sign or dollar sign-
double quote ($") for a double quote character.
3 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
4 UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5 Either the Success or Error bit parameter will turn
on once the command is complete. If there is an
6 error, the Error Code parameter will report an
ECOM100 error code (less than 100), or a PLC
logic error (greater than 1000).
7 The Description is stored in Flash-ROM in the ECOM100 and the execution of this IBox
will disable the ECOM100 module for at least a half second until it writes the Flash-ROM.
8 Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on
second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED
9 SP0 (STR NOT First Scan) to drive the power flow to the IBox.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
10
11 ECWRDES Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
12 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
13 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14 Error Code: specifies the location where the Error Code will be written
Description: specifies the Description that will be written to the module
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
C Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map

D Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
See DL05 V-memory map - Data Words
Text

5192 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWRDES Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, set the Module Description of the ECOM100. Typically this is
8
done using NetEdit, but this IBox allows you to configure the module description in the
ECOM100 using your ladder program. 9
The EWRDES is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to write the module description will be sent to the ECOM100 whenever
the power flow into the IBox goes from OFF to ON.
10
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at
V2000 for the specific error code.
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5193


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Write Gateway Address (ECWRGWA) (IB-731)


1 DS5 Used ECOM100 Write Gateway Address will write the given Gateway IP Address to the
HPP N/A ECOM100 module on a leading edge transition to the IBox. See also ECOM100 IP Setup
2 (ECIPSUP) IBox 717 to setup ALL of the
TCP/IP parameters in a single instruction - IP
Address, Subnet Mask, and Gateway Address.
3 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
4 UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5 Either the Success or Error bit parameter will
turn on once the command is complete. If there
6 is an error, the Error Code parameter will report
an ECOM100 error code (less than 100), or a
PLC logic error (greater than 1000).
7 The Gateway Address is stored in Flash-ROM in the ECOM100 and the execution of this
IBox will disable the ECOM100 module for at least a half second until it writes the Flash-
8 ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox
ONCE, on second scan. Since it requires a LEADING edge to execute, use a NORMALLY
9 CLOSED SP0 (STR NOT First Scan) to drive the power flow to the IBox.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
10 ECOM100 circuit board.

11 ECWRGWA Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
12 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
13 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14 Error Code: specifies the location where the Error Code will be written
Gateway Address: specifies the Gateway IP Address that will be written to the module
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
C Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Gateway Address . . . . . . . . . . . . . . . . . . . . . . . . 0.0.0.1. to 255.255.255.254

5194 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWRGWA Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, assign the Gateway Address of the ECOM100 to 192.168.0.1
8
The ECWRGWA is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to write the Gateway Address will be sent to the ECOM100 whenever 9
the power flow into the IBox goes from OFF to ON.
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at 10
V2000 for the specific error code.
To configure all of the ECOM100 TCP/IP parameters in one IBox, see the ECOM100 IP 11
Setup (ECIPSUP) IBox.
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5195


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Write IP Address (ECWRIP) (IB-723)


1 DS5 Used ECOM100 Write IP Address will write the given IP Address to the ECOM100 module on a
HPP N/A leading edge transition to the IBox. See also ECOM100 IP Setup (ECIPSUP) IBox 717 to
2 setup ALL of the TCP/IP parameters in a single
instruction - IP Address, Subnet Mask, and
Gateway Address.
3 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
4 UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5 Either the Success or Error bit parameter will
turn on once the command is complete. If there
6 is an error, the Error Code parameter will report
an ECOM100 error code (less than 100), or a
PLC logic error (greater than 1000).
7 The IP Address is stored in Flash-ROM in the ECOM100 and the execution of this IBox will
disable the ECOM100 module for at least a half second until it writes the Flash-ROM.
8 Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on
second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED
9 SP0 (STR NOT First Scan) to drive the power flow to the IBox.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
10 ECOM100 circuit board.

11 ECWRIP Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
12 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
13 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14 Error Code: specifies the location where the Error Code will be written
IP Address: specifies the IP Address that will be written to the module
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
C Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

D IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.0.0.1. to 255.255.255.254

5196 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWRIP Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, assign the IP Address of the ECOM100 to 192.168.12.100 8
The ECWRIP is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to write the IP Address will be sent to the ECOM100 whenever the 9
power flow into the IBox goes from OFF to ON.
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at 10
V2000 for the specific error code.
To configure all of the ECOM100 TCP/IP parameters in one IBox, see the ECOM100 IP 11
Setup (ECIPSUP) IBox.
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5197


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Write Module ID (ECWRMID) (IB-721)


1 DS5 Used ECOM100 Write Module ID will write the given Module ID on a leading edge transition to
HPP N/A the IBox
2 If the Module ID is set in the hardware using the
dipswitches, this IBox will fail and return error
3 code 1005 (decimal).
The Workspace parameter is an internal, private
4 register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5 Either the Success or Error bit parameter will turn
on once the command is complete. If there is an
6 error, the Error Code parameter will report an
ECOM100 error code (less than 100), or a PLC
7 logic error (greater than 1000).
The Module ID is stored in Flash-ROM in the ECOM100 and the execution of this IBox
will disable the ECOM100 module for at least a half second until it writes the Flash-ROM.
8 Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on
second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED
9 SP0 (STR NOT First Scan) to drive the power flow to the IBox.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
10 ECOM100 circuit board.

11 ECWRMID Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
12 specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
13 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14 Error Code: specifies the location where the Error Code will be written
Module ID: specifies the Module ID that will be written to the module
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
C Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Module ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K0-65535

5198 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWRMID Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, set the Module ID of the ECOM100. Typically this is done using
8
NetEdit, but this IBox allows you to configure the module ID of the ECOM100 using your
ladder program. 9
The EWRMID is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to write the module ID will be sent to the ECOM100 whenever the
power flow into the IBox goes from OFF to ON.
10
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at
V2000 for the specific error code.
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5199


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Write Name (ECWRNAM) (IB-725)


1 DS5 Used ECOM100 Write Name will write the given Name to the ECOM100 module on a leading
HPP N/A edge transition to the IBox. If you use a dollar sign ($) or double quote ("), use the
2 PRINT/VPRINT escape sequence of TWO
dollar signs ($$) for a single dollar sign or dollar
sign-double quote ($") for a double quote
3 character.
The Workspace parameter is an internal, private
4 register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
5 NOT be used anywhere else in your program.
Either the Success or Error bit parameter will
6 turn on once the command is complete. If there
is an error, the Error Code parameter will report
an ECOM100 error code (less than 100), or a PLC logic error (greater than 1000).
7 The Name is stored in Flash-ROM in the ECOM100 and the execution of this IBox will
disable the ECOM100 module for at least a half second until it writes the Flash-ROM.
8 Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on
second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED
9 SP0 (STR NOT First Scan) to drive the power flow to the IBox.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
10 ECOM100 circuit board.

11 ECWRNAM Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
12 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
13 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14 Error Code: specifies the location where the Error Code will be written
Module Name: specifies the Name that will be written to the module
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
C Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Module Name . . . . . . . . . . . . . . . . . . . . . . . . . . . Text

5200 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWRNAM Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, set the Module Name of the ECOM100. Typically this is done 8
using NetEdit, but this IBox allows you to configure the module name of the ECOM100
using your ladder program. 9
The EWRNAM is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to write the module name will be sent to the ECOM100 whenever the
power flow into the IBox goes from OFF to ON.
10
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at
V2000 for the specific error code.
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5201


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 Write Subnet Mask (ECWRSNM) (IB-733)


1 DS5 Used ECOM100 Write Subnet Mask will write the given Subnet Mask to the ECOM100 module
HPP N/A on a leading edge transition to the IBox. See also ECOM100 IP Setup (ECIPSUP) IBox 717
2 to setup ALL of the TCP/IP parameters in a
single instruction - IP Address, Subnet Mask,
and Gateway Address.
3 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
4 UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5 Either the Success or Error bit parameter will
turn on once the command is complete. If there
6 is an error, the Error Code parameter will report
an ECOM100 error code (less than 100), or a
PLC logic error (greater than 1000).
7 The Subnet Mask is stored in Flash-ROM in the ECOM100 and the execution of this IBox
will disable the ECOM100 module for at least a half second until it writes the Flash-ROM.
8 Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on
second scan. Since it requires a LEADING edge to execute, use a NORMALLY CLOSED
9 SP0 (STR NOT First Scan) to drive the power flow to the IBox.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
10 ECOM100 circuit board.

11 ECWRSNM Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
12 reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
13 Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14 Error Code: specifies the location where the Error Code will be written
Subnet Mask: specifies the Subnet Mask that will be written to the module
A
Parameter DL05 Range
B ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-255
See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
C Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Subnet Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . Masked IP Address

5202 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWRSNM Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
2
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx 3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
Rung 2: On the 2nd scan, assign the Subnet Mask of the ECOM100 to 255.255.0.0
8
The ECWRSNM is leading edge triggered, not power-flow driven (similar to a counter input
leg). The command to write the Subnet Mask will be sent to the ECOM100 whenever the 9
power flow into the IBox goes from OFF to ON.
If successful, turn on C100. If there is a failure, turn on C101. If it fails, you can look at 10
V2000 for the specific error code.
To configure all of the ECOM100 TCP/IP parameters in one IBox, see the ECOM100 IP 11
Setup (ECIPSUP) IBox.
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5203


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 RX Network Read (ECRX) (IB-740)


1 DS5 Used ECOM100 RX Network Read performs the RX instruction with built-in interlocking with
HPP N/A all other ECOM100 RX (ECRX) and ECOM100 WX (ECWX) IBoxes in your program to
2 simplify communications networking. It will perform the RX on the specified ECOM100#'s
network, which corresponds to a specific unique ECOM100 Configuration (ECOM100)
IBox at the top of your program.
3 The Workspace parameter is an internal, private
register used by this IBox and MUST BE
4 UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5 Whenever this IBox has power, it will read
element data from the specified slave into the
6 given destination V-memory buffer, giving other
ECOM100 RX and ECOM100 WX IBoxes on
that ECOM100# network a chance to execute.
7 For example, if you wish to read and write data continuously from 5 different slaves, you can
have all of these ECRX and ECWX instructions in ONE RUNG driven by SP1 (Always On).
8 They will execute round-robin style, automatically.

9 ECRX Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the
10 specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number

11 Workspace: specifies a V-memory location that will be used by the instruction


Slave ID: specifies the slave ECOM(100) PLC that will be targeted by the ECRX instruction

12 From Slave Element (Src): specifies the slave address of the data to be read
Number of Bytes: specifies the number of bytes to read from the slave ECOM(100) PLC
13 To Master Element (Dest): specifies the location where the slave data will be placed in the master
ECOM100 PLC
Success: specifies a bit that will turn on once the request is completed successfully
14 Error: specifies a bit that will turn on if the instruction is not successfully completed

A Parameter DL05 Range


ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
B Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Slave ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-90
C From Slave Element (Src) X,Y,C,S,T,CT,GX,GY,V,P
Number of Bytes . . . . . . . . . . . . . . . . . . . . . . . K
See DL05 V-memory map
K1-128
To Master Element (Dest) . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

5204 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECRX Example
Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all 1
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move 2
the module in the base to a different slot, then you only need to change this one IBox. V400
is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx
3
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
available for use by the other ECxxxx IBoxes using this specific ECOM100 module. 4
5
6
7
8
(example continued on next page)
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5205


Chapter 5: Intelligent Box (IBox) - Communication

ECRX Example (contd)


1 Rung 2: Using ECOM100# K0, read X0-X7 from Slave K7 and write them to slave K5 as fast
as possible. Store them in this local PLC in C200-C207, and write them to C300-C307 in
2 slave K5.
Both the ECRX and ECWX work with the ECOM100 Config IBox to simplify all
3 networking by handling all of the interlocks and proper resource sharing. They also provide
very simplified error reporting. You no longer need to worry about any SP "busy bits" or
"error bits", or what slot number a module is in, or have any counters or shift registers or any
4 other interlocks for resource management.
In this example, SP1 (always ON) is driving both the ECRX and ECWX IBoxes in the same
5 rung. On the scan that the Network Read completes, the Network Write will start that same
scan. As soon as the Network Write completes, any pending operations below it in the
6 program would get a turn. If there are no pending ECOM100 IBoxes below the ECWX,
then the very next scan the ECRX would start its request again.
7 Using the ECRX and ECWX for all of your ECOM100 network reads and writes is the
fastest the PLC can do networking. For local Serial Ports, DCM modules, or the original
ECOM modules, use the NETCFG and NETRX/NETWX IBoxes.
8
9
10
11
12
13
14
A
B
C
D

5206 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECOM100 WX Network Write(ECWX) (IB-741)


DS5 Used ECOM100 WX Network Write performs the WX instruction with built-in interlocking with 1
HPP N/A all other ECOM100 RX (ECRX) and ECOM100 WX (ECWX) IBoxes in your program to
simplify communications networking. It will 2
perform the WX on the specified ECOM100#'s
network, which corresponds to a specific unique
ECOM100 Configuration (ECOM100) IBox at
3
the top of your program.
The Workspace parameter is an internal, private 4
register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5
Whenever this IBox has power, it will write data
from the master's V-memory buffer to the
6
specified slave starting with the given slave element, giving other ECOM100 RX and
ECOM100 WX IBoxes on that ECOM100# network a chance to execute. 7
For example, if you wish to read and write data continuously from 5 different slaves, you can
have all of these ECRX and ECWX instructions in ONE RUNG driven by SP1 (Always On). 8
They will execute round-robin style, automatically.
9
ECWX Parameters
ECOM100#: this is a logical number associated with this specific ECOM100 module in the 10
specified slot. All other ECxxxx IBoxes that need to reference this ECOM100 module must
reference this logical number
Workspace: specifies a V-memory location that will be used by the instruction
11
Slave ID: specifies the slave ECOM(100) PLC that will be targeted by the ECWX instruction
From Master Element (Src): specifies the location in the master ECOM100 PLC where the data
12
will be sourced from
Number of Bytes: specifies the number of bytes to write to the slave ECOM(100) PLC 13
To Slave Element (Dest): specifies the slave address the data will be written to
Success: specifies a bit that will turn on once the request is completed successfully 14
Error: specifies a bit that will turn on if the instruction is not successfully completed
A
Parameter
ECOM100# . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
B
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Slave ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-90 C
From Master Element (Src) . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Number of Bytes . . . . . . . . . . . . . . . . . . . . . . . K
To Slave Element (Dest) X,Y,C,S,T,CT,GX,GY,V,P
K1-128
See DL05 V-memory map
D
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5207


Chapter 5: Intelligent Box (IBox) - Communication

ECWX Example
1 Rung 1: The ECOM100 Config IBox is responsible for coordination/interlocking of all
ECOM100 type IBoxes for one specific ECOM100 module. Tag the ECOM100 in slot 1 as
2 ECOM100# K0. All other ECxxxx IBoxes refer to this module # as K0. If you need to move
the module in the base to a different slot, then you only need to change this one IBox. V400
3 is used as a global result status register for the other ECxxxx IBoxes using this specific
ECOM100 module. V401 is used to coordinate/interlock the logic in all of the other ECxxxx
IBoxes using this specific ECOM100 module. V402-V502 is a common 130 byte buffer
4 available for use by the other ECxxxx IBoxes using this specific ECOM100 module.

5
6
7
8
9
10
11
12
13
14
A
B
C
D

5208 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

ECWX Example
Rung 2: Using ECOM100# K0, read X0-X7 from Slave K7 and write them to slave K5 as fast 1
as possible. Store them in this local PLC in C200-C207, and write them to C300-C307 in
slave K5. 2
Both the ECRX and ECWX work with the ECOM100 Config IBox to simplify all
networking by handling all of the interlocks and proper resource sharing. They also provide
very simplified error reporting. You no longer need to worry about any SP "busy bits" or
3
"error bits", or what slot number a module is in, or have any counters or shift registers or any
other interlocks for resource management. 4
In this example, SP1 (always ON) is driving both the ECRX and ECWX IBoxes in the same
rung. On the scan that the Network Read completes, the Network Write will start that same 5
scan. As soon as the Network Write completes, any pending operations below it in the
program would get a turn. If there are no pending ECOM100 IBoxes below the ECWX, then
the very next scan the ECRX would start its request again.
6
Using the ECRX and ECWX for all of your ECOM100 network reads and writes is the
fastest the PLC can do networking. For local Serial Ports, DCM modules, or the original
7
ECOM modules, use the NETCFG and NETRX/NETWX IBoxes.
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5209


Chapter 5: Intelligent Box (IBox) - Communication

NETCFG Network Configuration (NETCFG) (IB-700)


1 DS5 Used Network Config defines all the common information necessary for performing RX/WX
HPP N/A Networking using the NETRX and NETWX IBox instructions via a local CPU serial port,
2 DCM or ECOM module.
You must have the Network Config
3 instruction at the top of your ladder/stage
program with any other configuration IBoxes.
4 If you use more than one local serial port,
DCM or ECOM in your PLC for RX/WX
Networking, you must have a different
5 Network Config instruction for EACH
RX/WX network in your system that utilizes
6 any NETRX/NETWX IBox instructions.
The Workspace parameter is an internal, private register used by the Network Config IBox
7 and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in
your program.
The 2nd parameter "CPU Port or Slot" is the same value as in the high byte of the first LD
8 instruction if you were coding the RX or WX rung yourself. This value is CPU and port
specific (check your PLC manual). Use KF2 for the DL05 CPU serial port 2. If using a DCM
9 or ECOM module, use K1 for slot 1.

10 NETCFG Parameters
Network#: specifies a unique # for each ECOM(100) or DCM network to use
11 CPU Port or Slot: specifies the CPU port number or slot number of DCM/ECOM(100) used
Workspace: specifies a V-memory location that will be used by the instruction
12
13 Parameter
Network# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255

14 CPU Port or Slot . . . . . . . . . . . . . . . . . . . . . . . K


Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-FF
See DL05 V-memory map - Data Words

A
B
C
D

5210 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

NETCFG Example
The Network Configuration IBox coordinates all of the interaction with other Network 1
IBoxes (NETRX/NETWX). You must have a Network Configuration IBox for each serial
port network, DCM module network, or original ECOM module network in your system.
Configuration IBoxes must be at the top of your program and must execute every scan.
2
This IBox defines Network# K0 to be for the local CPU serial port #2 (KF2). For local CPU
serial ports or DCM/ECOM modules, use the same value you would use in the most
3
significant byte of the first LD instruction in a normal RX/WX rung to reference the port or
module. Any NETRX or NETWX IBoxes that need to reference this specific network would 4
enter K0 for their Network# parameter.
The Workspace register is used to maintain state information about the port or module, along 5
with proper sharing and interlocking with the other NETRX and NETWX IBoxes in the
program. This V-memory register must not be used anywhere else in the entire program. 6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5211


Chapter 5: Intelligent Box (IBox) - Communication

Network RX Read (NETRX) (IB-701)


1 DS5 Used Network RX Read performs the RX instruction with built-in interlocking with all other
HPP N/A Network RX (NETRX) and Network WX (NETWX) IBoxes in your program to simplify
2 communications networking. It will perform the RX on the specified Network #, which
corresponds to a specific unique Network
Configuration (NETCFG) at the top of your
3 program.
The Workspace parameter is an internal, private
4 register used by this IBox and MUST BE UNIQUE
in this one instruction and MUST NOT be used
5 anywhere else in your program.
Whenever this IBox has power, it will read element
6 data from the specified slave into the given
destination V-memory buffer, giving other Network
RX and Network WX IBoxes on that Network # a
7 chance to execute.
For example, if you wish to read and write data continuously from 5 different slaves, you can
8 have all of these NETRX and NETWX instructions in ONE RUNG driven by SP1 (Always
On). They will execute round-robin style, automatically.
9
NETRX Parameters
10 Network#: specifies the (CPU ports, DCMs, ECOMs) Network # defined by the NETCFG
instruction

11 Workspace: specifies a V-memory location that will be used by the instruction


Slave ID: specifies the slave PLC that will be targeted by the NETRX instruction

12 From Slave Element (Src): specifies the slave address of the data to be read
Number of Bytes: specifies the number of bytes to read from the slave device
13 To Master Element (Dest): specifies the location where the slave data will be placed in the master
PLC
Success: specifies a bit that will turn on once the request is completed successfully
14 Error: specifies a bit that will turn on if the instruction is not successfully completed

A Parameter DL05 Range


Network# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
B Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Slave ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See DL05 V-memory map - Data Words
K0-90
From Slave Element (Src) X,Y,C,S,T,CT,GX,GY,V,P See DL05 V-memory map
C Number of Bytes . . . . . . . . . . . . . . . . . . . . . . . K K1-128
To Master Element (Dest) . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map

5212 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

NETRX Example
Rung 1: The Network Configuration IBox coordinates all of the interaction with other 1
Network IBoxes (NETRX/NETWX). You must have a Network Configuration IBox for
each serial port network, DCM module network, or original ECOM module network in your
system. Configuration IBoxes must be at the top of your program and must execute every
2
scan.
This IBox defines Network# K0 to be for the local CPU serial port #2 (KF2). For local CPU 3
serial ports or DCM/ECOM modules, use the same value you would use in the most
significant byte of the first LD instruction in a normal RX/WX rung to reference the port or 4
module. Any NETRX or NETWX IBoxes that need to reference this specific network would
enter K0 for their Network# parameter.
The Workspace register is used to maintain state information about the port or module, along
5
with proper sharing and interlocking with the other NETRX and NETWX IBoxes in the
program. This V-memory register must not be used anywhere else in the entire program. 6
7
8
9
(example continued on next page)
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5213


Chapter 5: Intelligent Box (IBox) - Communication

NETRX Example (contd)


1 Rung 2: Using Network# K0, read X0-X7 from Slave K7 and write them to slave K5 as fast as
possible. Store them in this local PLC in C200-C207, and write them to C300-C307 in slave
2 K5.
Both the NETRX and NETWX work with the Network Config IBox to simplify all
networking by handling all of the interlocks and proper resource sharing. They also provide
3 very simplified error reporting. You no longer need to worry about any SP "busy bits" or
"error bits", or what port number or slot number a module is in, or have any counters or shift
4 registers or any other interlocks for resource management.
In this example, SP1 (always ON) is driving both the NETRX and NETWX IBoxes in the
5 same rung. On the scan that the Network Read completes, the Network Write will start that
same scan. As soon as the Network Write completes, any pending operations below it in the
program would get a turn. If there are no pending NETRX or NETWX IBoxes below this
6 IBox, then the very next scan the NETRX would start its request again.
Using the NETRX and NETWX for all of your serial port, DCM, or original ECOM
7 network reads and writes is the fastest the PLC can do networking. For ECOM100 modules,
use the ECOM100 and ECRX/ECWX IBoxes.
8
9
10
11
12
13
14
A
B
C
D

5214 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

Network WX Write (NETWX) (IB-702)


DS5 Used Network WX Write performs the WX instruction with built-in interlocking with all other 1
HPP N/A Network RX (NETRX) and Network WX (NETWX) IBoxes in your program to simplify
communications networking. It will perform the
WX on the specified Network #, which
2
corresponds to a specific unique Network
Configuration (NETCFG) at the top of your 3
program.
The Workspace parameter is an internal, private 4
register used by this IBox and MUST BE
UNIQUE in this one instruction and MUST
NOT be used anywhere else in your program.
5
Whenever this IBox has power, it will write data
from the master's V-memory buffer to the
6
specified slave starting with the given slave element, giving other Network RX and Network
WX IBoxes on that Network # a chance to execute. 7
For example, if you wish to read and write data continuously from 5 different slaves, you can
have all of these NETRX and NETWX instructions in ONE RUNG driven by SP1 (Always 8
On). They will execute round-robin style, automatically.
9
NETWX Parameters
Network#: specifies the (CPU ports, DCMs, ECOMs) Network # defined by the NETCFG
instruction
10
Workspace: specifies a V-memory location that will be used by the instruction
Slave ID: specifies the slave PLC that will be targeted by the NETWX instruction
11
From Master Element (Src): specifies the location in the master PLC where the data will be sourced
from
12
Number of Bytes: specifies the number of bytes to write to the slave PLC
To Slave Element (Dest): specifies the slave address the data will be written to
13
Success: specifies a bit that will turn on once the request is completed successfully
Error: specifies a bit that will turn on if the instruction is not successfully completed
14
Parameter DL05 Range
A
Network# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words B
Slave ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-90
From Master Element (Src) . . . . . . . . . . . . . . . V
Number of Bytes . . . . . . . . . . . . . . . . . . . . . . . K
See DL05 V-memory map - Data Words
K1-128
C
To Slave Element (Dest) X,Y,C,S,T,CT,GX,GY,V,P See DL05 V-memory map
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map D
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5215


Chapter 5: Intelligent Box (IBox) - Communication

NETWX Example
1 Rung 1: The Network Configuration IBox coordinates all of the interaction with other
Network IBoxes (NETRX/NETWX). You must have a Network Configuration IBox for
2 each serial port network, DCM module network, or original ECOM module network in your
system. Configuration IBoxes must be at the top of your program and must execute every
scan.
3 This IBox defines Network# K0 to be for the local CPU serial port #2 (KF2). For local CPU
serial ports or DCM/ECOM modules, use the same value you would use in the most
4 significant byte of the first LD instruction in a normal RX/WX rung to reference the port or
module. Any NETRX or NETWX IBoxes that need to reference this specific network would
5 enter K0 for their Network# parameter.
The Workspace register is used to maintain state information about the port or module, along
6 with proper sharing and interlocking with the other NETRX and NETWX IBoxes in the
program. This V-memory register must not be used anywhere else in the entire program.
7
8
9
10
11
12
13
14
A
B
C
D

5216 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Communication

NETWX Example
Rung 2: Using Network# K0, read X0-X7 from Slave K7 and write them to slave K5 as fast as 1
possible. Store them in this local PLC in C200-C207, and write them to C300-C307 in slave
K5. 2
Both the NETRX and NETWX work with the Network Config IBox to simplify all
networking by handling all of the interlocks and proper resource sharing. They also provide
very simplified error reporting. You no longer need to worry about any SP "busy bits" or
3
"error bits", or what port number or slot number a module is in, or have any counters or shift
registers or any other interlocks for resource management. 4
In this example, SP1 (always ON) is driving both the NETRX and NETWX IBoxes in the
same rung. On the scan that the Network Read completes, the Network Write will start that 5
same scan. As soon as the Network Write completes, any pending operations below it in the
program would get a turn. If there are no pending NETRX or NETWX IBoxes below this
IBox, then the very next scan the NETRX would start its request again.
6
Using the NETRX and NETWX for all of your serial port, DCM, or original ECOM
network reads and writes is the fastest the PLC can do networking. For ECOM100 modules,
7
use the ECOM100 and ECRX/ECWX IBoxes.
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5217


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Configuration (CTRIO) (IB-1000)


1 DS5 Used CTRIO Config defines all the common information for one specific CTRIO module which
N/A is used by the other CTRIO IBox instructions (for example, CTRLDPR - CTRIO Load
2 HPP
Profile, CTREDRL - CTRIO Edit and Reload Preset Table, CTRRTLM - CTRIO Run to
Limit Mode, ...).
3 The Input/Output parameters for this instruction can be
copied directly from the CTRIO Workbench configuration
4 for this CTRIO module. Since the behavior is slightly
different when the CTRIO module is in an EBC Base via an
5 ERM, you must specify whether the CTRIO module is in a
local base or in an EBC base. The DL05 PLC only supports
6 local base operation at this time.
You must have the CTRIO Config IBox at the top of your
7 ladder/stage program along with any other configuration
IBoxes.
8 If you have more than one CTRIO in your PLC, you must have a different CTRIO Config
IBox for EACH CTRIO module in your system that utilizes any CTRIO IBox instructions.
Each CTRIO Config IBox must have a UNIQUE CTRIO# value. This is how the CTRIO
9 IBoxes differentiate between the different CTRIO modules in your system.
The Workspace parameter is an internal, private register used by the CTRIO Config IBox
10 and MUST BE UNIQUE in this one instruction and MUST NOT be used anywhere else in
your program.
11
12 CTRIO Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number

13 Slot: specifies the single PLC option slot the CTRIO module occupies
Workspace: specifies a V-memory location that will be used by the instruction

14 CTRIO Location: specifies where the module is located (local base only for DL05)
Input: This needs to be set to the same V-memory register as is specified in CTRIO Workbench as
Starting V address for inputs for this unique CTRIO.
A Output: This needs to be set to the same V-memory register as is specified in CTRIO Workbench as
Starting V address for outputs for this unique CTRIO.
B
C Parameter
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K1
D Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words

5218 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Example
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system 1
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5219


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Add Entry to End of Preset Table (CTRADPT) (IB-1005)


1 DS5 Used CTRIO Add Entry to End of Preset Table, on a leading edge transition to this IBox, will
HPP N/A append an entry to the end of a memory based Preset Table on a specific CTRIO Output
2 resource. This IBox will take more than 1 PLC scan to
execute. Either the Success or Error bit will turn on when
3 the command is complete. If the Error Bit is on, you can
use the CTRIO Read Error Code (CTRRDER) IBox to
get extended error information.
4 Entry Type:
K0: Set
5 K1: Reset
K2: Pulse On (uses Pulse Time)
6 K3: Pulse Off (uses Pulse Time)
7 K4: Toggle
K5: Reset Count
8 Note that the Pulse Time parameter is ignored by some Entry Types.
The Workspace register is for internal use by this IBox instruction and MUST NOT be used
9 anywhere else in your program.

10 CTRAPT Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config)
11 Output#: specifies a CTRIO output to be used by the instruction
Entry Type: specifies the Entry Type to be added to the end of a Preset Table
12 Pulse Time: specifies a pulse time for the Pulse On and Pulse Off Entry Types
Preset Count: specifies an initial count value to begin at after Reset
13 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the instruction has successfully completed
14 Error: specifies a bit that will turn on if the instruction does not complete successfully

A Parameter DL05 Range


CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
B Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-3
Entry Type . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-5; See DL05 V-memory map - Data Words
C Pulse Time . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
Preset Count . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-65535; See DL05 V-memory map - Data Words
K0-2147434528; See DL05 V-memory map
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
D Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

5220 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRADPT Example
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system 1
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 2
through V2061 for its output data.
3
4
5
6
Rung 2: This rung is a sample method for enabling the CTRADPT command. A C-bit is
used to allow the programmer to control the command from Data View for testing purposes. 7
Turning on C0 will cause the CTRADPT instruction to add a new preset to the preset table
for output #0 on the CTRIO in slot 2. The new preset will be a command to RESET (entry
type K1=reset), pulse time is left at zero as the reset type does not use this, and the count at
8
which it will reset will be 20.
Operating procedure for this example code is to load the CTRADPT_ex1.cwb file to your
9
CTRIO, then enter the code shown here, change to RUN mode, enable output #0 by turning
on C2 in dataview, turn encoder on CTRIO to value above 10 and output #0 light will come 10
on and stay on for all counts past 10. Now reset the counter with C1, enable C0 to execute
CTRADPT command to add a reset for output #0 at a count of 20, turn on C2 to enable
output #0, then turn encoder to value of 10+ (output #0 should turn on) and then continue
11
on to count of 20+ (output #0 should turn off ).
12
13
14
A
B
C
(example continued on next page) D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5221


Chapter 5: Intelligent Box (IBox) - Counter

CTRADPT Example (contd)


1 Rung 3: This rung allows the programmer to reset the counter from the ladder logic.

2
3
4 Rung 4: This rung allows the operator to enable output #0 from the ladder code.

5
6
7
8
9
10
11
12
13
14
A
B
C
D

5222 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Clear Preset Table (CTRCLRT) (IB-1007)


DS5 Used CTRIO Clear Preset Table will clear the RAM based Preset Table on a leading edge transition 1
HPP N/A to this IBox. This IBox will take more than 1
PLC scan to execute. Either the Success or
Error bit will turn on when the command is
2
complete. If the Error Bit is on, you can use
the CTRIO Read Error Code (CTRRDER) 3
IBox to get extended error information.
The Workspace register is for internal use by 4
this IBox instruction and MUST NOT be
used anywhere else in your program. 5
CTRCLRT Parameters 6
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config)
Output#: specifies a CTRIO output to be used by the instruction 7
Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the instruction has successfully completed 8
Error: specifies a bit that will turn on if the instruction does not complete successfully
9
Parameter DL05 Range
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
10
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-3
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words 11
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5223


Chapter 5: Intelligent Box (IBox) - Counter

CTRCLRT Example
1 Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
2 CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
3
4
5
6
Rung 2: This rung is a sample method for enabling the CTRCLRT command. A C-bit is
7 used to allow the programmer to control the command from Data View for testing purposes.
Turning on C0 will cause the CTRCLRT instruction to clear the preset table for output #0
8 on the CTRIO in slot 2.
Operating procedure for this example code is to load the CTRCLRT_ex1.cwb file to your
9 CTRIO, then enter the code shown here, change to RUN mode, enable output #0 by turning
on C2 in Data View, turn encoder on CTRIO to value above 10 and output #0 light will
come on and stay on until a count of 20 is reached, where it will turn off. Now reset the
10 counter with C1, enable C0 to execute CTRCLRT command to clear the preset table, turn
on C2 to enable output #0, then turn encoder to value of 10+ (output #0 should NOT turn
11 on).

12
13
14
A
B
C
D

5224 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRCLRT Example
Rung 3: This rung allows the programmer to reset the counter from the ladder logic. 1
2
3
Rung 4: This rung allows the operator to enable output #0 from the ladder code. 4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5225


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Edit Preset Table Entry (CTREDPT) (IB-1003)


1 DS5 Used CTRIO Edit Preset Table Entry, on a leading edge transition to this IBox, will edit a single
HPP N/A entry in a Preset Table on a specific CTRIO Output resource. This IBox is good if you are
2 editing more than one entry in a file at a time. If you
wish to do just one edit and then reload the table
immediately, see the CTRIO Edit and Reload Preset
3 Table Entry (CTREDRL) IBox. This IBox will take
more than 1 PLC scan to execute. Either the Success
4 or Error bit will turn on when the command is
complete. If the Error Bit is on, you can use the
5 CTRIO Read Error Code (CTRRDER) IBox to get
extended error information.
Entry Type:
6 K0: Set
7 K1: Reset
K2: Pulse On (uses Pulse Time)
8 K3: Pulse Off (uses Pulse Time)
K4: Toggle
9 K5: Reset Count
Note that the Pulse Time parameter is ignored by some Entry Types.
10 The Workspace register is for internal use by this IBox instruction and MUST NOT be used
anywhere else in your program.
11
CTREDPT Parameters
12 CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config
Ibox)
13 Output#: specifies a CTRIO output to be used by the instruction
Table#: specifies the Table number of which an Entry is to be edited
14 Entry#: specifies the Entry location in the Preset Table to be edited
Entry Type: specifies the Entry Type to add during the edit
A Pulse Time: specifies a pulse time for the Pulse On and Pulse Off Entry Types
Preset Count: specifies an initial count value to begin at after Reset
B Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the instruction has successfully completed
C Error: specifies a bit that will turn on if the instruction does not complete successfully

5226 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

Parameter DL05 Range


CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255 1
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-3
Table# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
Entry# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-255; See DL05 V-memory map - Data Words
K0-255; See DL05 V-memory map - Data Words
2
Entry Type . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
Pulse Time . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-5; See DL05 V-memory map - Data Words
K0-65535; See DL05 V-memory map - Data Words 3
Preset Count . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-2147434528; See DL05 V-memory map
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map - Data Words
See DL05 V-memory map
4
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
5
CTREDPT Example 6
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 7
through V2061 for its output data.
8
9
10
11
(example continued on next page)
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5227


Chapter 5: Intelligent Box (IBox) - Counter

CTREDPT Example (contd)


1 Rung 2: This rung is a sample method for enabling the CTREDPT command. A C-bit is
used to allow the programmer to control the command from Data View for testing purposes.
2 Turning on C0 will cause the CTREDPT instruction to change the second preset from a reset
at a count of 20 to a reset at a count of 30 for output #0 on the CTRIO in slot 2.
3 Operating procedure for this example code is to load the CTREDPT_ex1.cwb file to your
CTRIO, then enter the code shown here, change to RUN mode, enable output #0 by turning
4 on C2 in Data View, turn encoder on CTRIO to value above 10 and output #0 light will
come on and stay on until a count of 20 is reached, where it will turn off. Now reset the
counter with C1, enable C0 to execute CTREDPT command to change the second preset,
5 turn on C2 to enable output #0, then turn encoder to value of 10+ (output #0 should turn
on) and then continue past a count of 30 (output #0 should turn off ).
6 Note that we must also reload the profile after changing the preset(s), this is why the
CTRLDPR command follows the CTREDPT command in this example.
7
8
9
10
11
12
13
14
A
B
C
D

5228 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTREDPT Example
Rung 3: This rung allows the programmer to reset the counter from the ladder logic. 1
2
3
4
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5229


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Edit Preset Table Entry and Reload (CTREDRL) (IB-1002)


1 DS5 Used CTRIO Edit Preset Table Entry and Reload, on a leading edge transition to this IBox, will
HPP N/A perform this dual operation to a CTRIO Output resource in one CTRIO command. This
2 IBox will take more than 1 PLC scan to execute. Either
the Success or Error bit will turn on when the command
is complete. If the Error Bit is on, you can use the
3 CTRIO Read Error Code (CTRRDER) IBox to get
extended error information.
4 Entry Type:
K0: Set
5 K1: Reset
K2: Pulse On (uses Pulse Time)
6 K3: Pulse Off (uses Pulse Time)
7 K4: Toggle
K5: Reset Count
8 Note that the Pulse Time parameter is ignored by some Entry Types.
The Workspace register is for internal use by this IBox instruction and MUST NOT be used
9 anywhere else in your program.

10 CTREDRL Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config
11 Ibox)
Output#: specifies a CTRIO output to be used by the instruction

12 Table#: specifies the Table number of which an Entry is to be edited


Entry#: specifies the Entry location in the Preset Table to be edited

13 Entry Type: specifies the Entry Type to add during the edit
Pulse Time: specifies a pulse time for the Pulse On and Pulse Off Entry Types

14 Preset Count: specifies an initial count value to begin at after Reset


Workspace: specifies a V-memory location that will be used by the instruction

A Success: specifies a bit that will turn on once the instruction has successfully completed
Error: specifies a bit that will turn on if the instruction does not complete successfully

B
C
D

5230 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

Parameter
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
1
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-3
Table# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-255; See DL05 V-memory map - Data Words 2
Entry# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-255; See DL05 V-memory map - Data Words
Entry Type . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
Pulse Time . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-5; See DL05 V-memory map - Data Words
K0-65535; See DL05 V-memory map - Data Words
3
Preset Count . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-2147434528; See DL05 V-memory map
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words 4
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
5
CTREDRL Example
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
6
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 7
through V2061 for its output data.
8
9
10
11
12
(example continued on next page) 13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5231


Chapter 5: Intelligent Box (IBox) - Counter

CTREDRL Example (contd)


1 Rung 2: This rung is a sample method for enabling the CTREDRL command. A C-bit is
used to allow the programmer to control the command from Data View for testing purposes.
2 Turning on C0 will cause the CTREDRL instruction to change the second preset in file 1
from a reset at a value of 20 to a reset at a value of 30.
3 Operating procedure for this example code is to load the CTREDRL_ex1.cwb file to your
CTRIO, then enter the code shown here, change to RUN mode, enable output #0 by turning
4 on C2 in Data View, turn encoder on CTRIO to value above 10 and output #0 light will
come on, continue to a count above 20 and the output #0 light will turn off. Now reset the
counter with C1, enable C0 to execute CTREDRL command to change the second preset
5 count value to 30, then turn encoder to value of 10+ (output #0 should turn on) and
continue on to a value of 30+ and the output #0 light will turn off.
6 Note that it is not necessary to reload this file seperately, however, the command can only
change one value at a time.
7
8
9
10
11
12
13
14
A
B
C
D

5232 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTREDRL Example
1
Rung 3: This rung allows the programmer to reset the counter from the ladder logic.
2
3
4
5
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5233


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Initialize Preset Table (CTRINPT) (IB-1004)


1 DS5 Used CTRIO Initialize Preset Table, on a leading edge transition to this IBox, will create a single
HPP N/A entry Preset Table in memory but not as a file, on a specific CTRIO Output resource. This
2 IBox will take more than 1 PLC scan to execute.
Either the Success or Error bit will turn on when the
3 command is complete. If the Error Bit is on, you can
use the CTRIO Read Error Code (CTRRDER) IBox
4 to get extended error information.
Entry Type:
5 K0: Set
K1: Reset
6 K2: Pulse On (uses Pulse Time)
K3: Pulse Off (uses Pulse Time)
7 K4: Toggle
8 K5: Reset Count
Note that the Pulse Time parameter is ignored by some Entry Types.
9 The Workspace register is for internal use by this IBox instruction and MUST NOT be used
anywhere else in your program.
10
CTRINPT Parameters
11 CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config
Ibox)
12 Output#: specifies a CTRIO output to be used by the instruction
Entry Type: specifies the Entry Type to add during the edit
13 Pulse Time: specifies a pulse time for the Pulse On and Pulse Off Entry Types
Preset Count: specifies an initial count value to begin at after Reset
14 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the instruction has successfully completed
A Error: specifies a bit that will turn on if the instruction does not complete successfully

B
C
D

5234 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

Parameter DL05 Range


CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255 1
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-3
Entry Type . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
Pulse Time . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-5; See DL05 V-memory map - Data Words
K0-65535; See DL05 V-memory map - Data Words
2
Preset Count . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-2147434528; See DL05 V-memory map
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words 3
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map 4
CTRINPT Example 5
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030 6
through V2061 for its output data.
7
8
9
10
11
12
(example continued on next page)
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5235


Chapter 5: Intelligent Box (IBox) - Counter

CTRINPT Example (contd)


1 Rung 2: This rung is a sample method for enabling the CTRINPT command. A C-bit is used
to allow the programmer to control the command from Data View for testing purposes.
2 Turning on C0 will cause the CTRINPT instruction to create a single entry preset table, but
not as a file, and use it for the output #0. In this case the single preset will be a set at a count
3 of 15 for output #0.
Operating procedure for this example code is to load the CTRINPT_ex1.cwb file to your
4 CTRIO, then enter the code shown here, change to RUN mode, enable output #0 by turning
on C2 in Data View, turn encoder on CTRIO to value above 15 and output #0 light will not
come on. Now reset the counter with C1, enable C0 to execute CTRINPT command to
5 create a single preset table with a preset to set output#0 at a count of 15, then turn encoder to
value of 15+ (output #0 should turn on).
6
7
8
9
10
11
12
13
14
A
B
C
D

5236 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRINPT Example
1
Rung 3: This rung allows the programmer to reset the counter from the ladder logic.
2
3
4
5
Rung 4: This rung allows the operator to enable output #0 from the ladder code. 6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5237


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Initialize Preset Table (CTRINTR) (IB-1010)


1 DS5 Used CTRIO Initialize Preset Table, on a leading edge transition to this IBox, will create a single
HPP N/A entry Preset Table in memory but not as a file, on a specific CTRIO Output resource.This
2 IBox will take more than 1 PLC scan to execute. Either the
Success or Error bit will turn on when the command is
3 complete. If the Error Bit is on, you can use the CTRIO
Read Error Code (CTRRDER) IBox to get extended error
4 information.
Entry Type:
5 K0: Set
K1: Reset
6 K2: Pulse On (uses Pulse Time)
K3: Pulse Off (uses Pulse Time)
7 K4: Toggle
8 K5: Reset Count
Note that the Pulse Time parameter is ignored by some Entry Types.
9 The Workspace register is for internal use by this IBox instruction and MUST NOT be used
anywhere else in your program.
10
CTRINTR Parameters
11 CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config
Ibox)
12 Output#: specifies a CTRIO output to be used by the instruction
Entry Type: specifies the Entry Type to add during the edit
13 Pulse Time: specifies a pulse time for the Pulse On and Pulse Off Entry Types
Preset Count: specifies an initial count value to begin at after Reset
14 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the instruction has successfully completed
A Error: specifies a bit that will turn on if the instruction does not complete successfully

B
C
D

5238 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

Parameter DL05 Range 1


CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Entry Type . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-3
K0-5; See DL05 V-memory map - Data Words
2
Pulse Time . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-65535; See DL05 V-memory map - Data Words
Preset Count . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-2147434528; See DL05 V-memory map 3
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map
4
CTRINTR Example 5
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The 6
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data. 7
8
9
10
11
12
(example continued on next page)
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5239


Chapter 5: Intelligent Box (IBox) - Counter

CTRINTR Example (contd)


1 Rung 2: This rung is a sample method for enabling the CTRINTR command. A C-bit is
used to allow the programmer to control the command from Data View for testing purposes.
2 Turning on C0 will cause the CTRINTR instruction to create a single entry preset table, but
not as a file, and use it for output #0, the new preset will be loaded when the current count is
3 reset. In this case the single preset will be a set at a count of 25 for output #0.
Operating procedure for this example code is to load the CTRINTR_ex1.cwb file to your
4 CTRIO, then enter the code shown here, change to RUN mode, enable output #0 by turning
on C2 in Data View, turn encoder on CTRIO to value above 10 and output #0 light will
come on. Now turn on C0 to execute the CTRINTR command, reset the counter with C1,
5 then turn encoder to value of 25+ (output #0 should turn on).

6
7
8
9
10
11
12
13
14
A
B
C
D

5240 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRINTR Example
1
Rung 3: This rung allows the programmer to reset the counter from the ladder logic.
2
3
4
5
6
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5241


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Load Profile (CTRLDPR) (IB-1001)


1 DS5 Used CTRIO Load Profile loads a CTRIO Profile File to a CTRIO Output resource on a leading
HPP N/A edge transition to this IBox. This IBox will take more than 1 PLC scan to execute. Either the
2 Success or Error bit will turn on when the command is
complete. If the Error Bit is on, you can use the
3 CTRIO Read Error Code (CTRRDER) IBox to get
extended error information.
The Workspace register is for internal use by this IBox
4 instruction and MUST NOT be used anywhere else in
your program.
5
6 CTRLDPR Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config)
7 Output#: specifies a CTRIO output to be used by the instruction
File#: specifies a CTRIO profile File number to be loaded
8 Workspace: specifies a V-memory location that will be used by the instruction
Success: specifies a bit that will turn on once the instruction has successfully completed
9 Error: specifies a bit that will turn on if the instruction does not complete successfully

10
Parameter DL05 Range
11 CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
K0-255
K0-3
File# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-255; See DL05 V-memory map - Data Words
12 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
13 Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

14
A
B
C
D

5242 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRLDPR Example
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system 1
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
2
3
4
5
6
Rung 2: This CTRIO Load Profile IBox will load File #1 into the working memory of 7
Output 0 in CTRIO #1. This example program requires that you load CTRLDPR_IBox.cwb
into your Hx-CTRIO(2) module.
8
9
10
11
12
13
Rung 3: If the file is successfully loaded, set Profile_Loaded.
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5243


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Read Error (CTRRDER) (IB-1014)


1 DS5 Used CTRIO Read Error Code will get the decimal error code value from the CTRIO module
HPP N/A (listed below) and place it into the given Error Code register, on a leading edge transition to
2 the IBox
Since the Error Code in the CTRIO is only maintained
3 until another CTRIO command is given, you must use
this instruction immediately after the CTRIO IBox that
reports an error via its Error bit parameter.
4 The Workspace register is for internal use by this IBox
instruction and MUST NOT be used anywhere else in
5 your program.
Error Codes:
6 0: No Error
100: Specified command code is unknown or unsupported
7 101: File number not found in the file system
102: File type is incorrect for specified output function
8 103: Profile type is unknown
9 104: Specified input is not configured as a limit on this output
105: Specified limit input edge is out of range
10 106: Specified input function is unconfigured or invalid
107: Specified input function number is out of range
11 108: Specified preset function is invalid
109: Preset table is full
12 110: Specified Table entry is out of range
111: Specified register number is out of range
13 112: Specified register is an unconfigured input or output
2001: Error reading Error Code - cannot access CTRIO via ERM
14
A CTRRDER Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config)

B Workspace: specifies a V-memory location that will be used by the instruction


Error Code: specifies the location where the Error Code will be written

C Parameter DL05 Range


CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
D Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Error Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
See DL05 V-memory map - Data Words
See DL05 V-memory map - Data Words

5244 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRRDER Example
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system 1
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
2
3
4
5
6
7
Rung 2: This CTRIO Read Error Code IBox will read the Extended Error information from
CTRIO #1. This example program requires that you load CTRRDER_IBox.cwb into your
8
Hx-CTRIO(2) module.
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5245


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Run to Limit Mode (CTRRTLM) (IB-1011)


1 DS5 Used CTRIO Run To Limit Mode, on a leading edge transition to this IBox, loads the Run to
HPP N/A Limit command and given parameters on a specific Output resource. The CTRIO's Input(s)
2 must be configured as Limit(s) for this function to work.
Valid Hexadecimal Limit Values:
3 K00 - Rising Edge of Ch1/C
K10 - Falling Edge of Ch1/C
4 K20 - Both Edges of Ch1/C
K01 - Rising Edge of Ch1/D
5 K11 - Falling Edge of Ch1/D
K21 - Both Edges of Ch1/D
6 K02 - Rising Edge of Ch2/C
K12 - Falling Edge of Ch2/C
7 K22 - Both Edges of Ch2/C
8 K03 - Rising Edge of Ch2/D
K13 - Falling Edge of Ch2/D
9 K23 - Both Edges of Ch2/D
This IBox will take more than 1 PLC scan to execute. Either the Success or Error bit will turn
10 on when the command is complete. If the Error Bit is on, you can use the CTRIO Read
Error Code (CTRRDER) IBox to get extended error information.
11 The Workspace register is for internal use by this IBox instruction and MUST NOT be used
anywhere else in your program.
12 CTRRTLM Parameters
13 CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config
Ibox)
Output#: specifies a CTRIO output to be used by the instruction
14 Frequency: specifies the output pulse rate (H0-CTRIO: 20Hz - 25KHz / H0-CTRIO2: 20Hz -
250 KHz)
A Limit: the CTRIO's Input(s) must be configured as Limit(s) for this function to operate
Duty Cycle: specifies the % of on time versus off time. This is a hex number. Default of 0 is 50%,
B also entering 50 will yield 50%. 50% duty cycle is defined as on half the time and off half the time
Workspace: specifies a V-memory location that will be used by the instruction
C Success: specifies a bit that will turn on once the instruction has successfully completed
Error: specifies a bit that will turn on if the instruction does not complete successfully
D

5246 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

Parameter DL05 Range 1


CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-3
K20-20000; See DL05 V-memory map - Data Words
2
Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-FF; See DL05 V-memory map - Data Words
Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-99; See DL05 V-memory map - Data Words 3
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map
4
CTRRTLM Example 5
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The 6
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data. 7
8
9
10
11
Rung 2: This CTRIO Run To Limit Mode IBox sets up Output #0 in CTRIO #1 to output
pulses at a Frequency of 1000 Hz until Llimit #0 comes on. This example program requires
12
that you load CTRRTLM_IBox.cwb into your Hx-CTRIO(2) module.
13
14
A
B
C
D
(example continued on next page)

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5247


Chapter 5: Intelligent Box (IBox) - Counter

CTRRTLM Example (contd)


1 Rung 3: If the Run To Limit Mode parameters are OK, set the Direction Bit and Enable the
output.
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

5248 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Run to Position Mode (CTRRTPM) (IB-1012)


CTRIO Run To Position Mode, on a leading edge transition to this IBox, loads the Run to 1
DS5 Used Position command and given parameters on a specific Output resource.
HPP N/A
Valid Function Values are: 2
00: Less Than Ch1/Fn1
10: Greater Than Ch1/Fn1 3
01: Less Than Ch1/Fn2
11: Greater Than Ch1/Fn2 4
02: Less Than Ch2/Fn1
12: Greater Than Ch2/Fn1 5
03: Less Than Ch2/Fn2
13: Greater Than Ch2/Fn2
6
This IBox will take more than 1 PLC scan to execute. Either the Success or Error bit will turn
on when the command is complete. If the Error Bit is on, you can use the CTRIO Read
7
Error Code (CTRRDER) IBox to get extended error information.
The Workspace register is for internal use by this IBox instruction and MUST NOT be used 8
anywhere else in your program.
9
CTRRTPM Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config 10
Ibox)
Output#: specifies a CTRIO output to be used by the instruction 11
Frequency: specifies the output pulse rate (H0-CTRIO: 20Hz - 25KHz / H0-CTRIO2: 20Hz -
250 KHz) 12
Duty Cycle: specifies the % of on time versus off time. This is a hex number. Default of 0 is 50%,
also entering 50 will yield 50%. 50% duty cycle is defined as on half the time and off half the time
Position: specifies the count value, as measured on the encoder input, at which the output pulse
13
train will be turned off
Workspace: specifies a V-memory location that will be used by the instruction 14
Success: specifies a bit that will turn on once the instruction has successfully completed
Error: specifies a bit that will turn on if the instruction does not complete successfully
A
Parameter
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
DL05 Range
K0-255
B
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-3
Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K20-20000; See DL05 V-memory map - Data Words C
Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-99; See DL05 V-memory map
Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
K0-2147434528; See DL05 V-memory map
See DL05 V-memory map - Data Words
D
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5249


Chapter 5: Intelligent Box (IBox) - Counter

CTRRTPM Example
1 Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
2 CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
3
4
5
6
7
Rung 2: This CTRIO Run To Position Mode IBox sets up Output #0 in CTRIO #1 to
8 output pulses at a Frequency of 1000 Hz, use the 'Greater than Ch1/Fn1' comparison
operator, until the input position of 1500 is reached. This example program requires that you
load CTRRTPM_IBox.cwb into your Hx-CTRIO(2) module.
9
10
11
12
13
14
Rung 3: If the Run To Position Mode parameters are OK, set the Direction Bit and Enable
A the output.

B
C
D

5250 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Velocity Mode (CTRVELO) (IB-1013)


DS5 Used CTRIO Velocity Mode loads the Velocity command and given parameters on a specific
1
HPP N/A Output resource on a leading edge transition to this IBox.
This IBox will take more than 1 PLC scan to execute.
2
Either the Success or Error bit will turn on when the
command is complete. If the Error Bit is on, you can use 3
the CTRIO Read Error Code (CTRRDER) IBox to get
extended error information. 4
The Workspace register is for internal use by this IBox
instruction and MUST NOT be used anywhere else in 5
your program.
6
CTRVELO Parameters
CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config 7
Ibox)
Output#: specifies a CTRIO output to be used by the instruction 8
Frequency: specifies the output pulse rate (H0-CTRIO: 20Hz - 25KHz / H0-CTRIO2: 20Hz -
250 KHz) 9
Duty Cycle: specifies the % of on time versus off time. This is a hex number. Default of 0 is 50%,
also entering 50 will yield 50%. 50% duty cycle is defined as on half the time and off half the time
Step Count: specifies the target position as a 32-bit Hex number, a value of Kffffffff will cause the
10
profile to run continuously as long as the output is enabled
Workspace: specifies a V-memory location that will be used by the instruction 11
Success: specifies a bit that will turn on once the instruction has successfully completed
Error: specifies a bit that will turn on if the instruction does not complete successfully 12
Parameter DL05 Range 13
CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K K0-255
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K
K0-3
K20-20000; See DL05 V-memory map - Data Words
14
Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-99; See DL05 V-memory map
Step Count . . . . . . . . . . . . . . . . . . . . . . . . . . V,K K0-2147434528; See DL05 V-memory map A
Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V See DL05 V-memory map - Data Words
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map
See DL05 V-memory map
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5251


Chapter 5: Intelligent Box (IBox) - Counter

CTRVELO Example
1 Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
2 CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
3
4
5
6
7 Rung 2: This CTRIO Velocity Mode IBox sets up Output #0 in CTRIO #1 to output
10,000 pulses at a Frequency of 1000 Hz. This example program requires that you load
CTRVELO_IBox.cwb into your Hx-CTRIO(2) module.
8
9
10
11
12
13
14
A
B
C
D

5252 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRVELO Example
Rung 3: If the Velocity Mode parameters are OK, set the Direction Bit and Enable the output. 1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5253


Chapter 5: Intelligent Box (IBox) - Counter

CTRIO Write File to ROM (CTRWFTR) (IB-1006)


1 DS5 Used CTRIO Write File to ROM writes the runtime changes made to a loaded CTRIO Preset
Table back to Flash ROM on a leading edge transition to this IBox. This IBox will take more
2 HPP N/A
than 1 PLC scan to execute. Either the Success or
Error bit will turn on when the command is
3 complete. If the Error Bit is on, you can use the
CTRIO Read Error Code (CTRRDER) IBox to
4 get extended error information.
The Workspace register is for internal use by this
5 IBox instruction and MUST NOT be used
anywhere else in your program.
6
CTRWFTR Parameters
7 CTRIO#: specifies a specific CTRIO module based on a user defined number (see CTRIO Config
Ibox)
8 Output#: specifies a CTRIO output to be used by the instruction
Workspace: specifies a V-memory location that will be used by the instruction
9 Success: specifies a bit that will turn on once the instruction has successfully completed
Error: specifies a bit that will turn on if the instruction does not complete successfully
10
Parameter DL05 Range
11 CTRIO# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Output# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
K0-255
K0-3

12 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
Success . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B
See DL05 V-memory map - Data Words
See DL05 V-memory map
Error . . . . . . . . . . . . . . . . . . . . . . . X,Y,C,GX,GY,B See DL05 V-memory map
13
14
A
B
C
D

5254 DL05 Micro PLC User Manual, 6th Edition, Rev. C


Chapter 5: Intelligent Box (IBox) - Counter

CTRWFTR Example
Rung 1: This sets up the CTRIO card in slot 2 of the local base. Each CTRIO in the system 1
will need a separate CTRIO I-box before any CTRxxxx I-boxes can be used for them. The
CTRIO has been configured to use V2000 through V2025 for its input data, and V2030
through V2061 for its output data.
2
3
4
5
6
Rung 2: This CTRIO Edit Preset Table Entry IBox will change Entry 0 in Table #2 to be a 7
RESET at Count 3456. This example program requires that you load CTRWFTR_IBox.cwb
into your Hx-CTRIO(2) module.
8
9
10
11
12
13
14
(example continued on next page) A
B
C
D

DL05 Micro PLC User Manual, 6th Edition, Rev. C 5255


Chapter 5: Intelligent Box (IBox) - Counter

CTRWFTR Example (contd)


1 Rung 3: If the file is successfully editted, use a Write File To ROM IBox to save the edited
table back to the CTRIO's ROM, thereby making the changes retentive.
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D

5256 DL05 Micro PLC User Manual, 6th Edition, Rev. C

You might also like