CH 5
CH 5
CH 5
Instructions
In This Chapter...
5
Introduction................................................................................................................ 5-2
Using Boolean Instructions........................................................................................ 5-5
Boolean Instructions ................................................................................................ 5-10
Comparative Boolean............................................................................................... 5-26
Immediate Instructions............................................................................................ 5-32
Timer, Counter and Shift Register Instructions....................................................... 5-39
Accumulator/Stack Load and Output Data Instructions......................................... 5-52
Logical Instructions (Accumulator).......................................................................... 5-69
Math Instructions..................................................................................................... 5-86
Transcendental Functions....................................................................................... 5-118
Bit Operation Instructions...................................................................................... 5-120
Number Conversion Instructions
(Accumulator)......................................................................................................... 5-127
Table Instructions................................................................................................... 5-141
Clock/Calendar Instructions................................................................................... 5-171
CPU Control Instructions........................................................................................ 5-173
Program Control Instructions................................................................................ 5-175
Interrupt Instructions............................................................................................. 5-183
Message Instructions.............................................................................................. 5-186
Intelligent I/O Instructions..................................................................................... 5-194
Network Instructions.............................................................................................. 5-196
MODBUS RTU Instructions .................................................................................... 5-204
ASCII Instructions................................................................................................... 5-210
Intelligent Box (IBox) Instructions......................................................................... 5-230
Chapter 5: Standard RLL Instructions
Introduction
DL06 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)
instruction. In addition to these instructions, you may also need to refer to the Drum instruction
in Chapter 6, the Stage programming instructions in Chapter 7, PID in Chapter 8, LCD in
Chapter 10 and programming for analog modules in D0-OPTIONS-M.
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
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 discusses
the instruction.
The following paragraphs show how these instructions are used to build simple ladder
programs.
END Statement
All DL06 programs require an END statement as the last instruction. This tells the CPU
that 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.
DirectSOFT32 Example
DirectSOFT
X0 Y0
OUT
All programs must have
an END statement
END
Simple Rungs
You use a contact to start rungs that contain both contacts and coils. The boolean instruction
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.
DirectSOFT32 Example
DirectSOFT Handheld Mnemonics
X0 Y0
OUT STR X0
OUT Y0
END
END
END
Contacts in Series
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
X1, followed by OUT Y0.
DirectSOFT
Direct SOFT32 Example Handheld Mnemonics
X0 X1 Y0 STR X0
AND X1
OUT OUT Y0
END
END
Midline Outputs
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
continue a rung with more conditional outputs.
DirectSOFT
Direct SOFT32 Example Handheld Mnemonics
X0 X1 Y0 STR X0
AND X1
OUT OUT Y0
AND X2
X2 Y1 OUT Y1
AND X3
OUT OUT Y2
END
X3 Y2
OUT
END
END
Combination Networks
X0 X2 X5 Y0
You can combine the various types of OUT
series and parallel branches to solve
X1 X3 X4
almost any application problem.
The example at right shows a simple
combination network. X6
END
Comparative Boolean
Some PLC manufacturers make it really difficult to do a simple comparison of two numbers.
Some of them require you to move the data all over the place before you can actually perform
the comparison. The DL06 Micro PLCs provide Comparative Boolean instructions that allow
you to quickly and easily solve this problem. The Comparative Boolean provides evaluation of
two BCD values using boolean contacts. The valid evaluations are: equal to, not equal to, equal
to or greater than, and less than.
V1400 K1234 Y3
In the example, when the BCD value in V-memory OUT
location V1400 is equal to the constant value 1234, Y3
will energize.
Boolean Stack
There are limits to how many elements you can include in a rung. This is because the DL06
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 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 error will occur during
program compilation if the CPU encounters a rung that uses more than the eight levels of the
boolean stack.
The following example shows how the boolean stack is used to solve boolean logic.
X0 X1 ORSTR AND X4 Y0
STR
STR OUT Output
X2 AND X3
STR ANDSTR
X5 OR
ANDSTR
1 XO AND (NOT X5 or X4) AND {X1 or (X2 AND X3)}
2
3
Immediate Boolean
The DL06 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
I/O update occurs. The DL06 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
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 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.
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 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.
PWR
RUN
CPU
TX1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 RX1
TX2
RX2
LOGIC 06
K oyo
TERM
CPU Scan
X11 ... X2 X1 X0
OFF ... ON OFF OFF OFF X0
Input Image Register,
OFF X1
ON X0
Write Outputs OFF X1
Diagnostics
Boolean Instructions
Store (STR)
Aaaa
DS Used
The Store instruction begins a new rung or an additional branch in a
HPP Used
rung with a normally open contact. Status of the contact will be the
same state as the associated image register point or memory location.
Store Not (STRN)
DS Used
The Store Not instruction begins a new rung or an additional branch Aaaa
HPP Used
in a rung with a normally closed contact. Status of the contact will be
opposite the state of the associated image register point or memory
location.
In the following Store example, when input X1 is on, output Y2 will energize.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 Y2 $ B ENT
STR 1
OUT
GX C ENT
OUT 2
In the following Store Not example, when input X1 is off output Y2 will energize.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 Y2 SP B ENT
OUT STRN 1
GX C ENT
OUT 2
These instructions look like the STR and STRN instructions only the address is different.
Take note how the address is set up in the following Store Bit-of-Word example.
When bit 12 of V-memory location V1400 is on, output Y2 will energize.
DirectSOFT
DirectSOFT32
B1400.12 Y2
OUT
STR SHFT B V 1 4 0 0
K 1 2 ENT
OUT 2 ENT
In the following Store Not Bit-of-Word example, when bit 12 of V-memory location V1400
is off, output Y2 will energize.
DirectSOFT
DirectSOFT32
B1400.12 Y2
OUT
STRN SHFT B V 1 4 0 0
K 1 2 ENT
OUT 2 ENT
Or (OR)
DS Implied The Or instruction will logically OR a normally open contact in
parallel with another contact in a rung. The status of the contact will Aaaa
HPP Used
be the same state as the associated image register point or memory
location.
Or Not (ORN)
DS Implied The Or Not instruction will logically OR a normally closed contact Aaaa
HPP Used in parallel with another contact in a rung. The status of the contact
will be opposite the state of the associated image register point or
memory location.
X1 Y5 $ B ENT
STR 1
OUT
Q C ENT
OR 2
X2
GX F ENT
OUT 5
In the following Or Not example, when input X1 is on or X2 is off, output Y5 will energize.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 Y5 $ B ENT
OUT STR 1
R C ENT
ORN 2
X2
GX F ENT
OUT 5
Or Bit-of-Word (OR)
DS Implied The Or Bit-of-Word instruction will logically OR a normally
HPP Used open contact in parallel with another contact in a rung. Status Aaaa.bb
of the contact will be the same state as the bit referenced in the
associated memory location.
Or Not Bit-of-Word (ORN)
DS Implied The Or Not Bit-of-Word instruction will logically OR a
HPP Used normally closed contact in parallel with another contact in a Aaaa.bb
rung. Status of the contact will be opposite the state of the bit
referenced in the associated memory location.
In the following Or Bit-of-Word example, when input X1 or bit 7 of V1400 is on, output Y5
will energize.
DirectSOFT
DirectSOFT32
X1 Y7
OUT
B1400.7
STR 1 ENT
OR SHFT B V 1 4 0 0
K 7 ENT
OUT 7 ENT
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
DirectSOFT32
X1 Y7
OUT
B1400.7
STR 1 ENT
ORN SHFT B V 1 4 0 0
K 7 ENT
OUT 7 ENT
In the following And example, when input X1 and X2 are on output Y5 will energize.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 X2 Y5 $ B ENT
STR 1
OUT
V C ENT
AND 2
GX F ENT
OUT 5
In the following And Not example, when input X1 is on and X2 is off output Y5 will energize.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 X2 Y5 $ B ENT
OUT STR 1
W C ENT
ANDN 2
GX F ENT
OUT 5
In the following And Bit-of-Word example, when input X1 and bit 4 of V1400 is on output
Y5 will energize.
DirectSOFT
DirectSOFT32
X1 B1400.4 Y5
OUT
STR 1 ENT
AND SHFT B V 1 4 0 0
K 4 ENT
OUT 5 ENT
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.
DirectSOFT
DirectSOFT32
X1 B1400.4 Y5
OUT
STR 1 ENT
ANDN SHFT B V 1 4 0 0
K 4 ENT
OUT 5 ENT
1
OR Store (ORSTR)
OUT
DS Implied The Or Store instruction logically ORs two
HPP Used branches of a rung in parallel. Both branches must 2
begin with the Store instruction.
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.
In the following Or Store example, the branch consisting of X1 and X2 have been OR’d with
the branch consisting of X3 and X4.
Out (OUT)
Aaaa
DS Used The Out instruction reflects the status of the rung (on/off) and outputs
HPP Used the discrete (on/off) state to the specified image register point or memory OUT
location.
Multiple Out instructions referencing the same discrete location should not be used since only
the last Out instruction in the program will control the physical output point. Instead, use the
next instruction, the Or Out.
Operand Data Type DL06 Range
A aaa
Inputs X 0–777
Outputs Y 0–777
Control Relays C 0–1777
In the following Out example, when input X1 is on, output Y2 and Y5 will energize.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 Y2 $ B ENT
STR 1
OUT
GX C ENT
OUT 2
Y5
GX F ENT
OUT OUT 5
Or Out (OROUT)
The Or Out instruction allows more than one rung of discrete logic to
DS Usied A aaa
control a single output. Multiple Or Out instructions referencing the
HPP Used OROUT
same output coil may be used, since all contacts controlling the output
are logically OR’d together. If the status of any rung is on, the output will
also be on.
Operand Data Type DL06 Range
A aaa
Inputs X 0–777
Outputs Y 0-777
Control Relays C 0–1777
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 Y2
$ B ENT
OR OUT STR 1
O D F ENT ENT C ENT
INST# 3 5 2
$ E ENT
STR 4
X4 Y2 O D F C
ENT ENT ENT
INST# 3 5 2
OR OUT
NOTE: If the Bit-of-Word is entered as V1400.3 in DirectSOFT, it will be converted to B1400.3. Bit-of-Word
can also be entered as B1400.3.
DirectSOFT
DirectSOFT32
X1 B1400.3
OUT
B1401.6
Handheld Programmer Keystrokes
OUT
STR 1 ENT
OUT SHFT B V 1 4 0 0
K 3 ENT
OUT SHFT B V 1 4 0 1
K 6 ENT
In the following Out Bit-of-Word example, when input X1 is on, bit 3 of V1400 and bit 6 of
V1401 will turn on.
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 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 programming.
X0 B1400.3
OUT
X1 B1400.3
OUT
Not (NOT)
DS Used The Not instruction inverts the status of the rung at the point
HPP Used of the instruction.
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
DirectSOFT32 Handheld Programmer Keystrokes
X1 Y2 $ B ENT
STR 1
OUT
SHFT N O T ENT
TMR INST# MLR
GX C ENT
OUT 2
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 NOT instruction can only be
selected in DirectSOFT from the Instruction Browser. The rung cannot be created or displayed in DirectSOFT
versions earlier than 1.1i.
In the following example, every time X1 makes an Off-to-On transition, C0 will energize for
one scan.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X1 C0 $ B ENT
STR 1
PD
SHFT P SHFT D A ENT
CV 3 0
NOTE: When using DirectSOFT, these instructions can only be entered from the Instruction Browser.
X1 $ SHFT P D B ENT
Y4 STR CV 3 1
OUT GX E ENT
OUT 4
In the following example, each time X1 makes an On-to-Off transition, Y4 will energize for
one scan.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X1 $ SHFT N D B ENT
Y4 STR TMR 3 1
OUT GX E
ENT
OUT 4
In the following example, Y 5 will energize whenever X1 is on, or for one CPU scan when X2
transitions from Off to On.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ B ENT
X1 Y5 STR 1
OUT Q SHFT P D C ENT
OR CV 3 2
X2 GX F
ENT
OUT 5
In the following example, Y 5 will energize whenever X1 is on, or for one CPU scan when X2
transitions from On to Off.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ B ENT
X1 Y5 STR 1
OUT Q N D C
SHFT ENT
OR TMR 3 2
X2 GX F
ENT
OUT 5
In the following example, Y5 will energize for one CPU scan whenever X1 is on and X2
transitions from Off to On.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ B ENT
X1 X2 Y5 STR 1
OUT Q SHFT P D C ENT
OR CV 3 2
GX F
ENT
OUT 5
In the following example, Y5 will energize for one CPU scan whenever X1 is on and X2
transitions from On to Off.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X2 $ B ENT
X1 Y5 STR 1
OUT Q N D C
SHFT ENT
OR TMR 3 2
GX F
ENT
OUT 5
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X1 $ B
Y2 Y5 ENT
STR 1
SET
X C F ENT
SET 2 5
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X2 $ B
Y2 Y5 ENT
STR 1
RST
S C F ENT
RST 2 5
In the following example when X1 turns on, bit 1 in V1400 is set to the on state.
DirectSOFT
DirectSOFT32
X1
B1400.1
SET
STR 1 ENT
SET SHFT B V 1 4 0 0
K 1 ENT
In the following example, when X2 turns on, bit 1 in V1400 is reset to the off state.
DirectSOFT
DirectSOFT32
X2
B1400.1
RST
STR 2 ENT
RST SHFT B V 1 4 0 0
K 1 ENT
Pause (PAUSE)
DS Used The Pause instruction disables the output update on a range of outputs. Y aaa aaa
HPP Used The ladder program will continue to run and update the image register.
PAUSE
However, the outputs in the range specified in the Pause instruction
will be turned off at the output points.
In the following example, when X1 is ON, Y5–Y7 will be turned OFF. The execution of the
DirectSOFT ladder program will not be affected.
DirectSOFT32
X1 Y5 Y7
PAUSE
Since the D2–HPP 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.
$ B ENT
STR 1
O J G A ENT ENT D F ENT
INST# 9 6 0 3 5
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.
Comparative Boolean
Store If Equal (STRE)
The Store If Equal instruction begins a new rung or additional
DS Implied branch in a rung with a normally open comparative contact. The V aaa B bbb
HPP Used contact will be on when Vaaa equals Bbbb .
Store If Not Equal (STRNE)
The Store If Not Equal instruction begins a new rung or additional
DS Implied branch in a rung with a normally closed comparative contact. The V aaa B bbb
HPP Used contact will be on when Vaaa does not equal Bbbb.
In the following example, when the BCD value in V-memory location V2000 = 4933, Y3 will
energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
In the following example, when the value in V-memory location V2000 =/ 5060, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
Y3 SP SHFT E C A A A
V2000 K5060
STRN 4 2 0 0 0
OUT
F A G A ENT
5 0 6 0
GX D ENT
OUT 3
Or If Equal (ORE)
DS Implied The Or If Equal instruction connects a normally open
comparative contact in parallel with another contact. The V aaa B bbb
HPP Used
contact will be on when Vaaa = Bbbb.
Or If Not Equal (ORNE)
DS Implied The Or If Not Equal instruction connects a normally closed
HPP Used comparative contact in parallel with another contact. The V aaa B bbb
contact will be on when Vaaa does not equal Bbbb.
In the following example, when the BCD value in V-memory location V2000 = 4500 or
V2002 =/ 2500, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ SHFT E C A A A
V2000 K4500 Y3
STR 4 2 0 0 0
OUT
E F A A ENT
4 5 0 0
In the following example, when the BCD value in V-memory location V2000 = 3916 or
V2002 =/ 2500, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ SHFT E C A A A
V2000 K3916 Y3 STR 4 2 0 0 0
OUT D J B G ENT
3 9 1 6
In the following example, when the BCD value in V-memory location V2000 = 5000 and
V2002 = 2345, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
In the following example, when the BCD value in V-memory location V2000 = 5000 and
V2002 =/ 2345, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
Store (STR)
DS Implied 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
contact. The contact will be on when Aaaa is equal to or greater
than Bbbb.
Store Not (STRN)
The Comparative Store Not instruction begins a new rung or A aaa B bbb
DS Implied
HPP Used
additional branch in a rung with a normally closed comparative
contact. The contact will be on when Aaaa < Bbbb.
In the following example, when the BCD value in V-memory location V2000 M 1000, Y3 will
energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
In the following example, when the value in V-memory location V2000 < 4050, Y3 will
energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
Or (OR)
DS Implied The Comparative Or instruction connects a normally
HPP Used open comparative contact in parallel with another A aaa B bbb
contact. The contact will be on when Aaaa is equal to or
greater than Bbbb.
Or Not (ORN)
DS Implied The Comparative Or Not instruction connects a
HPP Used normally closed comparative contact in parallel with A aaa B bbb
another contact. The contact will be on when Aaaa <
Bbbb.
In the following example, when the BCD value in V-memory location V2000 = 6045 or
V2002 M 2345, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ SHFT E C A A A
V2000 K6045 Y3 STR 4 2 0 0 0
OUT G A E F ENT
6 0 4 5
In the following example when the BCD value in V-memory location V2000 = 1000 or
V2002 < 2500, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ SHFT E C A A A
V2000 K1000 Y3 STR 4 2 0 0 0
OUT B A A A ENT
1 0 0 0
R SHFT V C A A C
V2002 K2500 ORN AND 2 0 0 2
C F A A ENT
2 5 0 0
GX D ENT
OUT 3
And (AND)
The Comparative And instruction connects a normally A aaa B bbb
DS Implied
HPP Used open comparative contact in series with another contact.
The contact will be on when Aaaa is equal to or greater than
Bbbb.
And Not (ANDN) A aaa B bbb
In the following example, when the value in BCD V-memory location V2000 = 5000, and
V2002 M 2345, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
In the following example, when the value in V-memory location V2000 = 7000 and
V2002 < 2500, Y3 will energize.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ SHFT E C A A A
V2000 K7000 V2002 K2500 Y3 STR 4 2 0 0 0
OUT H A A A ENT
7 0 0 0
W SHFT V C A A C
ANDN AND 2 0 0 2
C F A A ENT
2 5 0 0
GX SHFT Y D ENT
OUT AND 3
Immediate Instructions
Store Immediate (STRI)
DS Implied The Store Immediate instruction begins a new rung or X aaa
HPP Used additional branch in a rung. The status of the contact will be
the same as the status of the associated input point at the time
the instruction is executed. The image register is not updated.
Store Not Immediate (STRNI)
The Store Not Immediate instruction begins a new rung or X aaa
DS Implied additional branch in a rung. The status of the contact will be
HPP Used opposite the status of the associated input point at the time
the instruction is executed. The image register is not updated.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X1 Y2 $ SHFT I B ENT
STR 8 1
OUT
GX C ENT
OUT 2
Or Immediate (ORI)
DS Implied The Or Immediate connects two contacts in parallel. The
HPP Used status of the contact will be the same as the status of the X aaa
associated input point at the time the instruction is executed.
The image register is not updated.
Or Not Immediate (ORNI)
DS Implied The Or Not Immediate connects two contacts in parallel.
HPP Used The status of the contact will be opposite the status of the X aaa
associated input point at the time the instruction is executed.
The image register is not updated.
X1 X2 Y5 $ B ENT
STR 1
OUT
W SHFT I C ENT
ANDN 8 2
GX F ENT
OUT 5
In the following example, when X1 is on, output point Y2 on the output module will turn
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
DirectSOFT32 Handheld Programmer Keystrokes
X1 Y2 $ B ENT
STR 1
OUTI
O D F A ENT ENT
INST# 3 5 0
C ENT
2
$ B ENT
X1 Y2
STR 1
OR OUTI O D F A ENT ENT
INST# 3 5 0
C ENT
X4 Y2 2
OR OUTI $ E ENT
STR 4
O D F A ENT ENT
INST# 3 5 0
C ENT
2
In the following example, when C0 is on,the binary pattern for X10 –X17 is loaded into
the accumulator using the Load Immediate Formatted instruction. The binary pattern in the
accumulator is written to Y30–Y37 using the Out Immediate Formatted instruction. This
technique is useful to quickly copy an input pattern to outputs (without waiting for the CPU
scan).
DirectSOFT
DirectSOFT 5
C0
LDIF X10 Location Constant X17 X16 X15 X14 X13 X12 X11 X10
K8 X10 K8 ON OFF ON ON OFF ON OFF ON
Load the value of 8 Unused accumulator bits
consecutive locations into the
are set to zero
accumulator, starting with X10.
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 0 0 0 0 0 0 1 0 1 1 0 1 0 1
OUTIF Y30
K8
Copy the value in the lower Location Constant Y37 Y36 Y35 Y34 Y33 Y32 Y31 Y30
8 bits of the accumulator to
Y30-Y37 Y30 K8 ON OFF ON ON OFF ON OFF ON
SHFT L D I F B A I ENT
ANDST 3 8 5 1 0 8
GX SHFT I F D A I ENT
OUT 8 5 3 0 8
In the following example, when X1 is on, Y2 through Y5 will be set on in the image register
and on the corresponding output points.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
$ B ENT
X1 Y2 Y5 STR 1
SETI X I C F
SHFT ENT
SET 8 2 5
In the following example, when X1 is on, Y5 through Y22 will be reset (off) in the image
register and on the corresponding output module(s).
DirectSOFT
DirectSOFT32
Handheld Programmer Keystrokes
X1 Y5 Y22
$ B ENT
RSTI STR 1
S SHFT I F C C ENT
RST 8 5 2 2
In the following example, when C0 is on, the binary pattern of X0–X17 will be loaded into the
accumulator using the Load Immediate instruction. The Out Immediate instruction could be
used to copy the 16 bits in the accumulator to output points, such as Y40–Y57. This technique
is useful to quickly copy an input pattern to output points (without waiting for a full CPU
scan to occur).
DirectSOFT
DirectSOFT32
C0 LDI Location
X17 X16 X15 X14 X13 X12 X11 X10 X7 X6 X5 X4 X3 X2 X1 X0
V40400 V40400 ON OFF ON ON OFF ON OFF OFF ON OFF ON ON OFF ON OFF ON
OUTI
V40502
SHFT L D I E A E A A ENT
ANDST 3 8 4 0 4 0 0
GX SHFT I NEXT E A F A C ENT
OUT 8 4 0 5 0 2
In the following example, when C0 is on, the binary pattern of X10–X17 will be loaded
into the accumulator using the Load Immediate Formatted instruction. The Out Immediate
Formatted instruction could be used to copy the specified number of bits in the accumulator
to the specified outputs on the output module, such as Y30–Y37. This technique is useful to
quickly copy an input pattern to outputs (without waiting for the CPU scan).
DirectSOFT
DirectSOFT32
C0 Location Constant
LDIF X10 X17 X16 X15 X14 X13 X12 X11 X10
K8 X10 K8 ON OFF ON ON OFF ON OFF ON
OUTIF Y30
K8
Location Constant Y37 Y36 Y35 Y34 Y33 Y32 Y31 Y30
Copy the value of the lower
8 bits of the accumulator to Y30 K8 ON OFF ON ON OFF ON OFF ON
Y30 - Y37
SHFT L D I F B A I ENT
ANDST 3 8 5 1 0 8
GX SHFT I F D A I ENT
OUT 8 5 3 0 8
Timer Preset
T1
T1 Y0
OUT
Current 0 10 20 30 40 50 60 0
Value 1/10 Seconds
There are those applications that need an accumulating timer, meaning it has the ability to
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 enable input starts and stops
the timer. When the timer stops, the elapsed time is maintained. When the timer starts 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 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.
Seconds
0 1 2 3 4 5 6 7 8 X1
TMRA T0
K30
X1 Enable
X2
X2
Reset Input
T0
Current 0 10 10 20 30 40 50 0
Value 1/10 Seconds
NOTE: Decimal points are not used in these timers, but the decimal point is implied. The preset and current
value for all four timers is in BCD format.
You can perform functions when the timer reaches the specified preset using the discrete 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.
DirectSOFT
Direct SOFT32 Timing Diagram
X1 Seconds
TMR T2 0 1 2 3 4 5 6 7 8
K30
X1
T2 Y0
OUT
T2
Y0
Handheld Programmer Keystrokes
Current 0 10 20 30 40 50 60 0
$ B ENT Value
STR 1
N C D A ENT
TMR 2 3 0
$ SHFT T C ENT 1/10th Seconds
STR MLR 2
GX A ENT
OUT 0
DirectSOFT
Direct SOFT32 Timing Diagram
X1 Seconds
TMR T20
K45 0 1 2 3 4 5 6 7 8
Y3 X1
TA20 K10
OUT
Y3
TA20 K20 Y4 Y4
OUT
Y5
TA20 K30 Y5
T2
OUT
Current 0 10 20 30 40 50 60 0
Value
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 data reference. DirectSOFT uses separate references, such as
“T2” for discrete status bit for Timer T2, and “TA2” for the current value of Timer T2.
X1
K30
C10
C10
Y7 T6
T6
OUT Current 0 10 10 20 30 40 50 0
Value
$ B ENT D A ENT
STR 1 3 0
$ SHFT C B A ENT $ SHFT T G ENT
STR 2 1 0 STR MLR 6
N SHFT A G GX B A ENT
TMR 0 6 OUT 1 0
K45 X1
C10
C10
Y4
TA21 K1
Y5
1/10 Seconds
OUT
$ B ENT $ T C A C A
SHFT ENT
STR 1 STR MLR 2 0 2 0
$ C B A V E T C B A
SHFT ENT SHFT SHFT ENT
STR 2 1 0 AND 4 MLR 2 1 0
N A C A E F Q E T C B B
SHFT ENT SHFT SHFT ENT
TMR 0 2 0 4 5 OR 4 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
Using Counters
Counters are used to count events . The counters available are up counters, up/down counters,
and stage counters (used with RLLPLUS programming).
The up counter (CNT) 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 reset, associated discrete bit, current value, and counter preset. The CNT counter
preset and current value are bothe single word BCD values.
X1
CNT CT1
X1
Up K3
X2
X2
Reset
CT1
Current 1 2 3 4 0 Counter preset
alue
Counts
The up down counter (UDC) 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 between the counter up and down inputs, counter reset, associated discrete bit,
current value, and counter preset. The UDC counter preset and current value are both double
word BCD values.
NOTE: The UDC uses two consecutive V-memory locations for the 8-digit value, therefore, two consecutive
timer locations. For example, if UDC CT1 is used, the next available counter number is CT3.
X1
X1 UDC CT2
Up K3
X2 X2
X3
Down
X3
CT2
Reset
Current 1 2 1 2 3 0
Value Counts
Counter Preset
The stage counter (SGCNT) 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 value is 9999. The timing diagram below shows the relationship between the
counter input, associated discrete bit, current value, counter preset and reset instruction.
X1 X1
SGCNT CT2
K3
CT2
Current 1 2 3 4 0
Value Counts Counter preset
RST
CT2
Counter (CNT)
DS Used The Counter is a two-input counter that increments when the
HPP Used count input logic transitions from Off to On. When the counter
reset input is On, the counter resets to 0. When the current Counter#
value equals the preset value, the counter status bit comes On
and the counter continues to count up to a maximum count of Count CNT CT aaa
9999. The maximum value will be held until the counter is reset. B bbb
Instruction Specifications
Reset
Counter Reference (CTaaa): Specifies the counter number.
Preset Value (Bbbb): Constant value (K) or a V-memory
location. Preset
CT2 or
CT2 Y7 Y7
OUT Current Value 1 2 3 4 0
CTA2 K1 Y3 Y3
OUT
Y4
CTA2 K2 Y4
Y5
OUT
Current 1 2 3 4 0
Value
CTA2 K3 Y5
OUT
Instruction Specifications
Counter Reference (CTaaa): Specifies the counter number.
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
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.
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 example, the
discrete status bit for counter 2 would be CT2.
NOTE: In using a counter inside a stage, the stage must be active for one scan before the input to the counter
makes a 0-1 transition. Otherwise, there is no real transition and the counter will not count.
NOTE: A V-memory preset is required only if the ladder program or an Operator Interface unit must change
the preset.
CT7 Y7 Y7
OUT Current 1 2 3 4 0
Value
C5 CT7 RST
RST CT7
$ B ENT GX B A ENT
STR 1 OUT 1 0
DirectSOFT
DirectSOFT32 Counting diagram
X1
SGCNT CT2
K10
X1
CTA2 K1 Y3
Y3
OUT
Y4
CTA2 K2 Y4
OUT
Y5
Y5 Current 1 2 3 4 0
CTA2 K3
Value
OUT
RST
CT2
HPP Used transition of the Up input and counts down on each Down
Counter #
off-to-on transition of the Down input. The counter
is reset to 0 when the Reset input is on. The count
Reset
range is 0–99999999. The count input not being Preset
NOTE: A V-memory preset is required only if the ladder program or an Operator Interface unit must change
the preset.
DirectSOFT
DirectSOFT32 Counting Diagram
X1
UDC CT2
K3 X1
X2
X2
X3
X3
CT2
CT2 Y7
Current 1 2 1 2 3 0
OUT Value
$ B ENT D ENT
STR 1 3
$ C ENT $ SHFT C SHFT T C ENT
STR 2 STR 2 MLR 2
$ D ENT GX B A ENT
STR 3 OUT 1 0
SHFT U D C C
ISG 3 2 2
X2
X3
X3
CTA2 K1 Y3 Y3
OUT
Y4
CTA2 K2 Y4 1 2 3 4 0
Current
Value
OUT
$ B ENT B ENT
STR 1 1
$ C ENT GX D ENT
STR 2 OUT 3
$ D ENT $ SHFT C SHFT T C
STR 3 STR 2 MLR 2
SHFT U D C C C ENT
ISG 3 2 2 2
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
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. The
maximum size of the shift register block depends on the number of available control relays. The
minimum block size is 8 control relays.
DirectSOFT
Direct SOFT 5 Handheld Programmer Keystrokes
X1 $ B ENT
Data Input SR STR 1
$ C ENT
STR 2
From C0
X2 $ D
Clock Input ENT
STR 3
V2000
X1 LD 8 9 3 5
V2000
Unused accumulator bits
Copy data from V2000 to the
are set to zero
lower 16 bits of the accumu-
lator
Acc. 0 0 0 0 88 99 33 55
OUT
V2010 8 9 3 5
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 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
follows:
X1 V2001 V2000
LDD
V2000 6 7 3 9 5 0 2 6
Acc. 6 7 3 9 55 00 22 66
OUTD
V2010 6 7 3 9 5 0 2 6
Copy data from the accumulator to
V2010 and V2011 V2011 V2010
X1 LD Constant 4 9 3 5
K4935
Shifted out of
accumulator
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
K4 Acc. 0 0 0 0 0 1
0 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
OUT
V2010
0 4 9 3
Output the lower 16 bits of the ac-
cumulator to V2010 V2010
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.
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
accumulator is copied to V2010 and V2011 using the Out Double instruction.
V2001 V2000
X1 6 7 3 9 5 0 2 6
LDD
V2000
OUTD
V2010 8 7 3 9 9 0 7 2
6 3 6 3 Level 7 X X X X X X X X
LD Constant
Level 8 X X X X X X X X
K6363 Current Acc. value
Acc. 0 0 0 0 66 33 66 33
Load the value 6363 into the accumu- Bucket
lator, pushing the value 5151 to the 1st Previous Acc. value Accumulator Stack
stack location and the value 3245 to
the 2nd stack location Acc. 0 0 0 0 55 1 5 1 Level 1 0 0 0 0 5 1 5 1
Level 2 0 0 0 0 3 2 4 5
0 0 0 0
Level 3 X X X X X X X X
Level 4 X X X X X X X X
Level 5 X X X X X X X X
Level 6 X X X X X X X X
Level 7 X X X X X X X X
Level 8 X X X X X X X X
Bucket
The POP instruction rotates values upward through the stack into the accumulator. When a
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.
Acc. X X X X XX XX XX X
Acc. 0 0 0 0 44 55 44 55
Using Pointers
Many of the DL06 series instructions will allow V-memory pointers as operands
(commonly known as indirect addressing). Pointers allow instructions to obtain data from
V-memory locations referenced by the pointer value.
NOTE: DL06 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 pointer
location. This instruction performs the Octal to Hexadecimal conversion automatically.
In the following example we are using a pointer operand in a Load instruction. 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 the
lower word of the accumulator.
X1 V2076 X X X X
LD
V2077 X X X X
P2000
V2100 2 6 3 5
V2000 (P2000) contains the value 440 V2101 X X X X
HEX. 440 HEX. = 2100 Octal which
contains the value 2635. V2102 X X X X
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
OUT
V2200
The following example is identical to the one above, with one exception. The LDA (Load
Address) instruction automatically converts the Octal address to Hex.
Acc. 0 0 0 0 00 44 44 00
V2076 X X X X
V2077 X X X X
Load (LD)
DS Used The Load instruction is a 16 bit instruction that loads the LD
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.
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator
and output to V2010.
DirectSOFT
Direct SOFT32
V2000
X1 LD 8 9 3 5
V2000
OUT
V2010
$ B X
STR 1 SET
SHFT L D
ANDST 3
C A A A ENT
2 0 0 0
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
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.
DirectSOFT
Direct SOFT32
X1 LDD V2001 V2000
V2000 6 7 3 9 5 0 2 6
6 7 3 9 5 0 2 6
OUTD
V2010 V2011 V2010
$ B ENT
STR 1
SHFT L D D
ANDST 3 3
C A A A ENT
2 0 0 0
GX SHFT D
OUT 3
C A B A ENT
2 0 1 0
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
In the following example, when C0 is on, the binary pattern of C10–C16 (7 bits) will be
loaded into the accumulator using the Load Formatted instruction. The lower 7 bits of the
accumulator are output to Y0–Y6 using the Out Formatted instruction.
DirectSOFT
Direct SOFT32
C0 Location Constant
LDF C10 C16 C15 C14 C13 C12 C11 C10
K7 C10 K7 OFF OFF OFF ON ON ON OFF
OUTF Y0
K7
Location Constant Y6 Y5 Y4 Y3 Y2 Y1 Y0
Copy the value from the
specified number of bits in Y0 K7 OFF OFF OFF ON ON ON OFF
the accumulator to Y0 – Y6
Handheld Programmer Keystrokes
$ SHFT C A ENT
STR 2 0
SHFT L D F
ANDST 3 5
SHFT C B A H ENT
2 1 0 7
GX SHFT F
OUT 5
A H ENT
0 7
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
In the following example, when X1 is on, the octal number 40400 will be converted to a HEX
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.
DirectSOFT
Direct SOFT32
X1 LDA Octal Hexadecimal
O 40400 4 0 4 0 0 4 1 0 0
4 1 0 0
OUT
V2000 V2000
$ B ENT
STR 1
SHFT L D A
ANDST 3 0
E A E A A ENT
4 0 4 0 0
GX SHFT V C A A A ENT
OUT AND 2 0 0 0
Helpful Hint: — The Load Address instruction can be used to convert an octal address to a
HEX address and load the value into the accumulator.
Operand Data Type DL06 Range
A aaa aaa
V-memory V See memory map See memory map
Pointer P See memory map See memory map
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
In the following example, when X1 is on, the HEX equivalent for octal 25 will be loaded into
the accumulator (this value will be placed on the stack when the Load Accumulator Indexed
instruction is executed). V-memory location V1410 will be added to the value in the first level
of the stack and the value in this location (V1435 = 2345) is loaded into the lower 16 bits of
the accumulator using the Load Accumulator Indexed instruction. The value in the lower 16
bits of the accumulator is output to V1500 using the Out instruction.
X1 LDA Octal Hexadecimal
O 25 2 5 0 0 1 5
Acc. 0 0 0 0 0 0 1 5
LDX
V1410
HEX Value in 1st
Octal stack location Octal Accumulator Stack
Move the offset to the stack.
Load the accumulator with V 1 4 1 0 + 1 5 = V 1 4 3 5 Level 1 0 0 0 0 0 0 1 5
the address to be offset Level 2 X X X X X X X X
The unused accumulator
Level 3 X X X X X X X X
bits are set to zero
OUT Level 4 X X X X X X X X
V1500 Acc. 0 0 0 0 2 3 4 5
Level 5 X X X X X X X X
The value in V1435 Level 6 X X X X X X X X
Copy the value in the lower is 2345
16 bits of the accumulator Level 7 X X X X X X X X
to V1500
2 3 4 5 Level 8 X X X X X X X X
Handheld Programmer Keystrokes
V1500
$ B ENT
STR 1
L D A C F ENT
SHFT
ANDST 3 0 2 5
SHFT L D X B E B A ENT
ANDST 3 SET 1 4 1 0
GX B F A A
PREV PREV PREV ENT
OUT 1 5 0 0
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
In the following example when X1 is on, the offset of 1 is loaded into the accumulator. This
value will be placed into the first level of the accumulator stack when the LDSX instruction
is executed. The LDSX instruction specifies the Data Label (DLBL K2) where the numerical
constant(s) are located in the program and loads the constant value, indicated by the offset in
the stack, into the lower 16 bits of the accumulator.
Hexadecimal
X1 Value in 1st. level of stack is
LD 0 0 0 1 used as offset. The value is 1
K1
The unused accumulator
bits are set to zero Accumulator Stack
Load the offset value of 1 (K1) into the lower 16
bits of the accumulator. 0 0 0 0 0 0 0 1 Level 1 0 0 0 0 0 0 0 1
Acc.
Level 2 X X X X X X X X
LDSX
Level 3 X X X X X X X X
K2
Constant Level 4 X X X X X X X X
Move the offset to the stack. K 0 0 0 2 X X X X X X X X
Level 5
Load the accumulator with the data label
number The unused accumulator Level 6 X X X X X X X X
bits are set to zero
Level 7 X X X X X X X X
OUT 0 0 0 0 0 0 0 2
Acc. Level 8 X X X X X X X X
V2000
DLBL K2
2 3 2 3
NCON
Offset 0
K3333 V2000
NCON
Offset 1
K2323
NCON
Offset 2
K4549
SHFT L D S X C ENT
ANDST 3 RST SET 2
SHFT E N D ENT
4 TMR 3
SHFT D L B L C ENT
3 ANDST 1 ANDST 2
SHFT N C O N D D D D ENT
TMR 2 INST# TMR 3 3 3 3
SHFT N C O N C D C D ENT
TMR 2 INST# TMR 2 3 2 3
SHFT N C O N E F E J ENT
TMR 2 INST# TMR 4 5 4 9
GX SHFT V C A A A ENT
OUT AND 2 0 0 0
Out (OUT)
DS Used The Out instruction is a 16-bit instruction that copies the value in OUT
HPP Used the lower 16 bits of the accumulator to a specified V-memory location A aaa
(Aaaa).
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
Pointer P See memory map
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
accumulator are copied to V2010 using the OUT instruction.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 LD V2000 $ B ENT
8 9 3 5 STR 1
V2000
SHFT L D
Load the value in V2000 into ANDST 3
the lower 16 bits of the The unused accumulator
accumulator bits are set to zero C A A A ENT
2 0 0 0
Acc. 0 0 0 0 88 99 33 55
OUT GX SHFT V C A B A ENT
OUT AND 2 0 1 0
V2010
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 OUTD instruction.
DirectSOFT
Direct SOFT32 V2001 V2000 Handheld Programmer Keystrokes
6 7 3 9 5 0 2 6
X1 $ B ENT
LDD STR 1
V2000
SHFT L D D
Load the value in V2000 and ANDST 3 3
V2001 into the accumulator Acc. 6 7 3 9 55 00 22 66
C A A A ENT
2 0 0 0
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
In the following example, when C0 is on, the binary pattern of C10–C16 (7 bits) will be
loaded into the accumulator using the Load Formatted instruction. The lower 7 bits of the
accumulator are output to Y0–Y6 using the OUTF instruction.
DirectSOFT
Direct SOFT32
C0 Location Constant
LDF C10 C16 C15 C14 C13 C12 C11 C10
K7 C10 K7 OFF OFF OFF ON ON ON OFF
$ SHFT C A ENT
STR 2 0
SHFT L D F
ANDST 3 5
SHFT C B A H ENT
2 1 0 7
GX SHFT F
OUT 5
A H ENT
0 7
Pop (POP)
DS Used The Pop instruction moves the value from the first level of the POP
HPP Used accumulator stack (32 bits) to the accumulator and shifts each
value in the stack up one level.
OUT Level 4 X X X X X X X X
V2000 Level 5 X X X X X X X X
V2000 4 5 4 5 Level 6 X X X X X X X X
Copy the value in the lower 16 bits of
the accumulator to V2000 Level 7 X X X X X X X X
Level 8 X X X X X X X X
POP
Previous Acc. value
Acc. 0 0 0 0 44 55 44 55
Pop the 1st. value on the stack into the
accumulator and move stack values Current Acc. value Accumulator Stack
up one location
Acc. 0 0 0 0 3 7 9 2 Level 1 0 0 0 0 7 9 3 0
Level 2 X X X X X X X X
OUT Level 3 X X X X X X X X
V2001
Level 4 X X X X X X X X
Pop the 1st. value on the stack into the Previous Acc. value
accumulator and move stack values
up one location Acc. 0 0 0 0 3 7 9 2
In the following example, when X1 is on, the constant value 3544 is loaded into the
accumulator. This is the value that will be output to the specified offset V-memory location
(V1525). The value 3544 will be placed onto the stack when the LDA instruction is executed.
Remember, two consecutive LD instructions places the value of the first load instruction onto
the stack. The LDA instruction converts octal 25 to HEX 15 and places the value in the
accumulator. The OUTX instruction outputs the value 3544 which resides in the first level of
the accumulator stack to V1525.
DirectSOFT
DirectSOFT32
Constant
X1 LD
3 5 4 4
K3544
The unused accumulator
Load the accumulator with
bits are set to zero
the value 3544
Acc. 0 0 0 0 3 5 4 4
Octal HEX
LDA
2 5 0 0 1 5
O25
Load the HEX equivalent to
The unused accumulator
octal 25 into the lower 16 bits
bits are set to zero
of the accumulator. This is the
offset for the Out Indexed 0 0 0 0 0 0 1 5
Acc.
instruction, which determines
the final destinaltion address
Octal Octal Octal
OUTX
V 1 5 0 0 + 2 5 = V 1 5 2 5
V1500 Accumulator Stack
The hex 15 converts
to 25 octal, which is 3 5 4 4 Level 1 0 0 0 0 3 5 4 4
Copy the value in the first
level of the stack to the added to the base Level 2 X X X X X X X X
address of V1500 to yield V1525
offset address 1525
(V1500+25) the final answer Level 3 X X X X X X X X
Level 4 X X X X X X X X
Handheld Programmer Keystrokes
Level 5 X X X X X X X X
$ B ENT
STR 1 Level 6 X X X X X X X X
Level 7 X X X X X X X X
SHFT L D PREV D F E E ENT
ANDST 3 3 5 4 4 Level 8 X X X X X X X X
L D A C F ENT
SHFT
ANDST 3 0 2 5
GX SHFT X B F A A ENT
OUT SET 1 5 0 0
In the following example, when X1 is on, the value in V1400 will be loaded into the lower
16 bits of the accumulator using the LD instruction. The value in the lower 8 bits of the
accumulator is copied to V1500 using the OUTL instruction.
DirectSOFT
Direct SOFT32
X1 Load the value in V1400 into V1400
LD the lower 16 bits of the
V1400 accumulater 8 9 3 5
$ B ENT
STR 1
0 0 3 5
SHFT L D B E A A ENT
ANDST 3 1 4 0 0 V1500
GX SHFT L B F A A ENT
OUT ANDST 1 5 0 0
Out Most
(OUTM)
DS Used The OUTM instruction copies the value in the upper eight bits of O UT M
HPP Used the lower sixteen bits of the accumulator to the upper eight bits of the A aaa
specified V-memory location (i.e., it copies the high byte of the low
word of the accumulator).
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
In the following example, when X1 is on, the value in V1400 will be loaded into the lower 16
bits of the accumulator using the LD instruction. The value in the upper 8 bits of the lower 16
bits of the accumulator is copied to V1500 using the OUTM instruction.
DirectSOFT
Direct SOFT32
X1 Load the value in V1400 into V1400
LD the lower 16 bits of the
V1400 accumulator 8 9 3 5
$ B ENT 8 9 0 0
STR 1
V1500
SHFT L D B E A A ENT
ANDST 3 1 4 0 0
GX SHFT M B F A A ENT
OUT ORST 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator
using the LD 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.
DirectSOFT
Direct SOFT32
X1 V2000
LD
2 8 7 A
V2000
Load the value in V2000 into The upper 16 bits of the accumulator
the lower 16 bits of the 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
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
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
OUT
V2010
2 8 3 8
Copy the lower 16 bits of the
accumulator to V2010 V2010
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
V SHFT V C A A G ENT
AND AND 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into
the accumulator using the LDD instruction. The value in the accumulator is ANDed with
36476A38 using the ANDD instruction. The value in the accumulator is output to V2010 and
V2011 using the OUTD instruction.
DirectSOFT
DirectSOFT 5 V2000 V2000
X1 LDD 5 4 ?
7 E 2 8 7 A
V2000
ANDD
K36476A38 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
OUTD
V2010 1 4 4 6 2 8 3 8
Copy the value in the V2011 V2010
accumulator to V2010 and
V2011
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
V SHFT D SHFT K D G E H G SHFT A SHFT D I ENT
AND 3 JMP 3 6 4 7 6 0 3 8
GX SHFT D C A B A ENT
OUT 3 2 0 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the LDF instruction loads C10–C13 (4 binary bits)
into the accumulator. The accumulator contents is logically ANDed with the bit pattern from
Y20–Y23 using the ANDF instruction. The OUTF instruction outputs the accumulator’s
lower four bits to C20–C23.
DirectSOFT
DirectSOFT32
X1 Location Constant
LDF C10 C13 C12 C11 C10
K4 C10 K4 ON ON ON OFF
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the binary value in the accumulator will be ANDed
with the binary value in the first level or the accumulator stack. The result resides in the
accumulator. The 32-bit value is then output to V1500 and V1501.
DirectSOFT
DirectSOFT32
X1 LDD V1401 V1400
5 4 7 E 2 8 7 A
V1400
Load the value in V1400 and
1401 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
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
ANDS
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
36476A38
AND the value in the
accumulator with the AND (top of stack) 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
first level of the
accumulator stack Acc. 0 0 0 1
0 0 1 0 0 0 0
1 0 0 0 1
0 0
1 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0
OUTD
V1500
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
V SHFT S ENT
AND RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
Or (OR)
DS Used The Or instruction is a 16-bit instruction that logically ORs the
OR
HPP Used value in the lower 16 bits of the accumulator with a specified
A aaa
V-memory location (Aaaa). The result resides in the accumulator.
The discrete status flag indicates if the result of the OR is zero.
NOTE: Status flags are valid only until another instruction uses the same flag.
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 OR’d with V2006 using the OR
instruction. The value in the lower 16 bits of the accumulator is output to V2010 using the
Out instruction.
DirectSOFT
Direct SOFT32
X1 V2000
LD
2 8 7 A
V2000
Load the value in V2000 into The upper 16 bits of the accumulator
the lower 16 bits of the 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
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
OR
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
OUT
V2010
6 A 7 A
Copy the value in the lower
16 bits of the accumulator to V2010
V2010
Handheld Programmer Keystrokes
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
Q SHFT V C A A G ENT
OR AND 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
Or Double (ORD)
DS Used
ORD is a 32-bit instruction that logically ORs the value in
the accumulator with the value (Aaaa), which is either two ORD
HPP Used
consecutive V-memory locations or an 8-digit (max.) constant K aaa
value. The result resides in the accumulator. Discrete status flags
indicate if the result of the ORD is zero or a negative number
(the most significant bit is on).
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded
into the accumulator using the LDD instruction. The value in the accumulator is OR’d with
36476A38 using the ORD instruction. The value in the accumulator is output to V2010 and
V2011 using the OUTD instruction.
DirectSOFT
Direct SOFT32
X1 V2001 V2000
LDD
5 4 7 E 2 8 7 A
V2000
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 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
ORD
K36476A38 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
OUTD
V2010
7 6 7 F 6 A 7 A
Copy the value in the
accumulator to V2010 and V2011 V2010
V2011
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
Q SHFT D SHFT K D G E H G SHFT A SHFT D I ENT
OR 3 JMP 3 6 4 7 6 0 3 8
GX SHFT D C A B A ENT
OUT 3 2 0 1 0
Or Formatted (ORF)
DS Used The ORF instruction logically ORs the binary value in the
HPP Used accumulator and a specified range of discrete bits (1–32). The ORF A aaa
instruction requires a starting location (Aaaa) and the number of K bbb
bits (Kbbb) to be OR’d. Discrete status flags indicate if the result is
zero or negative (the most significant bit =1).
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the LDF instruction loads C10–C13 (4 binary bits)
into the accumulator. The ORF instruction logically ORs the accumulator contents with Y20–
Y23 bit pattern. The ORF instruction outputs the accumulator’s lower four bits to C20–C23.
DirectSOFT
DirectSOFT32
X1 LDF C10 Location Constant C13 C12 C11 C10
K4 C10 K4 OFF ON ON OFF
Load the status fo 4
consecutive bits (C10-C13)
into the accumulator The unused accumulator bits are set to zero
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
ORF Y20
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
K4
OR the binary bit pattern
(Y20 - Y23) with the value in
the accumulator Y23 Y22 Y21 Y20
OR (Y20-- Y23) ON OFF OFF OFF 1 0 0 0
OUTF C20
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 1 0
K4
Copy the specified number
of bits from the accumulator
to C20-C23
Handheld Programmer Keystrokes
Location Constant C23 C22 C21 C20
$ B ENT
STR 1 C20 K4 ON ON ON OFF
In the following example when X1 is on, the binary value in the accumulator will be OR’d with
the binary value in the first level of the stack. The result resides in the accumulator.
DirectSOFT
DirectSOFT32
X1 V1401 V1400
LDD
5 4 7 E 2 8 7 A
V1400
Load the value in V1400 and
V1401 in 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
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
ORS
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
OR the value in the 36476A38
accumulator with the value OR (top of stack) 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
in the first level of the
accumulator stack Acc. 0 0
1 0 1
1 0 0 1 0
1 0 0 0
1 0
1 0
1 0 1
1 0 0
1 1
0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0
OUTD
V1500
Copy the value in the 7 6 7 F 6 A 7 A
accumulator to V1500 and
V1501 V1501 V1500
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
Q SHFT S ENT
OR RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
Exclusive Or (XOR)
DS Used The XOR instruction is a 16-bit instruction that performs
HPP Used an exclusive OR of the value in the lower 16 bits of the XOR
accumulator and a specified V-memory location (Aaaa). A aaa
The result resides in the in the accumulator. The discrete
status flag indicates if the result of the XOR is zero.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator
using the LD instruction. The value in the accumulator is exclusive OR’d with V2006 using
the XOR instruction. The value in the lower 16 bits of the accumulator is output to V2010
using the OUT instruction.
DirectSOFT
Direct SOFT32
X1 V2000
LD
2 8 7 A
V2000
Load the value in V2000 into The upper 16 bits of the accumulator
the lower 16 bits of the 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
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 1 0
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
OUT
V2010
4 2 4 2
Copy the lower 16 bits of the
accumulator to V2010 V2010
$ SHFT X B ENT
STR SET 1
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded
into the accumulator using the LDD instruction. The value in the accumulator is exclusively
OR’d with 36476A38 using the XORD instruction. The value in the accumulator is output to
V2010 and V2011 using the OUTD instruction.
DirectSOFT
Direct SOFT32 V2001 V2000
X1 LDD 5 4 7 E 2 8 7 A
V2000
OUTD Acc. 0 1
0 1
0 0 0 0
1 1
0 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
V2010
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the binary pattern of C10–C13 (4 bits) will be loaded
into the accumulator using the LDF instruction. The value in the accumulator will be logically
exclusive OR’d with the bit pattern from Y20–Y23 using the XORF instruction. The value in
the lower 4 bits of the accumulator is output to C20–C23 using the OUTF instruction.
DirectSOFT
DirectSOFT32
Location Constant C13 C12 C11 C10
X1
LDF C10 C10 K4 OFF ON ON OFF
K4
Load the status of 4 The unused accumulator bits are set to zero
consecutive bits (C10-C13)
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
X0RF Y20 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
K4 Accumulator
Exclusive OR the binary bit 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
pattern (Y20-Y23) with the
value in the accumulator Y23 Y22 Y21 Y20
XORF (Y20-Y23) ON OFF ON OFF 1 0 1 0
OUTF C20
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
K4
Standard RLL
$ B ENT
STR 1
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into
the accumulator using the LDD instruction. The binary value in the accumulator will be
exclusively OR’d with 36476A38 using the XORS instruction. The value in the accumulator is
output to V1500 and V1501 using the OUTD instruction.
DirectSOFT
DirectSOFT32
X1 LDD V1401 V1400
5 4 7 E 2 8 7 A
V1400
Load the value in V1400 and
V1401 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
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
XORS
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
Exclusive OR the value 36476A38
in the accumulator XOR (1st level of Stack) 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
with the value in the
first level of the Acc. 0 0
1 0 0
1 0 1
0 0
1 0 0 0 0
1 0
1 0 0
1 0 0
1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0
accumulator stack
OUTD
V1500
6 2 3 9 4 2 4 2
Copy the value in the
accumulator to V1500 and V1501 V1501 V1500
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
Compare (CMP)
DS Used The CMP instruction is a 16-bit instruction that compares the
HPP Used value in the lower 16 bits of the accumulator with the value in CMP
a specified V-memory location (Aaaa). The corresponding status A aaa
flag will be turned on indicating the result of the comparison. The
data format for this instruction is BCD/Hex, Decimal and Binary.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example when X1 is on, the constant 4526 will be loaded into the lower 16
bits of the accumulator using the LD instruction. The value in the accumulator is compared
with the value in V2000 using the CMP 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 CMP instruction, SP60 will turn on,
energizing C30.
DirectSOFT
DirectSOFT
X1 LD CONSTANT
K4526 4 5 ?
2 6
Acc. 0 0 0 0 44 55 2?
2 66
?
Compared
with
CMP
V2000
8 9 4 5
Compare the value in the
accumulator with the value V2000
in V2000
SP60 C30
OUT
NOTE: Status flags are valid only until another instruction uses the same flag.
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 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 instruction, SP60 will
turn on energizing C30.
DirectSOFT
X1 V2001 V2000
LDD
4 5 2 6 7 2 9 9
V2000
Acc. 4 5 2 6 7 2 9 9
Compared
CMPD with
V2010
6 7 3 9 5 0 2 6
Compare the value in the
accumulator with the value V2011 V2010
in V2010 and V2011
SP60 C30
OUT
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the Load Formatted instruction loads the binary
value (6) from C10–C13 into the accumulator. The CMPF instruction compares the value
in the accumulator to the value in Y20–Y23 (E hex). 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 instruction, SP60 will turn on
energizing C30.
DirectSOFT
DirectSOFT32
Location Constant
X1 Load the value of the C13 C12 C11 C10
LDF C10
specified discrete locations C10 K4 OFF ON ON OFF
K4 (C10-- C13) into the
accumulator The unused accumulator
bits are set to zero
Compare the value in the
CMPF Y20
accumulator with the value
K4 of the specified discrete 0 0 0 0 0 0 0 6
Acc.
location (Y20-- Y23)
SP60 C30 Compared
Y23 Y22 Y21 Y20 with
OUT
ON ON ON OFF
E
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 is loaded into the
accumulator using the Load Double instruction. The value in V1410 and V1411 is loaded
into the accumulator using the Load Double instruction. The value that was loaded into the
accumulator from V1400 and V1401 is placed on top of the stack when the second Load
instruction is executed. The value in the accumulator is compared with the value in the first
level of the accumulator stack using the CMPS 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 in the stack, SP60 will turn on, energizing C30.
DirectSOFT32
DirectSOFT V1401 V1400
X1 LDD
Load the value in V1400 and 6 5 0 0 3 5 4 4
V1401 into the accumulator
V1400
SP60 C30
Acc. 5 5 0 0 3 5 4 4
OUT
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
SHFT L D D B E B A ENT
ANDST 3 3 1 4 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the LDR instruction loads the real number
representation for 7 decimal into the accumulator. The CMPR instruction compares the
accumulator contents with the real representation for decimal 6. Since 7 > 6, the corresponding
discrete status flag is turned on (special relay SP62), turning on control relay C1.
DirectSOFT
DirectSOFT32
X1 LDR Load the real number
R7.0 representation for decimal 7
into the accumulator Acc. 4 0 E 0 0 0 0 0
SP62 C1
OUT
Math Instructions
Add (ADD)
DS Used Add is a 16-bit instruction that adds a BCD value in the
ADD
HPP Used accumulator with a BCD value in a V-memory location
A aaa
(Aaaa). (You cannot use a constant as the parameter in the
box.) The result resides in the accumulator.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
Pointer P See memory map
Discrete Bit Flags Description
SP63 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.
SP67 On when the 32-bit addition instruction results in a carry.
SP70 On anytime the value in the accumulator is negative.
SP75 On when a BCD instruction is executed and a NON–BCD number was encountered.
NOTE: Status flags are valid only until another instruction uses the same flag.
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 is added to the
value in V2006 using the Add instruction. The value in the accumulator is copied to V2010
using the Out instruction.
DirectSOFT
Direct SOFT32 V2000
X1 4 9 3 5
LD
V2000
OUT
V2010 7 4 3 5
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
SHFT A D D C A A G ENT
0 3 3 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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
accumulator is copied to V2010 and V2011 using the Out Double instruction.
DirectSOFT
Direct SOFT V2001 V2000
X1 6 7 3 9 5 0 2 6
LDD
V2000
OUTD
V2010 8 7 3 9 9 0 7 2
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
SHFT A D D D C A A G ENT
0 3 3 3 2 0 0 6
GX SHFT D SHFT V C A B A ENT
OUT 3 AND 2 0 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for this feature.
DirectSOFT
DirectSOFT 5
X1 LDR
R7.0
ADDR
R15.0
OUTD
V1400
Subtract (SUB)
DS Used Subtract is a 16-bit instruction that subtracts the BCD value SUB
HPP Used (Aaaa) in a V-memory location from the BCD value in the A aaa
lower 16 bits of the accumulator. The result resides in the
accumulator.
Operand Data Type DL06Range
A aaa
V-memory V See memory map
Pointer P See memory map
NOTE: Status flags are valid only until another instruction uses the same flag.
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 the accumulator
using the Subtract instruction. The value in the accumulator is copied to V2010 using the Out
instruction.
DirectSOFT
Direct SOFT32 V2000
2 4 7 5
X1 LD
V2000
SUB _
1 5 9 2
V2006
Acc. 0 8 8 3
Subtract the value in V2006
from the value in the lower
16 bits of the accumulator
OUT 0 8 8 3
V2010
V2010
Copy the value in the lower
16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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
subtracted from the value in the accumulator. The value in the accumulator is copied to V2010
and V2011 using the Out Double instruction.
DirectSOFT
Direct SOFT32 V2001 V2000
0 1 0 6 3 2 7 4
X1 LDD
V2000
OUTD 0 0 3 9 0 8 9 9
V2010
V2011 V2010
Copy the value in the
accumulator to V2010 and
V2011
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
DirectSOFT32
X1 4 1 B 0 0 0 0 0
LDR
R22.0
7 Acc. 4 0 E 0 0 0 0 0
SUBR
R15.0 V1401 V1400
Subtract the real number 4 0 E 0 0 0 0 0 (Hex number)
15.0 from the accululator
contents, which is in real
number format.
Real Value
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
OUTD
Acc. 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V1400
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for this feature
Multiply (MUL)
DS Used Multiply is a 16-bit instruction that multiplies the BCD value
HPP Used (Aaaa), which is either a V-memory location or a 4–digit MUL
(max.) constant, by the BCD value in the lower 16 bits of the A aaa
accumulator The result can be up to 8 digits and resides in the
accumulator.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
Pointer P See memory map
Constant K 0–9999
NOTE: Status flags are valid only until another instruction uses the same flag.
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 multiplied by the value in the accumulator.
The value in the accumulator is copied to V2010 and V2011 using the Out Double instruction.
DirectSOFT
Direct SOFT32 V2000
X1 1 0 0 0
LD
V2000
The unused accumulator
Load the value in V2000 into bits are set to zero
the lower 16 bits of the
accumulator 0 0 0 0 1 0 0 0 (Accumulator)
(V2006)
X 2 5
MUL
V2006 Acc. 0 0 0 2 5 0 0 0
0 0 0 2 5 0 0 0
OUTD
V2011 V2010
V2010
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
SHFT M U L C A A G ENT
ORST ISG ANDST 2 0 0 6
GX SHFT D C A B A ENT
OUT 3 2 0 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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
V1400 and V1401. After loading the constant K2 into the accumulator, we multiply it times
12345678, which gives us 24691356.
DirectSOFT
Direct SOFT32 Display
1 2 3 4 5 6 7 8 (Accumulator)
X1 LDD Load the hex equivalent
of 12345678 decimal into
Kbc614e the accumulator.
2 4 6 9 1 3 5 6
MULD Multiply the accumulator
contents (2) by the
V1400 V1403 V1402
8-digit number in V1400
and V1401.
$ B ENT
STR 1
SHFT B C D ENT
1 2 3
GX SHFT D B E A A ENT
OUT 3 1 4 0 0
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
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
DirectSOFT32 Display
X1 4 0 E 0 0 0 0 0
LDR
R 7.0
1 0 5 Acc. 4 2 D 2 0 0 0 0
MULR
R 15.0 V1401 V1400
Multiply the accumulator 4 2 D 2 0 0 0 0 (Hex number)
contents by the real number
15.0
Real Value
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
OUTD
Acc. 0 1 0 0 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V1400
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for this feature.
Divide (DIV)
DS Used Divide is a 16-bit instruction that divides the BCD value in
HPP Used the accumulator by a BCD value (Aaaa), which is either a DIV
V-memory location or a 4-digit (max.) constant. The first part A aaa
of the quotient resides in the accumulator and the remainder
resides in the first stack location.
NOTE: Status flags are valid only until another instruction uses the same flag.
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 value in V2006
using the Divide instruction. The value in the accumulator is copied to V2010 using the Out
instruction.
DirectSOFT
Direct SOFT32 V2000
5 0 0 0
X1 LD
V2000
OUT 1 0 2
V2010 V2010
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
SHFT D I V C A A G ENT
3 8 AND 2 0 0 6
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into
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 and the remainder resides in the first stack location. The
value in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
V1401 V1400
DirectSOFT
X1 LDD 0 1 5 0 0 0 0 0
V1400
OUTD
V1500 0 0 0 3 0 0 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
DirectSOFT32 Display
X1 4 1 7 0 0 0 0 0
LDR
R15.0
Real Value
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
OUTD
Acc. 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V1400
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for this feature.
Increment (INC)
The Increment instruction increments a BCD value in a INC
DS Used
A aaa
HPP Used specified V-memory location by “1” each time the instruction
is executed.
Decrement (DEC)
DEC
DS Used The Decrement instruction decrements a BCD value in a
A aaa
HPP Used specified V-memory location by “1” each time the instruction
is executed.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
Pointer P See memory map
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following increment example, when C5 makes an Off-to-On transition the value in
V1400 increases by one.
DirectSOFT V1400
C5 8 9 3 5
INC
V1400
SHFT I N C B E A A ENT
8 TMR 2 1 4 0 0
In the following decrement example, when C5 makes an Off-to-On transition the value in
V1400 is decreased by one.
DirectSOFT V1400
C5 8 9 3 5
DEC
V1400
SHFT D E C B E A A ENT
3 4 2 1 4 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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 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.
Use either OR Constant
DirectSOFT V-memory
V1400
X1 0 A 0 5
LD LD
V1400 K2565
ADDB + 1 2 C 4 (V1420)
V1420 Acc. 1 C C 9
The binary value in the
accumulator is added to the
binary value in V1420
OUTD 1 C C 9
V1500
V1500
Copy the value in the lower
16bits of the accumulator to
V1500 and V1501
SHFT L D V 1 4 0 0 ENT
SHFT A D D B V 1 4 2 0 ENT
OU T SHFT D V 1 5 0 0 ENT
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into the
accumulator using the Load Double instruction. The binary value in the accumulator is added
with the binary value in V1420 and V1421 using the Add Binary Double instruction. The
value in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
Use either OR Constant
DirectSOFT V-memory
V1401 V1400
X1 0 0 0 0 0 A 0 1
LDD LDD
V1400 K2561
ADDBD Acc. 1 0 0 0 C A 1 1
V1420
SHFT L D D B E A A ENT
LD S HF T D S HF T 3
ANDST V3 1 1 4 4 00 0 0
ADD S HF T B
SHFT A DD SDH F T B V D 1 B 4 E 2 C A
0 ENT
0 3 3 1 3 1 4 2 0
OU T S HF T GX D SHFT
S H FDT V B 1 F 5A A 0 ENT 0
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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 accumulator is copied
to V1500 using the Out instruction.
X1 LD
LD
V1400 K1024
V1400
Load the value in V1400
into the lower 16 bits of BIN 1 0 2 4
the accumulator
Acc. 0 6 1 9
OUT
V1500
V1500
Handheld Programmer Keystrokes
SHFT L D V 1 4 0 0 ENT
SHFT S SHFT U B B
V 1 4 2 0 ENT
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded
into the accumulator using the Load Double instruction. The binary value in V1420 and
V1421 is subtracted from the binary value in the accumulator using the Subtract Binary
Double instruction. The value in the accumulator is copied to V1500 and V1501 using the
Out Double instruction.
Use either OR Constant
DirectSOFT V-memory
OUTD
0 0 0 5 E 6 F E
V1500
V1501 V1500
Copy the value in the
accumulator to V1500
and V1501
Handheld Programmer
Handheld Keystrokes
Programmer Keystrokes
STR
$ BX(IN) 1 ENT
ENT
STR 1
SHFT L D V 1 4 0 0 ENT
SHFT L D D B E A A ENT
ANDST 3
SHFT 3 U 1 4 0 0
SHFT S B B
S U B B D B E C A
VSHFT 1
RST
SHFT
4 ISG 2 1 0 1 ENT 3 1 4 2 0
ENT
GX
OUT SHFT D D B VF A1 A 5 ENT 0 0 ENT
SHFT
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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 accumulator is copied to
V1500 using the Out instruction.
X1 V1400
LD
LD 0 A 0 1
V1400 K2561
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 1 (Accumulator)
MULB
x 0 0 2 E (V1420)
V1420
Acc. 0 0 0 1 C C 2 E
The binary value in V1420 is
multiplied by the binary
value in the accumulator
OUTD
V1500 0 0 0 1 C C 2 E
STR X 1 ENT
SHFT L D V 1 4 0 0 ENT
SHFT M U L B V 1 4 2 0 ENT
NOTE: Status flags are valid only until another instruction uses the same flag.
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 the binary value
in V1420 using the Divide Binary instruction. The value in the accumulator is copied to
V1500 using the Out instruction.
Use either OR Constant
DirectSOFT Display
DirectSOFT32 V-memory
X1 V1400
LD LDD
F A 0 1
V1400 K64001
SHFT L D V 1 4 0 0 ENT
SHFT D I V B V 1 4 2 0 ENT
In the following example when C5 is on, the binary value in V2000 is increased by 1.
DirectSOFT
Direct SOFT32 V2000 Handheld Programmer Keystrokes
C5 4 A 3 C
INCB $ SHFT C F ENT
STR 2 5
V2000
SHFT I N C B C A A A ENT
Increment the binary value 8 TMR 2 1 2 0 0 0
in V2000 by“1” V2000
4 A 3 D
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT V2000
Handheld Programmer Keystrokes
4 A ?
3 C
C5 DECB $ C F
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 V2000 by“1” V2000
4 A ?
3 B
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X6 is on, the BCD value formed by discrete locations
X0–X3 is loaded into the accumulator using the LDF instruction. The BCD value formed
by discrete locations C0–C3 is added to the value in the accumulator using the ADDF
instruction. The value in the lower four bits of the accumulator is copied to Y10–Y13 using
the OUTF instruction.
DirectSOFT
X3 X2 X1 X0
X6 Load the BCD value represented ON OFF OFF OFF
LDF X0
by discrete locations X0–X3
K4 into the accumulator
The unused accumulator
bits are set to zero
Add the BCD value in the 0 0 0 0 0 0 0 8 (Accumulator) C3 C2 C1 C0
ADDF C0
accumulator with the value
K4 represented by discrete + 3 (C0-C3) OFF OFF ON ON
location C0–C3
Acc. 0 0 0 1 0 0 0 1
SHFT L D F A E ENT
ANDST 3 5 0 4
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X6 is on, the BCD value formed by discrete locations X0–
X3 is loaded into the accumulator using the LDF instruction. The BCD value formed by
discrete location C0–C3 is subtracted from the BCD value in the accumulator using the SUBF
instruction. The value in the lower four bits of the accumulator is copied to Y10–Y13 using
the OUTF instruction.
DirectSOFT
DirectSOFT32 Display X3 X2 X1 X0
X6 Load the BCD value represented ON OFF OFF ON
LDF X0
by discrete locations X0-X3 into
K4 the accumulator
The unused accumulator
bits are set to zero
SHFT L D F A E ENT
ANDST 3 5 0 4
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X6 is on, the value formed by discrete locations X0–X3 is
loaded into the accumulator using the Load Formatted instruction. The value formed by
discrete locations C0–C3 is multiplied by the value in the accumulator using the Multiply
Formatted instruction. The value in the lower four bits of the accumulator is copied to Y10–
Y13 using the Out Formatted instruction.
DirectSOFT
DirectSOFT32 Display
X3 X2 X1 X0
X6 Load the value represented OFF OFF ON ON
LDF X0
by discrete locations X0-- X3
K4 into the accumulator
The unused accumulator
bits are set to zero
Multiply the value in the 0 0 0 0 0 0 0 3 (Accumulator) C3 C2 C1 C0
MULF C0
accumulator with the value
K4 represented by discrete X 2 (C0-- C3) OFF OFF ON OFF
locations C0-- C3
Acc. 0 0 0 0 0 0 0 6
Copy the lower 4 bits of the
OUTF Y10
accumulator to discrete
K4 locations Y10-- Y13
SHFT L D F A E ENT
ANDST 3 5 0 4
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X6 is on, the value formed by discrete locations X0–X3
is loaded into the accumulator using the Load Formatted instruction. The value in the
accumulator is divided by the value formed by discrete location C0–C3 using the Divide
Formatted instruction. The value in the lower four bits of the accumulator is copied to Y10–
Y13 using the Out Formatted instruction.
DirectSOFT
DirectSOFT32 Display X3 X2 X1 X0
X6 Load the value represented ON OFF OFF OFF
LDF X0 by discrete locations X0-- X3
K4 into the accumulator
The unused accumulator
bits are set to zero
Divide the value in the 0 0 0 0 0 0 0 8 (Accumulator) C3 C2 C1 C0
DIVF C0 accumulator with the value _.. OFF OFF ON OFF
K4 represented by discrete 2 (C0-- C3)
location C0-- C3
Acc. 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0
SHFT L D F A E ENT
ANDST 3 5 0 4
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into
the accumulator using the Load Double instruction. The value in V1420 and V1421 is loaded
into the accumulator using the Load Double instruction, pushing the value previously loaded
in the accumulator onto the accumulator stack. The value in the first level of the accumulator
stack is added with the value in the accumulator using the Add Stack instruction. The value in
the accumulator is copied to V1500 and V1501 using the Out Double instruction.
DirectSOFT
DirectS OF T 32 Dis play V1401 V1400
L D D B E A A Level 7 X X X X X X X X
SHFT ENT
ANDST 3 3 1 4 0 0 X X X X X X X X
Level 8
SHFT L D D B E C A ENT
ANDST 3 3 1 4 2 0
SHFT A D D S ENT
0 3 3 RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into
the accumulator using the Load Double instruction. The value in V1420 and V1421 is loaded
into the accumulator using the Load Double instruction, pushing the value previously loaded
into the accumulator onto the accumulator stack. The BCD value in the first level of the
accumulator stack is subtracted from the BCD value in the accumulator using the Subtract
Stack instruction. The value in the accumulator is copied to V1500 and V1501 using the Out
Double instruction.
DirectSOFT
DirectSOFT32 Display V1401 V1400
X1 Load the value in V1400 and 0 0 1 7 2 0 5 6 Accumulator stack
LDD after 1st LDD
V1401 into the accumulator
V1400
Level 1 X X X X X X X X
Acc. 0 0 1 7 2 0 5 6 Level 2 X X X X X X X X
Level 3 X X X X X X X X
Acc. 0 0 2 2 2 9 7 0
Accumulator stack
after 2nd LDD
OUTD Copy the value in the
Level 1 0 0 1 7 2 0 5 6
accumulator to V1500
V1500 and V1501 Level 2 X X X X X X X X
Sta
0 0 2 2 2 9 7 0 Level 3 X X X X X X X X
V1501 V1500 Level 4 X X X X X X X X
Handheld Programmer Keystrokes Level 5 X X X X X X X X
$ B Level 6 X X X X X X X X
ENT
STR 1 Level 7 X X X X X X X X
SHFT L D D B E A A ENT Level 8 X X X X X X X X
ANDST 3 3 1 4 0 0
SHFT L D D B E C A ENT
ANDST 3 3 1 4 2 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 will be loaded into the accumulator
using the Load instruction. The value in V1420 is loaded into the accumulator using the Load
instruction, pushing the value previously loaded in the accumulator onto the accumulator
stack. The BCD value in the first level of the accumulator stack is multiplied by the BCD
value in the accumulator using the Multiply Stack instruction. The value in the accumulator is
copied to V1500 and V1501 using the Out Double instruction.
DirectSOFT
DirectSOFT32 Display V1400
X1 Load the value in V1400 into 5 0 0 0 Accumulator stack
LD The unused accumulator after 1st LDD
the accumulator
V1400 bits are set to zero
Level 1 X X X X X X X X
Acc. 0 0 0 0 5 0 0 0 Level 2 X X X X X X X X
Level 3 X X X X X X X X
V1420 Level 4 X X X X X X X X
SHFT L D B E C A
ENT
ANDST 3 1 4 2 0
SHFT M U L S ENT
ORST ISG ANDST RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the Load instruction loads the value in V1400 into
the accumulator. The value in V1420 is loaded into the accumulator using the Load Double
instruction, pushing the value previously loaded in the accumulator onto the accumulator
stack. The BCD value in the accumulator is divided by the BCD value in the first level of the
accumulator stack using the Divide Stack instruction. The Out Double instruction copies the
value in the accumulator to V1500 and V1501.
DirectSOFTDisplay
DirectSOFT32 V1400 Accumulator stack
after 1st LDD
X1 Load the value in V1400 into 0 0 2 0
LD The unused accumulator X X X X X X X X
the accumulator Level 1
V1400 bits are set to zero
Level 2 X X X X X X X X
Acc. 0 0 0 0 0 0 2 0 Level 3 X X X X X X X X
Level 4 X X X X X X X X
V1421 V1420 Level 5 X X X X X X X X
Accumulator stack
after 2nd LDD
DIVS Divide the value in the
accumulator by the value in Level 1 0 0 0 0 0 0 2 0
Acc. 0 0 0 2 5 0 0 0
the first level of the Level 2 X X X X X X X X
accumulator stack
Level 3 X X X X X X X X
Level 4 X X X X X X X X
Copy the value in the
OUTD Level 5 X X X X X X X X
accumulator to V1500
V1500 and V1501 0 0 0 2 5 0 0 0 Level 6 X X X X X X X X
V1501 V1500 Level 7 X X X X X X X X
Level 8 X X X X X X X X
D I V S Level 5 X X X X X X X X
SHFT ENT
3 8 AND RST Level 6 X X X X X X X X
GX SHFT D B F A A ENT Level 7 X X X X X X X X
OUT 3 1 5 0 0
Level 8 X X X X X X X X
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into the
accumulator using the Load Double instruction. The value in V1420 and V1421 is loaded into
the accumulator using the Load Double instruction, pushing the value previously loaded in the
accumulator onto the accumulator stack. The binary value in the first level of the accumulator
stack is added with the binary value in the accumulator using the Add Stack instruction. The
value in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
DirectSOFT
DirectS OF T 32 Dis play V1401 V1400
Level 1 0 0 3 A 5 0 C 6
OU T D C opy the value in the
accumulator to V1500 Level 2 X X X X X X X X
V1500 and V1501 0 0 5 2 0 1 2 5
Level 3 X X X X X X X X
S tandard R LL
Level 4 X X X X X X X X
Handheld Programmer Keystrokes
Level 5 X X X X X X X X
$ B Level 6 X X X X X X X X
ENT
STR 1
Level 7 X X X X X X X X
SHFT L D D B E A A ENT Level 8 X X X X X X X X
ANDST 3 3 1 4 0 0
SHFT L D D B E C A ENT
ANDST 3 3 1 4 2 0
SHFT A D D B S ENT
0 3 3 1 RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded
into the accumulator using the Load Double instruction. The value in V1420 and V1421 is
loaded into the accumulator using the Load Double instruction, pushing the value previously
loaded in the accumulator onto the accumulator stack. The binary value in the first level of the
accumulator stack is subtracted from the binary value in the accumulator using the Subtract
Stack instruction. The value in the accumulator is copied to V1500 and V1501 using the Out
Double instruction.
DirectSOFT
DirectSOFT32 Display V1401 V1400
X1 0 0 1 A 2 0 5 B Accumulator stack
LDD Load the value in V1400 and
after 1st LDD
V1401 into the accumulator
V1400
Level 1 X X X X X X X X
Acc. 0 0 1 A 2 0 5 B Level 2 X X X X X X X X
Level 3 X X X X X X X X
V1421 V1420 Level 4 X X X X X X X X
SHFT L D D B E C A ENT
ANDST 3 3 1 4 2 0
SHFT S U B B S ENT
SHFT
RST ISG 1 1 RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the Load instruction moves the value in V1400
into the accumulator. The value in V1420 is loaded into the accumulator using the Load
instruction, pushing the value previously loaded in the accumulator onto the stack. The binary
value in the accumulator stack’s first level is multiplied by the binary value in the accumulator
using the Multiply Binary Stack instruction. The Out Double instruction copies the value in
the accumulator to V1500 and V1501.
DirectSOFT
DirectSOFT32 Display V1400 Accumulator stack
C 3 5 0 after 1st LDD
X1 LD Load the value in V1400 into
the accumulator The unused accumulator
Level 1 X X X X X X X X
V1400 bits are set to zero
Level 2 X X X X X X X X
Acc. 0 0 0 0 C 3 5 0
Level 3 X X X X X X X X
Level 4 X X X X X X X X
V1420 Level 5 X X X X X X X X
0 0 1 4 Level 6 X X X X X X X X
LD Load the value in V1420 into The unused accumulator
the accumulator bits are set to zero Level 7 X X X X X X X X
V1420
Level 8 X X X X X X X X
Acc. 0 0 0 0 0 0 1 4
Level 1 0 0 0 0 C 3 5 0
Level 2 X X X X X X X X
OUTD Copy the value in the
Level 3 X X X X X X X X
accumulator to V1500
V1500 0 0 0 F 4 2 4 0
and V1501 Level 4 X X X X X X X X
V1501 V1500 Level 5 X X X X X X X X
Standard RLL
Instructions
Level 6 X X X X X X X X
Handheld Programmer Keystrokes
Level 7 X X X X X X X X
$ B ENT
STR 1 Level 8 X X X X X X X X
SHFT L D B E A A ENT
ANDST 3 1 4 0 0
SHFT L D B E C A
ENT
ANDST 3 1 4 2 0
SHFT M U L B S ENT
ORST ISG ANDST 1 RST
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 will be loaded into the accumulator
using the Load instruction. The value in V1420 and V1421 is loaded into the accumulator
using the Load Double instruction also, pushing the value previously loaded in the accumulator
onto the accumulator stack. The binary value in the accumulator is divided by the binary value
in the first level of the accumulator stack using the Divide Binary Stack instruction. The value
in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
DirectSOFT
DirectSOFT32 Display V1400 Accumulator stack
after 1st LDD
X1 Load the value in V1400 into 0 0 1 4
LD The unused accumulator
the accumulator Level 1 X X X X X X X X
V1400 bits are set to zero
Level 2 X X X X X X X X
Acc. 0 0 0 0 0 0 1 4 Level 3 X X X X X X X X
Level 4 X X X X X X X X
V1421 V1420 Level 5 X X X X X X X X
0 0 0 0 C 3 5 0 Level 6 X X X X X X X X
LDD Load the value in V1420 and
V1421 into the accumulator Level 7 X X X X X X X X
V1420
Level 8 X X X X X X X X
Acc. 0 0 0 0 C 3 5 0
Accumulator stack
after 2nd LDD
DIVBS Divide the binary value in
Level 1 0 0 0 0 0 0 1 4
the accumulator by the
binary value in the first level Acc. 0 0 0 0 0 9 C 4
Level 2 X X X X X X X X
of the accumulator stack
Level 3 X X X X X X X X
Level 4 X X X X X X X X
Level 5 X X X X X X X X
OUTD Copy the value in the
accumulator to V1500 Level 6 X X X X X X X X
V1500 and V1501 0 0 0 0 0 9 C 4
Level 7 X X X X X X X X
V1501 V1500
Level 8 X X X X X X X X
Handheld Programmer Keystrokes
The remainder resides in the
$ B ENT first stack location
STR 1
Level 1 0 0 0 0 0 0 0 0
SHFT L D B E A A ENT
ANDST 3 1 4 0 0 Level 2 X X X X X X X X
L D D B E C A Level 3 X X X X X X X X
SHFT ENT
ANDST 3 3 1 4 2 0 Level 4 X X X X X X X X
Transcendental Functions
The DL06 CPU features special numerical functions to complement its real number capability.
The transcendental functions include the trigonometric sine, cosine, and tangent, and also their
inverses (arc sine, arc cosine, and arc tangent). The square root function is also grouped with
these other functions.
The transcendental math instructions operate on a real number in the accumulator (it cannot be
BCD or binary). The real number result resides in the accumulator. The square root function
operates on the full range of positive real numbers. The sine, cosine and tangent functions
require numbers expressed in radians. You can work with angles expressed in degrees by first
converting them to radians with the Radian (RADR) instruction, then performing the trig
function. All transcendental functions utilize the following flag bits.
Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
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.
SP72 On anytime the value in the accumulator is an invalid floating point number
SP73 On when a signed addition or subtraction results in an incorrect sign bit.
SP75 On when a real number instruction is executed and a non-real number encountered.
The following example takes the sine of 45 degrees. Since these transcendental functions
operate only on real numbers, we do an LDR (load real) 45. The trig functions operate only
in radians, so we must convert the degrees to radians by using the RADR command. After
using the SINR (Sine Real) instruction, we use an OUTD (Out Double) instruction to move
the result from the accumulator to V-memory. The result is 32-bits wide, requiring the Out
Double to move it.
Accumulator contents
DirectSOFT
Direct SOFT 5 (viewed as real number)
X1 LDR Load the real number 45 into
R45
the accumulator. 45.000000
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for entering real numbers, using the LDR (Load Real) instruction.
In the following example, when X1 is on, the value formed by discrete locations X10–X17 is
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
copied to V1500 using the Out instruction.
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
Direct SOFT32 Display
X17 X16 X15 X14 X13 X12 X11 X10
X1 ON ON OFF OFF ON OFF ON ON
LDF X10
K8 The unused accumulator
bits are set to zero
Load the value represented by
discrete locations X10–X17
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
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 1 1 0 0 1 0 1 1
Acc. 0 0 0 0 0 0 0 5
SUM
OUT 0 0 0 5
V1500
V1500
Copy the value in the lower
16 bits of the accumulator
to V1500
Handheld Programmer Keystrokes
$ B ENT
STR 1
SHFT L D F B A I ENT
ANDST 3 5 1 0 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 bit pattern in the accumulator is
shifted 2 bits to the left using the Shift Left instruction. The value in the accumulator is copied
to V2010 and V2011 using the Out Double instruction.
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
Direct SOFT32
V2001 V2000
X1 LDD 6 7 0 5 33 31 10 01
V2000
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
SHFL 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
K2
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 8 7 6 5 4 3 2 1 0
Copy the value in the Acc. 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 0 0 0 0 0 0 1 0 0
accumulator to V2010 and
V2011
9 C 1 4 C 4 0 4
V2011 V2010
Handheld Programmer Keystrokes
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
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 right using the Shift Right instruction. The value in the accumulator is
copied to V2010 and V2011 using the Out Double instruction.
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
Direct SOFT32 V2001 V2000
X1 Constant 6 7 0 5 33 11 00 11
LDD
V2000
... .
The bit pattern in the
accumulator is shifted 2 bit
positions to the right Shifted out of the
accumulator
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 8 7 6 5 4 3 2 1 0
1 9 C 1 4 C 4 0
V2011 V2010
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into the
accumulator using the Load Double instruction. The bit pattern in the accumulator is rotated
2 bit positions to the left using the Rotate Left instruction. The value in the accumulator is
copied to V1500 and V1501 using the Out Double instruction.
NOTE: Status flags are valid only until another instruction uses the same flag.
DirectSOFT
DirectSOFT32 Display
V1401 V1400
X1
LDD 6 7 0 5 3 1 0 1
V1400
ROTL 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
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
OUTD
V1500
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
Copy the value in the
accumulator to V1500 Acc. 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 0 1
and V1501
9 C 1 4 C 4 0 5
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
SHFT R O T L C ENT
ORN INST# MLR ANDST 2
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into the
accumulator using the Load Double instruction. The bit pattern in the accumulator is rotated
2 bit positions to the right using the Rotate Right instruction. The value in the accumulator is
copied to V1500 and V1501 using the Out Double instruction.
DirectSOFT
Direct SOFT Display
V1401 V1400
X1 LDD 6 7 0 5 3 1 0 1
V1400
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
ROTR
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
K2
OUTD
V1500
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
Copy the value in the 0 0
1 0 0
1 0
1 1
0 0 0
1 0
1 0
1 0 0 0 0 0 0
1 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0
Acc.
accumulator to V1500
and V1501
5 9 C 1 4 C 4 0
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
SHFT R O T R C ENT
ORN INST# MLR ORN 2
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
Encode (ENCO)
DS Used The Encode instruction encodes the bit position in the
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 (decimal ENCO
31) in the accumulator. If the value to be encoded is 0000 or
0001, the instruction will place a zero in the 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.
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 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
of the accumulator is copied to V2010 using the Out instruction.
DirectSOFT
Direct SOFT32 V2000
1 0 0 0
X1 LD
V2000
Bit postion 12 is
converted
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
Encode the bit position set
to “1” in the accumulator to a 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
5 bit binary value
OUT
V2010
$ B ENT
STR 1
SHFT L D C A A A ENT
ANDST 3 2 0 0 0
SHFT E N C O ENT
4 TMR 2 INST#
GX SHFT V C A B A ENT
OUT AND 2 0 1 0
Decode (DECO)
DS Used The Decode instruction decodes a 5-bit binary value of 0–31
HPP Used (0–1Fh) in the accumulator by setting the appropriate bit
position to a 1. If the accumulator contains the value Fh (HEX), DECO
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 is
less than 32 and then the value is decoded.
In the following example when X1 is on, the value formed by discrete locations X10–X14 is
loaded into the accumulator using the Load Formatted instruction. The 5- bit binary pattern in
the accumulator is decoded by setting the corresponding bit position to a “1” using the Decode
instruction.
DirectSOFT
Direct SOFT32
X14 X13 X12 X11 X10
X1 LDF X10 OFF ON OFF ON ON
K5
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
Decode the five bit binary Acc. 0 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
pattern in the accumulator
and set the corresponding
bit position to a “1”
$ B ENT
STR 1
SHFT L D F B A F ENT
ANDST 3 5 1 0 5
SHFT D E C O ENT
3 4 2 INST#
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
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.)
DirectSOFT
DirectS OF T 32 V2001 V2000
X1 0 0 0 2 8 5 2 9
LDD
V2000
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
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
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 Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 1 0 0 0 1
the accumulator to the
binary equivalent value 2 1 5 2 1 6 3 1 8 4 2 1 5 2 1 6 3 1 8 4 2 1 5 2 1 6 3 1 8 4 2 1
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 3 8 4 2 0 5 7 8 4 7 8 2 1 0 3 6 8 2 6 8 4
4 7 7 3 1 8 4 7 6 3 1 5 8 4 7 6 8 4
4 4 0 5 7 8 4 2 0 0 5 7 8 4 2
8 1 9 4 7 6 3 1 8 4 2 6
3 8 1 5 2 4 2 6
6 2 2 6 8
4 4
8
OU T D
V2010 The Binary (HEX)
0 0 0 0 6 F 7 1 value copied to
Copy the binary data in the
V2010
accumulator to V2010 and V2011 V2011 V2010
S tandard R LL
Ins tructions
$ B
E NT
STR 1
L D D C A A A
S HF T E NT
ANDS T 3 3 2 0 0 0
S HF T B I N E NT
1 8 T MR
GX D C A B A
S HF T E NT
OU T 3 2 0 1 0
In the following example, when X1 is on, the binary, or decimal, value in V2000 and V2001 is
loaded into the accumulator using the Load Double instruction. The 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.
DirectSOFT
DirectSOFT 5 V2001 V2000
X1 0 0 0 0 6 F 7 1
LDD
V2000 Binary Value
BCD
16384 + 8192 + 2048 + 1024 + 512 + 256 + 64 + 32 + 16 + 1 = 28529
OUTD
V2010
$ B ENT
STR 1
L D D C A A A
SHFT ENT
ANDST 3 3 2 0 0 0
SHFT B C D ENT
1 2 3
GX SHFT D C A B A ENT
OUT 3 2 0 1 0
Invert (INV)
DS Used The Invert instruction inverts or takes the one’s complement INV
HPP Used of the 32-bit value in the accumulator. The result resides in
the accumulator.
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
using the Out Double instruction.
DirectSOFT
Direct SOFT32 V2001 V2000
X1 0 4 0 5 00 22 55 00
LDD
V2000
INV
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. 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1
Invert the binary bit pattern
in the accumulator
OUTD F B F A F D A F
V2010 V2011 V2010
Copy the value in the
accumulator to V2010 and
V2011
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
SHFT I N V ENT
8 TMR AND
GX SHFT D C A B A ENT
OUT 3 2 0 1 0
100000000
s accumulator
10’s complement value
In the following example when X1 is on, the value in V2000 and V2001 is loaded into the
accumulator. The 10’s complement is taken for the 8 digit accumulator using the Ten’s
Complement instruction. The value in the accumulator is copied to V2010 and V2011 using
the Out Double instruction.
DirectSOFT
DirectS OF T 32 V2001 V2000
0 0 0 0 0 0 8 7
X1
LDD
V2000
BC DC PL 9 9 9 9 9 9 1 3
Acc.
OU T D 9 9 9 9 9 9 1 3
V2010
V2011 V2010
C opy the value in the
accumulator to V2010 and
V2011
$ B E NT
STR 1
S HF T L D D C A A A E NT
ANDS T 3 3 2 0 0 0
S HF T B C D C P L E NT
1 2 3 2 CV ANDS T
GX D C A B A
S HF T E NT
OU T 3 2 0 1 0
In the following example, when X1 is on, the value in V1400 and V1401 is loaded into the
accumulator using the Load Double instruction. The BTOR instruction converts the binary,
or decimal, value in the accumulator to the equivalent real number format. The binary weight
of the MSB is converted to the real number exponent by adding it to 127 (decimal). Then the
remaining bits are copied to the mantissa as shown. The value in the accumulator is copied
to V1500 and V1501 using the Out Double instruction. The handheld programmer would
display the binary value in V1500 and V1501 as a HEX value.
DirectSOFT V1401 V1400
X1 0 0 0 5 7 2 4 1
LDD
V1400
Binary Value
2 (exp 18)
127 + 18 = 145
145 = 128 + 16 + 1
BTOR
OUTD
V1500
4 8 A E 4 8 2 0 The real number (HEX) value
Copy the real value in the copied to V1500
accumulator to V1500 and V1501 V1501 V1500
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
SHFT B T O R ENT
1 MLR INST# ORN
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
In the following example, when X1 is on, the value in V1400 and V1401 is loaded into the
accumulator using the Load Double instruction. The RTOB instruction converts the real
value in the accumulator the equivalent binary number format. The value in the accumulator
is copied to V1500 and V1501 using the Out Double instruction. The handheld programmer
would display the binary value in V1500 and V1501 as a HEX value.
DirectSOFT
DirectSOFT32
Acc. 0 1 0 0 1 0 0 0 1 0 1 0 1 1 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0
RTOB
OUTD
V1500
$ B ENT
STR 1
SHFT L D D B E A A ENT
ANDST 3 3 1 4 0 0
SHFT R T O B ENT
ORN MLR INST# 1
GX SHFT D B F A A ENT
OUT 3 1 5 0 0
The two instructions described above convert real numbers into the accumulator from degree
format to radian format, and vice-versa. In degree format, a circle contains 360 degrees. In
radian format, a circle contains 2f (about 6.28) radians. These convert between both positive
and negative real numbers, and for angles greater than a full circle. These functions are very
useful when combined with the transcendental trigonometric functions (see the section on
math instructions).
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for entering real numbers, using the LDR (Load Real) instruction.
The following example takes the sine of 45 degrees. Since transcendental functions operate only
on real numbers, we do an LDR (load real) 45. The trig functions operate only in radians, so we
must convert the degrees to radians by using the RADR command. After using the SINR (Sine
Real) instruction, we use an OUTD (Out Double) instruction to move the result from the
accumulator to V-memory. The result is 32-bits wide, requiring the Out Double to move it.
Accumulator contents
DirectSOFT32 (viewed as real number)
X1 Load the real number 45 into
LDR
DirectSOFT R45
the accumulator. 45.000000
In the example on the following page, when X1 is ON the constant (K4) is loaded into the
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
(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
below lists valid ASCII values for ATH conversion.
ASCII Values Valid for ATH Conversion
ASCII Value Hex Value ASCII Value Hex Value
30 0 38 8
31 1 39 9
32 2 41 A
33 3 42 B
34 4 43 C
35 5 44 D
36 6 45 E
37 7 46 F
DirectSOFT
Direct SOFT32 Hexadecimal
ASCII T ABLE Equivalents
X1 LD Load the constant value
into the lower 16 bits of the
K4 accumulator. This value
defines the number of V
memory location in the
ASCII table
V1400 33 34
LDA Convert octal 1400 to HEX
O 1400
300 and load the value into
the accumulator
1234 V1600
V1401 31 32
ATH V1600 is the starting
location for the HEX table
V1600
$
STR
B
1
ENT V1402 37 38
SHFT L
ANDST
D
3
PREV E
4
ENT 5678 V1601
L D A B E A A
SHFT
ANDST 3 0 1 4 0 0
ENT
V1403 35 36
SHFT A T H B G A A ENT
0 MLR 7 1 6 0 0
This means a HEX table of two V-memory locations would require four V-memory locations
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 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
the accumulator stack.
Step 2: Load the starting V-memory location for the HEX table into the accumulator.
This parameter must be a HEX value.
Step 3:Specify the starting V-memory location (Vaaa) for the ASCII table in the HTA
instruction.
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.
In the following example, when X1 is ON, the constant (K2) is loaded into the accumulator
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.
DirectSOFT
Direct SOFT32
Hexadecimal
X1 LD Equivalents ASCII T ABLE
K2
HTA 37 38 V1402
V1400
$ B ENT
STR 1
SHFT L D A B F A A ENT
ANDST 3 0 1 5 0 0
SHFT H T A B E A A ENT
7 MLR 0 1 4 0 0
The table below lists valid ASCII values for HTA conversion.
ASCII Values Valid for HTA Conversion
Hex Value ASCII Value Hex Value ASCII Value
0 30 8 38
1 31 9 39
2 32 A 41
3 33 B 42
4 34 C 43
5 35 D 44
6 36 E 45
7 37 F 46
Segment (SEG)
DS Used The BCD / Segment instruction converts a four digit HEX value in SEG
HPP Used the accumulator to seven segment display format. The result resides
in the accumulator.
In the following example, when X1 is on, the value in V1400 is loaded into the lower 16 bits
of the accumulator using the Load instruction. The HEX value in the accumulator is converted
to seven segment format using the Segment instruction. The bit pattern in the accumulator is
copied to Y20–Y57 using the Out Formatted instruction.
DirectSOFT
DirectSOFT32 Display V1400
X1 6 F 7 1
LD
V1400
SEG
OUTF Y20
K32
- g f e d c b a - g f e d c b a - g f e d c b a - g f e d c b a Segment
Labels
a
f b
Segment Y57 Y56 Y55 Y54 Y53 Y24 Y23 Y22 Y21 Y20
Labels g
OFF ON ON ON ON OFF OFF ON ON OFF
e c
$ B ENT
STR 1
L D B E A A ENT
ANDST 3 1 4 0 0
S E G ENT
SHFT SHFT
RST 4 6
GX F C A D C
SHFT ENT
OUT 5 2 0 3 2
DirectSOFT
Direct SOFT32
X27 X26 X25 X12 X11 X10
X1 LDF K16 OFF OFF OFF ON OFF ON
X10
GX V C A B A 0000000100 0007
SHFT ENT
OUT AND 2 0 1 0
1000000001 1022
1000000000 1023
Digits to be
shuffled (first stack location)
9 A B C D E F 0
1 2 8 7 3 6 5 4
Bit Positions 8 7 6 5 4 3 2 1
B C E F 0 D A 9
Result (accumulator)
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.
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.
Example B shows how the Shuffle Digits works when a 0 or 9–F is used when specifying the
order the digits are to be shuffled. Notice when the Shuffle Digits instruction is executed, the
bit positions in the first stack location that had a corresponding 0 or 9–F in the accumulator
(order specified) are set to “0”.
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,
the most significant duplicate number in the order specified is used in the result.
DirectSOFT
Direct SOFT32
A B C
X1 LDD V2001 V2000 V2001 V2000 V2001 V2000
V2000 9 A B C D E F 0 0 F E D C B A 9 9 A B C D E F 0
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 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.
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
V2011 V2010 V2011 V2010 V2011 V2010
Copy the value in the
accumulator to V2010 and
V2011
$ B ENT
STR 1
SHFT L D D C A A A ENT
ANDST 3 3 2 0 0 0
SHFT L D D C A A G ENT
ANDST 3 3 2 0 0 6
Table Instructions
Move (MOV)
DS Used The Move instruction moves the values from a V-memory table to
HPP Used another V-memory table the same length (a table being a consecutive
group of V-memory locations). The function parameters are loaded MOV
into the first level of the accumulator stack and the accumulator V aaa
by two 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.
• 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 (KFFF max, 7777 octal, 4096 decimal).
• Step 2 Load the starting V-memory location for the locations to be moved into the accumulator.
This parameter is a HEX value.
• Step 3 Insert the MOV instruction which specifies starting V-memory location (Vaaa) for the
destination table.
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.
Operand Data Type DL06 Range
aaa
V-memory V See memory map
Pointer P See memory map
Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
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 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.
DirectSOFT
Direct SOFT32
SHFT L D A C A A A ENT
ANDST 3 0 2 0 0 0
SHFT M O V C A D A ENT
ORST INST# AND 2 0 3 0
• Step 1: L oad the number of words to be copied into the second level of the accumulator stack.
• 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.
• Step 3: Load the source data label (LDLBL Kaaa) into the accumulator when copying data from
ladder memory to V-memory. Load the source address into the accumulator when copying
data from V-memory to ladder memory. This is where the value will be copied from. If the
source address is a V-memory location, the value must be entered in HEX.
• Step 4:Insert the MOVMC instruction which specifies destination in V-memory (Vaaa). This is
the copy destination.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
WARNING: The offset for this usage of the instruction starts at 0, but may be any number that does not
result in data outside of the source data area being copied into the destination table. When an offset
is outside of the source information boundaries, then unknown data values will be transferred into the
destination table.
N C O N 4 5 3 2 V2001
LD
K 4 5 3 2
K0
N C O N 6 1 5 1 V2002
Load the value 0 into the
K 6 1 5 1
accumulator specifying the
offset for source and N C O N 8 8 4 5 V2003
destination locations
K 8 8 4 5
LDLBL X X X X V2004
K1 .
Load the value 1 into the .
accumulator specifying the
Data Label Area K1 as the
starting address of the data
to be copied.
MOVMC
V2000
$ B ENT
STR 1
SHFT L D L B L B ENT
ANDST 3 ANDST 1 ANDST 1
SHFT M O V M C C A A A ENT
ORST INST# AND ORST 2 2 0 0 0
SETBIT
DS Used The Set Bit instruction sets a single bit to one within a SETBIT
HPP Used range of V-memory locations. A aaa
RSTBIT
RSTBIT
DS Used The Reset Bit instruction resets a single bit to zero A aaa
HPP Used within a range of V-memory locations.
The following description applies to both the Set Bit and Reset Bit table instructions.
Step 1: Load the length of the table (number of V-memory locations) into the first level of the
accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator. This parameter
must be a HEX value. You can use the LDA instruction to convert an octal address to
hex.
Step 3: Insert the Set Bit or Reset Bit instruction. This specifies the reference for the bit number
of the bit you want to set or reset. The bit number is in octal, and the first bit in the
table is number “0”.
Helpful hint: — Remember that each V-memory location contains 16 bits. So, the bits of the
first word of the table are numbered from 0 to 17 octal. For example, if the table length is six
words, then 6 words = (6 x 16) bits, = 96 bits (decimal), or 140 octal. The permissible range of
bit reference numbers would be 0 to 137 octal. SP 53 will be set if the bit specified is outside
the range of the table.
Operand Data Type DL06 Range
aaa
V-memory V See memory map
NOTE: Status flags are only valid until the end of the scan or until another instruction that uses the same
flag is executed.
V3000
For example, suppose we have a table MSB LSB
starting at V3000 that is two words long,
as shown to the right. Each word in the
table contains 16 bits, or 0 to 17 in octal. 16 bits
To set bit 12 in the second word, we
use its octal reference (bit 14). Then we V3001
compute the bit’s octal address from the MSB LSB
start of the table, so 17 + 14 = 34 octal.
The following program shows how to set
the bit as shown to a “1”. 1 1 1 1 11 1 1 7 6 5 4 3 2 1 0
7 6 5 4 32 1 0
In this ladder example, we will use input X0 to trigger the Set Bit operation. First, we will
load the table length (2 words) into the accumulator stack. Next, we load the starting address
into the accumulator. Since V3000 is an octal number, we have to convert it to hex by using
the LDA command. Finally, we use the Set Bit (or Reset Bit) instruction and specify the octal
address of the bit (bit 34), referenced from the table.
DirectSOFT
Direct SOFT Display32
$ A ENT
STR 0
L D C ENT
SHFT PREV
ANDST 3 2
SHFT L D A D A A A ENT
ANDST 3 0 3 0 0 0
X B I T D E
SHFT NEXT ENT
SET 1 8 MLR 3 4
Fill (FILL)
DS Used The Fill instruction fills a table of up to 255 V-memory locations
HPP Used
with a value (Aaaa), which is either a V-memory location or a
F ILL
4-digit constant. The function parameters are loaded into the
A aaa
first level of the accumulator stack and the accumulator by two
additional instructions
Listed below are the steps necessary to program the Fill function.
Step 1: Load the number of V-memory locations to be filled into the first level of the
accumulator stack. This parameter must be a HEX value, 0–FF.
Step 2: Load the starting V-memory location for the table into the accumulator. This parameter
must be a HEX value.
Step 3: Insert the Fill instruction which specifies the value to fill the table with.
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.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
Pointer P See memory map
Constant K 0–FF
In the following example, when X1 is on, the constant value (K4) is loaded into the accumulator
using the Load instruction. This value specifies the length of the table and is placed on the first
level of the accumulator stack when the Load Address instruction is executed. The octal address
1600 (V1600) is the starting location for the table and is loaded into the accumulator using
the Load Address instruction. The value to fill the table with (V1400) is specified in the Fill
instruction.
DirectSOFT
Direct S OF T32
X X X X V1576
SHFT L D A B G A A ENT
ANDST 3 0 1 6 0 0
SHFT F I L L B E A A ENT
5 8 ANDST ANDST 1 4 0 0
Find (FIND)
DS Used The Find instruction is used to search for a specified value
HPP Used
in a V-memory table of up to 255 locations. The function F IND
parameters are loaded into the first and second levels of the A aaa
accumulator stack and the accumulator by three additional
instructions.
Listed below are the steps necessary to program the Find function.
Step 1: Load the length of the table (number of V-memory locations) into the second level of
the accumulator stack. This parameter must be a HEX value, 0–FF.
Step 2: Load the starting V-memory location for the table into the first level of the accumulator
stack. This parameter must be a HEX value.
Step 3: Load the offset from the starting location to begin the search. This parameter must be
a HEX value.
Step 4: Insert the Find instruction which specifies the first value to be found in the table.
Results:— The offset from the starting address to the first V-memory location which contains
the search value (in HEX) is returned to the accumulator. SP53 will be set On if an address
outside the table is specified in the offset or the value is not found. If the value is not found 0
will be returned in the accumulator.
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.
NOTE: Status flags are only valid until another instruction that uses the same flags is executed. The pointer
for this instruction starts at 0 and resides in the accumulator.
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
placed in the second stack location when the following Load Address and Load instruction is
executed. The octal address 1400 (V1400) is the starting location for the table and is loaded
into the accumulator. This value is placed in the first level of the accumulator stack when the
following Load instruction is executed. The offset (K2) is loaded into the lower 16 bits of the
accumulator using the Load instruction. The value to be found in the table is specified in the
Find instruction. If a value is found equal to the search value, the offset (from the starting
location of the table) where the value is located will reside in the accumulator.
DirectSOFT
DirectS OF T 32 Dis play S
S
X1
LD Table length
0 1 2 3 V1400 0
K6 Offs et
0 5 0 0 V1401 1
Load the cons tant value 6
Begin here 9 9 9 9 V1402 2
(HE X) into the lower 16 bits
of the accumulator 3 0 7 4 V1403 3 Accumulator
0 0 0 0 0 0 0 4
LDA 8 9 8 9 V1404 4
1 0 1 0 V1405 V1404 contains the location
O 1400 5
where the match was found.
X X X X V1406 The value 8989 was the 4th
C onvert octal 1400 to HE X location after the s tart of the
300 and load the value into X X X X V1407 s pecified table.
the accumulator.
S
S
LD
K2
Handheld Programmer Keystrokes
Load the cons tant value
$ B ENT
2 into the lower 16 bits STR 1
of the accumulator
SHFT L D PREV G ENT
ANDST 3 6
F IND SHFT L D A B E A
ANDST 3 0 1 4 0
K8989
L D C ENT
SHFT PREV
F ind the location in the table ANDST 3 2
where the value 8989 res ides
SHFT F I N D I J I J ENT
NEXT
5 8 TMR 3 8 9 8 9
NOTE: Status flags are only valid until another instruction that uses the same flags is executed. The
pointer for this instruction starts at 0 and resides in the accumulator.
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 placed in the first
stack location after the Load Address instruction is executed. The octal address 1400 (V1400)
is the starting location for the table and is loaded into the accumulator. The Greater Than
search value is specified in the Find Greater Than instruction. If a value is found greater than
the search value, the offset (from the starting location of the table) where the value is located
will reside in the accumulator. If there is no value in the table that is greater than the search
value, a zero is stored in the accumulator and SP53 will come ON.
DirectSOFT
DirectS OF T 32 Dis play
X1
LD
K6
SHFTLD L S HFDT AA OC T B 1 E 4 A 0A 0
ENT
ANDST 3 0 1 4 0 0
S HF TF FD GD T G T S HF IT K(CJON) 8 9 8 9
SHFT NEXT I J ENT
5 3 6 MLR 8 9 8 9
Listed below are the steps necessary to program the Table To Destination function.
Step 1: L oad the length of the data table (number of V-memory locations) into the first
level of the accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator.
(Remember, the starting location of the table is used as the table pointer.) This
parameter must be a HEX value.
Step 3: Insert the TTD instruction which specifies destination V-memory location
(Vaaa).
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.
Helpful Hint: — The instruction will be executed every scan if the input logic is on. If you do
not want the instruction to execute for more than one scan, a one-shot (PD) should be used in
the input logic.
Helpful Hint: — The pointer location should be set to the value where the table operation will
begin. The special relay SP0 or a one-shot (PD) should be used so the value will only be set in
one scan and will not affect the instruction operation.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
NOTE: Status flags (SPs) are only valid until another instruction that uses the same flag is executed,
or the end of the scan. The pointer for this instruction starts at 0 and resets when the table length
is reached. At first glance it may appear that the pointer should reset to 0. However, it resets to 1,
not 0.
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 placed in the first stack location after the Load Address instruction is executed. The
octal address 1400 (V1400) is the starting location for the source table and is loaded into
the accumulator. Remember, V1400 is used as the pointer location, and is not actually
part of the table data source. The destination location (V1500) is specified in the Table to
Destination instruction. The table pointer (V1400 in this case) will be increased by “1” after
each execution of the TTD instruction.
DirectSOFT
DirectSOFT32
$ B ENT
STR 1
SHFT L D A B E A A ENT
ANDST 3 0 1 4 0 0
SHFT T T D B F A A ENT
MLR MLR 3 1 5 0 0
The following diagram shows the scan-by-scan results of the execution for our example
program. Notice how the pointer automatically cycles from 0 – 6, and then starts over at 1
instead of 0. Also, notice how SP56 is only on until the end of the scan.
. .
. .
Step 1: Load the length of the table (number of V-memory locations) into the first level of the
accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator. (Remember,
the starting location of the table blank is used as the table pointer.) This parameter must be
a HEX value.
Step 3: Insert the RFB instruction which specifies destination V-memory location (Vaaa).
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.
Helpful Hint: — The instruction will be executed every scan if the input logic is on. If you
do not want the instruction to execute for more than one scan, a one-shot (PD) should be
used in the input logic.
Helpful Hint: — The pointer location should be set to the value where the table operation
will begin. The special relay SP0 or a one-shot (PD) should be used so the value will only be
set in one scan and will not affect the instruction operation.
NOTE: Status flags (SPs) are only valid until another instruction that uses the same flag is executed or
the end of the scan The pointer for this instruction can be set to start anywhere in the table. It is not set
automatically. You must load a value into the pointer somewhere in your program.
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 placed in the first
stack location after the Load Address instruction is executed. The octal address 1400 (V1400)
is the starting location for the source table and is loaded into the accumulator. Remember,
V1400 is used as the pointer location, and is not actually part of the table data source. The
destination location (V1500) is specified in the Remove From Bottom. The table pointer
(V1400 in this case) will be decremented by “1” after each execution of the RFB instruction.
DirectSOFT
DirectSOFT32
X1 LD
K6
LDA
0 1400
RFB
V1500
Copy the specified value from
the table to the specified
destination (V1500)
$ B ENT
STR 1
SHFT L D A B E A A ENT
ANDST 3 0 1 4 0 0
SHFT R F B B F A A ENT
ORN 5 1 1 5 0 0
locations very quickly. If this is a problem for Load the constant value 6
(HEX) into the lower 16 bits
your application, you have an option of using a of the accumulator
The following diagram shows the scan-by-scan results of the execution for our example
program. Notice how the pointer automatically decrements from 6 to 0. Also, notice how
SP56 is only on until the end of the scan.
Example of Execution
Scan N Before RFB Execution After RFB Execution
V1402 9 9 9 9 2 V1402 9 9 9 9 2
Destination Destination
V1403 3 0 7 4 3 V1403 3 0 7 4 3
X X X X V1500 2 0 4 6 V1500
V1404 8 9 8 9 4 V1404 8 9 8 9 4
V1405 1 0 1 0 5 V1405 1 0 1 0 5
SP56 SP56
V1406 2 0 4 6 6 V1406 2 0 4 6 6
SP56 = OFF SP56 = OFF
V1407 X X X X V1407 X X X X
. .
. .
V1402 9 9 9 9 2 V1402 9 9 9 9 2
Destination Destination
V1403 3 0 7 4 3 V1403 3 0 7 4 3
9 9 9 9 V1500 0 5 0 0 V1500
V1404 8 9 8 9 4 V1404 8 9 8 9 4
V1405 1 0 1 0 5 V1405 1 0 1 0 5
V1406 2 0 4 6 6 SP56 V1406 2 0 4 6 6 SP56
SP56 = OFF SP56 = ON
V1407 X X X X V1407 X X X X
. . until end of scan
. . or next instruction
that uses SP56
Listed below are the steps necessary to program the Source To Table function.
Step 1: Load the length of the table (number of V-memory locations) into the first level
of the accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator.
(Remember, the starting location of the table is used as the table pointer.) This
parameter must be a HEX value.
Step 3: Insert the STT instruction which specifies the source V-memory location
(Vaaa). This is where the value will be moved from.
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.
Helpful Hint:— The instruction will be executed every scan if the input logic is on. If you do
not want the instruction to execute for more than one scan, a one-shot (PD) should be used in
the input logic.
Helpful Hint: — The table counter value should be set to indicate the starting point for the
operation. Also, it must be set to a value that is within the length of the table. For example, if
the table is 6 words long, then the allowable range of values that could be in the pointer should
be between 0 and 6. If the value is outside of this range, the data will not be moved. Also, a
one-shot (PD) should be used so the value will only be set in one scan and will not affect the
instruction operation.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
NOTE: Status flags (SPs) are only valid until another instruction that uses the same flag is executed, or the
end of the scan. The pointer for this instruction starts at 0 and resets to 1 automatically when the table length
is reached.
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
placed in the first stack location after the Load Address instruction is executed. The octal
address 1400 (V1400), which is the starting location for the destination table and table
pointer, is loaded into the accumulator. The data source location (V1500) is specified in the
Source to Table instruction. The table pointer will be increased by “1” after each time the
instruction is executed.
DirectSOFT
DirectS OF T 32
X1 LD
K6
LDA
0 1400
STT
V1500
$ B ENT
STR 1
SHFT L D A B E A A ENT
ANDST 3 0 1 4 0 0
SHFT S T T B F A A
SHFT ENT
RST MLR MLR 1 5 0 0
time the input contact transitions from low to high. Convert octal 1400 to HEX
300 and load the value into
the accumulator. This is the
starting table location.
The following diagram shows the scan-by-scan results of the execution for our example program.
Notice how the pointer automatically cycles from 0 to 6, and then starts over at 1 instead of 0.
Also, notice how SP56 is affected by the execution. Although our example does not show it, we
are assuming that there is another part of the program that changes the value in V1500 (data
source) prior to the execution of the STT instruction. This is not required, but it makes it easier
to see how the data source is copied into the table.
V1405 X X X X 4 V1405 X X X X 4
SP56 SP56
V1406 X X X X 5 V1406 X X X X 5
SP56 = OFF SP56 = OFF
V1407 X X X X V1407 X X X X
. .
. .
Scan N+1 Before STT Execution After STT Execution
Table Table Pointer Table Table Pointer (Automatically Incremented)
V1401 0 5 0 0 0 6 0 0 0 1 V1400 V1401 0 5 0 0 0 6 0 0 0 2 V1400
V1402 X X X X 1 V1402 9 9 9 9 1
Source Source
V1403 X X X X 2 V1403 X X X X 2
9 9 9 9 V1500 9 9 9 9 V1500
V1404 X X X X 3 V1404 X X X X 3
V1405 X X X X 4 V1405 X X X X 4
V1406 X X X X 5 SP56 X X X X 5 SP56
V1406
SP56 = OFF SP56 = OFF
V1407 X X X X V1407 X X X X
. .
. .
.
.
.
Scan N+5 Before STT Execution After STT Execution
V1402 9 9 9 9 1 V1402 9 9 9 9 1
Source Source
V1403 3 0 7 4 2 V1403 3 0 7 4 2
1 2 3 4 V1500 1 2 3 4 V1500
V1404 8 9 8 9 3 V1404 8 9 8 9 3
V1405 1 0 1 0 4 V1405 1 0 1 0 4
NOTE: Status flags (SPs) are only valid until another instruction that uses the same flag is executed, or
the end of the scan The pointer for this instruction can be set to start anywhere in the table. It is not set
automatically. You must load a value into the pointer somewhere in your program.
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 placed in the first
stack location after the Load Address instruction is executed. The octal address 1400 (V1400)
is the starting location for the source table and is loaded into the accumulator. The destination
location (V1500) is specified in the Remove from Table instruction. The table counter will be
decreased by “1” after the instruction is executed.
DirectSOFT
DirectSOFT32 Display
$ B ENT
STR 1
SHFT L D A B E A A ENT
ANDST 3 0 1 4 0 0
SHFT R F T B F A A ENT
ORN 5 MLR 1 5 0 0
The following diagram shows the scan-by-scan results of the execution for our example
program. In our example, we show the table counter set to 4, initially. (Remember, you can
set the table counter to any value that is within the range of the table.) The table counter
automatically decrements from 4 to 0 as the instruction is executed. Notice how the last two
table positions, 5 and 6, are not moved up through the table. Also, notice that SP56, which
comes on when the table counter is zero, is only on until the end of the scan.
Scan N
Before RFT Execution After RFT Execution
Table Counter
Table Table Counter Table (Automatically d ecremented)
V1405 1 0 1 0 5 V1405 1 0 1 0 5
V1405 1 0 1 0 5 V1405 1 0 1 0 5
V1406 2 0 4 6 6 SP56 V1406 2 0 4 6 6 SP56
SP56 = OFF SP56 = OFF
V1407 X X X X V1407 X X X X
. .
. .
Scan N+3 Before RFT Execution After RFT Execution
Table Counter
Table Counter (Automatically decremented)
Table Table
V1401 8 9 8 9 1 0 0 0 1 V1400 Start here V1401 8 9 8 9 1 8 0 0 0 0 V1400
9
V1402 8 9 8 9 2 V1402 8 9 8 9 2 8
Destinatio 9
V1403 8 9 8 9 3 V1403 8 9 8 9 3 Destination
4 0 7 9 V1500 8 9 8 9 V1500
V1404 8 9 8 9 4 V1404 8 9 8 9 4
V1405 1 0 1 0 5 V1405 1 0 1 0 5
V1406 2 0 4 6 6 SP56 V1406 2 0 4 6 6 SP56
X X X X SP56 = OFF X X X X SP56 = ON
V1407 V1407
. . until end of scan
. . or next instruction
that uses SP56
The instruction will be executed once per scan, provided the input remains on. The function
parameters are loaded into the first level of the accumulator stack and the accumulator by
two additional instructions. Listed below are the steps necessary to program the Add To Top
function.
Step 1: Load the length of the table (number of V-memory locations) into the first level
of the accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator.
(Remember, the starting location of the table is used as the table length counter.)
This parameter must be a HEX value.
Step 3: Insert the ATT instructions which specifies source V-memory location (Vaaa).
This is where the value will be moved from.
Helpful Hint:— The instruction will be executed every scan if the input logic is on. If you do
not want the instruction to execute for more than one scan, a one-shot (PD) should be used in
the input logic.
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.
Helpful Hint: — The table counter value should be set to indicate the starting point for the
operation. Also, it must be set to a value that is within the length of the table. For example, if
the table is 6 words long, then the allowable range of values that could be in the table counter
should be between 1 and 6. If the value is outside of this range or zero, the data will not be
moved into the table. Also, a one-shot (PD) should be used so the value will only be set in one
scan and will not affect the instruction operation.
NOTE: Status flags (SPs) are only valid until another instruction that uses the same flag is executed or
the end of the scan. The pointer for this instruction can be set to start anywhere in the table. It is not set
automatically. You must load a value into the pointer somewhere in your program.
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 placed in the first
stack location after the Load Address instruction is executed. The octal address 1400 (V1400),
which is the starting location for the destination table and table counter, is loaded into the
accumulator. The source location (V1500) is specified in the Add to Top instruction. The table
counter will be increased by “1” after the instruction is executed.
DirectSOFT
DirectSOFT32 Display
X1 LD
K6
LDA
O 1400
ATT
V1500
$ B ENT
STR 1
SHFT L D A B E A A ENT
ANDST 3 0 1 4 0 0
SHFT A T T B F A A ENT
0 MLR MLR 1 5 0 0
value each time the input contact transitions Convert octal 1400 to HEX
300 and load the value into
from low to high. the accumulator. This is the
starting table location.
The following diagram shows the scan-by-scan results of the execution for our example
program. The table counter is set to 2 initially, and it will automatically increment from 2 to 6
as the instruction is executed. Notice how SP56 comes on when the table counter is 6, which
is equal to the table length. Plus, although our example does not show it, we are assuming that
there is another part of the program that changes the value in V1500 (data source) prior to the
execution of the ATT instruction.
Example of Execution
Scan N Before ATT Execution After ATT Execution
Table counter
Table Table counter Table (Automatically Incremented)
V1405 1 0 1 0 5 V1405 8 9 8 9 5
SP56 SP56
V1406 2 0 4 6 6 V1406 1 0 1 0 6
SP56 = OFF SP56 = OFF
V1407 X X X X V1407 X X X X
. .
. . 2046
Discard Bucket
Scan N+2 Before ATT Execution After ATT Execution Table counter
Table counter Table (Automatically Incremented)
Table
V1401 5 6 7 8 1 0 0 0 4 V1400 V1401 4 3 4 3 1 4 0 0 0 5 V1400
3
V1402 1 2 3 4 2 V1402 5 6 7 8 2 4
3 Data Source
Data Source
V1403 0 5 0 0 3 V1403 1 2 3 4 3
4 3 3 4 V1500 4 3 4 3 V1500
V1404 9 9 9 9 4 V1404 0 5 0 0 4
V1405 3 0 7 4 5 V1405 9 9 9 9 5
V1406 8 9 8 9 6 SP56 V1406 3 0 7 4 6 SP56
X X X X SP56 = OFF X X X X
SP56 = OFF
V1407 V1407
. .
. . 8989
Discard Bucket
Scan N+3 Before ATT Execution After ATT Execution Table counter
Table Table counter Table (Automatically Incremented)
The following description applies to both the Table Shift Left and Table Shift Right
instructions. A table is just a range of V-memory locations. The Table Shift Left and Table
Shift Right instructions shift bits serially throughout the entire table. Bits are shifted out the
end of one word and into the opposite end of an adjacent word. At the ends of the table, bits
are either discarded, or zeros are shifted into the table. The example tables below are arbitrarily
four words long.
Table Shift Left
Table Shift Right
Shift in zeros Discard Bits
V - xxxx
V - xxxx + 1
V - xxxx + 2
Step 1: Load the length of the table (number of V-memory locations) into the first level of the
accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator. This
parameter must be a HEX value. You can use the LDA instruction to convert
an octal address to hex.
Step 3: Insert the Table Shift Left or Table shift Right instruction. This specifies the
number of bit positions you wish to shift the entire table. The number of bit
positions must be in octal.
Helpful hint: — Remember that each V-memory location contains 16 bits. So, the bits of the
first word of the table are numbered from 0 to 17 octal. If you want to shift the entire table by
20 bits, that is 24 octal. SP 53 will be set if the number of bits to be shifted is larger than the
total bits contained within the table. Flag 67 will be set if the last bit shifted (just before it is
discarded) is a “1”.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
NOTE: Status flags are only valid until the end of the scan or another instruction that uses the same flag is
executed.
V 3000 V 3000
The example table to the right contains
BCD data as shown (for demonstration 1 2 3 4 6 7 8 1
purposes). Suppose we want to do a table
shift right by 3 BCD digits (12 bits).
5 6 7 8 1 2 2 5
Converting to octal, 12 bits is 14 octal.
Using the Table Shift Right instruction
and specifying a shift by octal 14, we have 1 1 2 2 3 4 4 1
the resulting table shown at the far right.
Notice that the 2–3–4 sequence has been 3 3 4 4 5 6 6 3
discarded, and the 0–0–0 sequence has
been shifted in at the bottom.
5 5 6 6 0 0 0 5
The following ladder example assumes the data at V3000 to V3004 already exists as shown
above. We will use input X0 to trigger the Table Shift Right operation. First, we will load the
table length (5 words) into the accumulator stack. Next, we load the starting address into the
accumulator. Since V3000 is an octal number, we have to convert it to hex by using the LDA
command. Finally, we use the Table Shift Right instruction and specify the number of bits to
be shifted (12 decimal), which is 14 octal.
DirectSOFT
DirectSOFT 32
$ A ENT
STR 0
SHFT L D A D A A A ENT
ANDST 3 0 3 0 0 0
SHFT T S H F R B E
SHFT NEXT ENT
MLR RST 7 5 ORN 1 4
OR Move (ORMOV)
DS Used The OR Move instruction copies data from a table to the
ORMOV
HPP Used specified memory location, ORing each word with the A aaa
accumulator contents as it is written
Exclusive OR Move (XORMOV)
DS Used The Exclusive OR Move instruction copies data from a table XO R MO V
HPP Used to the specified memory location, XORing each word with the A aaa
accumulator value as it is written.
The following description applies to the AND Move, OR Move, and Exclusive OR Move
instructions. A table is just a range of V-memory locations. These instructions copy the data
of a table to another specified location, preforming a logical operation on each word with the
accumulator contents as the new table is written.
Step 1: Load the length of the table (number of V-memory locations) into the first level
of the accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator. This
parameter must be a HEX value. You can use the LDA instruction to convert
an octal address to hex.
Step 3: Load the BCD/hex bit pattern into the accumulator which will be logically
combined with the table contents as they are copied.
Step 4: Insert the AND Move, OR Move, or XOR Move instruction. This specifies
the starting location of the copy of the original table. This new table will
automatically be the same length as the original table.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
DirectSOFT
DirectSOFT 5
X0 LD
Handheld Programmer Keystrokes
K2
$ A ENT
STR 0 Load the constant value 2
(Hex.) into the lower 16
SHFT L D PREV C ENT
ANDST 3 2 bits of the accumulator.
LD
The example on top the right shows a table of two words K6666
at V3000 and logically ORs it with K8888. The copy of Load the constant value
the table at V3100 shows the result of the OR operation 6666 (Hex.) into the lower
16 bits of the accumulator.
for each word.
ANDMOV
The program to the right performs the ORMOV 0 3100
example above. It assumes that the data in the table at Copy the table to V3100,
ANDing its contents with the
V3000 – V3001 already exists. First we load the table accumulator as it is written.
length (two words) into the accumulator. Next we load V 3000 V 3100
the starting address of the source table, using the LDA 1 1 1 1 OR MOV 9 9 9 9
K 8888
instruction. Then we load the data into the accumulator
to be OR’d with the table. In the ORMOV command, 1 1 1 1 9 9 9 9
we specify the table destination, V3100.
DirectSOFT
DirectSOFT 32
Handheld Programmer Keystrokes
X0 LD
$ A ENT
STR 0
K2
SHFT L D PREV C ENT
ANDST 3 2 Load the constant value 2
L D A D A A A (Hex) into the lower 16 bits
SHFT ENT
ANDST 3 0 3 0 0 0 of the accumulator.
V 3000 V 3100
1 1 1 1 X OR MOV 2 2 2 2
K 3333
1 1 1 1 2 2 2 2
The steps listed below are the steps necessary to program the Find Block function.
Step 1: Load the number of bytes in the block to be located. This parameter must
be a HEX value, 0 to FF.
Step 2: Load the length of a table (number of words) to be searched. The Find Block
will search multiple tables that are adjacent in V-memory. This parameter
must be a HEX value, 0 to FF.
Step 3: Load the ending location for all the tables into the accumulator. This
parameter must be a HEX value. You can use the LDA instruction to
convert an octal address to hex.
Step 4: Load the table starting location for all the tables into the accumulator.
This parameter must be a HEX value. You can use the LDA instruction to
convert an octal address to hex.
Step 5: Insert the Find Block instruction. This specifies the starting location of the
block of data you are trying to locate.
Start Addr.
Number
Table 1
of words
Table 2 Start Addr.
Table 3
Number
Block
of bytes
Table n
End Addr.
Swap (SWAP)
DS Used The Swap instruction exchanges the data in two tables of equal S WAP
A aaa
HPP Used length.
Step 1: Load the length of the tables (number of V-memory locations) into the first level of
the accumulator stack. This parameter must be a HEX value, 0 to FF. Remember that
the tables must be of equal length.
Step 2: Load the starting V-memory location for the first table into the accumulator. This
parameter must be a HEX value. You can use the LDA instruction to convert an octal
address to hex.
Step 3: Insert the Swap instruction. This specifies the starting address of the second table.
This parameter must be a HEX value. You can use the LDA instruction to convert an
octal address to hex.
Helpful hint: — The data swap occurs within a single scan. If the instruction executes on
multiple consecutive scans, it will be difficult to know the actual contents of either table at any
particular time. So, remember to swap just on a single scan.
Operand Data Type DL06 Range
aaa
V-memory V See memory map
The example program below uses a PD contact (triggers for one scan for off-to-on transition).
First, we load the length of the tables (two words) into the accumulator. Then we load the
address of the first table (V3000) into the accumulator using the LDA instruction, converting
the octal address to hex. Note that it does not matter which table we declare “first”, because
the swap results will be the same.
DirectSOFT
DirectSOFT 32
X0 Load the constant value 2
LD (Hex.) into the lower 16 bits
K2 of the accumulator.
SHFT L D A D A A A ENT
ANDST 3 0 3 0 0 0
SHFT S W A P D B A A
SHFT ENT
RST ANDN 0 CV 3 1 0 0
Clock/Calendar Instructions
Date (DATE)
DS Used
The Date instruction can be used to set the date in the CPU. The
HPP Used
instruction requires two consecutive V-memory locations (Vaaa)
to set the date. If the values in the specified locations are not valid, DAT E
the date will not be set. The current date can be read from 4 V aaa
consecutive V-memory locations (V7771–V7774).
In the following example, when C0 is on, the constant value (K94010301) is loaded into the
accumulator using the Load Double instruction (C0 should be a contact from a one-shot
(PD) instruction). The value in the accumulator is output to V2000 using the Out Double
instruction. The Date instruction uses the value in V2000 to set the date in the CPU.
V-memory Location (BCD)
Date Range (READ Only)
Year 0-99 V7774
Month 1-12 V7773
Day 1-31 V7772
Day of Week 0-06 V7771
The values entered for the day of week are:
0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday
DirectSOFT
DirectSOFT 32 Constant (K)
9 4 0 1 0 3 0 1
C0 LDD In this example, the Date
K94010301 instruction uses the value set in
Load the constant Acc. 9 4 0 1 0 3 0 1 V2000 and V2001 to set the date
value (K94010301) in the appropriate V memory
into the accumulator
locations (V7771-V7774).
OUTD Acc. 9 4 0 1 0 3 0 1
V2000
SHFT D A T E C A A A ENT
3 0 MLR 4 2 0 0 0
Time (TIME)
DS Used The Time instruction can be used to set the time (24 hour clock) T IME
HPP Used in the CPU. The instruction requires two consecutive V-memory
V aaa
locations (Vaaa) which are used to set the time. If the values in
the specified locations are not valid, the time will not be set. The
current time can be read from memory locations V7747 and
V7766–V7770.
VMemory Location (BCD)
Date Range (READ Only)
1/100 seconds (10ms) 0-99 V7747
Seconds 0-59 V7766
Minutes 0-59 V7767
Hour 0-23 V7770
In the following example, when C0 is on, the constant value (K73000) is loaded into the
accumulator using the Load Double instruction (C0 should be a contact from a one-shot
(PD) instruction). The value in the accumulator is output to V2000 using the Out Double
instruction. The Time instruction uses the value in V2000 to set the time in the CPU.
DirectSOFT
DirectSOFT 32 Constant (K)
C0
0 0 0 7 3 0 0 0 The TIME instruction uses the
LDD
value set in V2000 and V2001 to
K73000
set the time in the appropriate
Acc. 0 0 0 7 3 0 0 0
V-memory locations (V7766-V7770)
0 0 0 7 3 0 0 0
OUTD Acc.
V2000
0 0 0 7 3 0 0 0
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
SHFT N O P ENT
NOP TMR INST# CV
End (END)
DS Used The End instruction marks the termination point of the normal program
HPP Used 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 the CPU END
will not enter the Run Mode. Data labels, subroutines and interrupt
routines are placed after the End instruction. The End instruction is not
conditional; therefore, no input contact is allowed.
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
SHFT E N D ENT
4 TMR 3
END
Stop (STOP)
DS Used The Stop instruction changes the operational mode of the CPU from
HPP Used Run to Program (Stop) mode. This instruction is typically used to stop STOP
PLC operation in an error condition.
In the following example, when C0 turns on, the CPU will stop operation and switch to the
program mode.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
C0 $ SHFT C A ENT
STR 2 0
STOP S T O P
SHFT SHFT ENT
RST MLR INST# CV
A software timeout error (E003) will occur and the CPU will enter the program mode if the
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 timer’s setting.
If the scan time is consistently longer than the watch dog timer’s setting, the timeout value
may be permanently increased from the default value of 200ms by AUX 55 on the HPP or the
appropriate auxiliary function in your programming package. This eliminates the need for the
RSTWT instruction.
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.
DirectSOFT
Direct SOFT 32 Handheld Programmer Keystrokes
SHFT R S T W T ENT
ORN RST MLR ANDN MLR
RSTWT
In the following example, when C7 is on, all the program logic between the GOTO and the
corresponding LBL instruction (designated with the same constant Kaaa value) will be skipped.
The instructions being skipped will not be executed by the CPU.
DirectSOFT
DirectS OF T32 Handheld Programmer Keys trokes
$ C H
C7 K5 S HF T E NT
S TR 2 7
GOTO G O T O F
S HF T E NT
6 INS T# MLR INS T# 5
$ B E NT
S TR 1
X1 C2 GX C C
S HF T E NT
OUT 2 2
OUT
L B L F
S HF T E NT
ANDS T 1 ANDS T 5
LBL K5 $ F E NT
S TR 5
GX C E NT
OUT 2
X5 Y2
OUT
In the following example, when X1 is on, the application program inside the For / Next loop
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. Also,
The RSTWT instruction is not necessary if the For / Next loop does not extend the scan time
beyond the Watch Dog Timer setting. For more information on the Watch Dog Timer, refer
to the RSTWT instruction.
DirectSOFT
Direct SOFT32
X1 1 2 3
K3
FOR
RSTWT
X20 Y5
OUT
NEXT
$ B ENT
STR 1
SHFT F O R D ENT
5 INST# ORN 3
SHFT R S T W T ENT
ORN RST MLR ANDN MLR
$ SHFT I C A ENT
STR 8 2 0
GX F ENT
OUT 5
SHFT N E X T ENT
TMR 4 SET MLR
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.
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. If X35 is on,
the CPU will return to the main program at the RTC instruction. If X35 is not on, Y0–Y17
will be reset to off and the CPU will return to the main body of the program.
DirectSOFT
Direct SOFT32 Display X1 K3
GTS
C0
LD
K10
END
SBR K3
X20 Y5
OUTI
X21 Y10
OUTI
X35
RT C
X35 Y0 Y17
RSTI
RT
$ B ENT
STR 1
SHFT G T S D ENT
6 MLR RST 3
SHFT E N D ENT
4 TMR 3
SHFT R T C ENT
ORN MLR 2
SP SHFT I D F ENT
STRN 8 3 5
S SHFT I A B H ENT
RST 8 0 1 7
SHFT R T ENT
ORN MLR
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 will
return to the main body of the program after the RT instruction is executed.
DirectSOFT
Direct SOFT32
X1 K3
GTS
END
SBR K3
X20 Y5
OUT
X21 Y10
OUT
RT
$ B ENT
STR 1
SHFT G T S D ENT
6 MLR RST 3
SHFT E N D ENT
4 TMR 3
SHFT R T ENT
ORN MLR
X1 Y7
OUT
X2 K2
When contact X0 and X2 are ON, logic under the
MLS
second MLS will be executed.
X3 Y10
OUT
K1
MLR
The MLR instructions note the end of the Master
K0 Control area.
MLR
X10 Y11
OUT
MLS/MLR Example
In the following MLS/MLR example logic between the first MLS K1 (A) and MLR K0 (B)
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.
DirectSOFT
DirectSOFT32 Handheld Programmer Keystrokes
X0 K1
A $ A ENT
MLS STR 0
Y B ENT
X1 C0 MLS 1
OUT $ B ENT
STR 1
X2 C1 GX SHFT C A ENT
OUT 2 0
OUT
$ C ENT
STR 2
X3 Y0
GX SHFT C B ENT
OUT OUT 2 1
$ D ENT
X10 K2 STR 3
C
GX A ENT
MLS
OUT 0
X5 $ B A ENT
Y1
STR 1 0
OUT Y C ENT
MLS 2
X4 Y2 $ F ENT
STR 5
OUT
GX B ENT
OUT 1
K1
D $ E
MLR ENT
STR 4
GX C ENT
X5 C2 OUT 2
OUT T B ENT
MLR 1
X6 Y3 $ F ENT
STR 5
OUT
GX SHFT C C ENT
OUT 2 2
K0
B
$ G ENT
MLR STR 6
GX D ENT
X7 Y4 OUT 3
OUT T A ENT
MLR 0
$ H ENT
STR 7
GX E C ENT
OUT 4 2
Interrupt Instructions
Interrupt (INT)
DS Used The Interrupt instruction allows a section of ladder logic to be placed
HPP Used below the main body of the program and executed only when needed. INT O aaa
High-Speed I/O Modes 10, 20, and 40 can generate an interrupt.
With Mode 40, you may select an external interrupt (input X0), or a
time-based interrupt (3–999 ms).
Typically, interrupts are used in an application when a fast response to an input is needed
or a 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 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 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 DL06, only one software interrupt is available. The software interrupt
uses interrupt #00 (INT 0), which means the hardware interrupt #0 and the software
interrupt cannot be used together. Hardware interrupts are labeled in octal to correspond
with the hardware input signal (e.g. X1 will initiate INT 1).
DirectSOFT
Handheld Programmer Keystrokes
SP0 LD Load the constant value
(K40) into the lower 16 bits $ SHFT SP A ENT
K40
of the accumulator STR STRN 0
SHFT D I S I ENT
3 8 RST 8
SHFT E N D ENT
END 4 TMR 3
SHFT I N T A ENT
8 TMR MLR 0
INT O0
$ SHFT I B ENT
STR 8 1
X1 Y5
X SHFT I F ENT
SETI SET 8 5
$ SHFT I D ENT
X3 Y7 STR 8 3
SETI
X SHFT I H ENT
SET 8 7
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
SP0 Load the constant value
LD $ B
(K40) into the lower 16 bits ENT
K40 STR 1
of the accumulator
SHFT L D SHFT K E A ENT
ANDST 3 JMP 4 0
X4
DISI
SHFT E N D ENT
4 TMR 3
SHFT I N T A ENT
8 TMR MLR 0
END
$ SHFT I C ENT
STR 8 2
INT O0
X SHFT I F ENT
SET 8 5
SP SHFT I D ENT
X2 Y5 STRN 8 3
SETI X SHFT I A H ENT
SET 8 0 7
SHFT I R T ENT
X3 Y0 Y7 8 ORN MLR
RSTI
IRT
Message Instructions
Fault (FAULT)
DS Used The Fault instruction is used to display a message on the handheld
HPP Used programmer, the optional LCD display or in the DirectSOFT FAULT
status bar. The message has a maximum of 23 characters and can A aaa
be either V-memory data, 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) instructions,
specify the constant (K) value for the corresponding data label area.
See Appendix G for the ASCII conversion table.
Operand Data Type DL06 Range
aaa
V-memory V See memory map
Constant K 1-FFFF
Fault Example
In the following example when X1 is on, the message SW 146 will display on the handheld
programmer. The NCONs use the HEX ASCII equivalent of
the text to be displayed. (The HEX ASCII for a blank is 20,
a 1 is 31, 4 is 34 ...)
FAULT :
*SW 146
DirectSOFT
Direct SOFT32 Handheld Programmer Keystrokes
X1 FAULT $ B ENT
K1 STR 1
SHFT F A U L T B ENT
5 0 ISG ANDST MLR 1
END
DLBL E N D
K1 SHFT ENT
4 TMR 3
SHFT D L B L B ENT
ACON
3 ANDST 1 ANDST 1
A SW
SHFT A C O N S W ENT
0 2 INST# TMR RST ANDN
SHFT N C O N C A D B ENT
NCON TMR 2 INST# TMR 2 0 3 1
K 2031
SHFT N C O N D E D G ENT
TMR 2 INST# TMR 3 4 3 6
NCON
K 3436
DS Used
ACON
HPP Used ASCII Constant (ACON) A aaa
The ASCII Constant instruction is used with the DLBL instruction
to store ASCII text for use with other instructions. Two ASCII
characters can be stored in an ACON instruction. If only one
character is stored in a ACON a leading space will be inserted.
Operand Data Type DL06 Range
aaa
ASCII A 0-9 A-Z
DirectSOFT
Direct SOFT32
END
DLBL
K1
ACON
A SW
NCON
K 2031
NCON
K 3436
SHFT E N D ENT
4 TMR 3
SHFT D L B L B ENT
3 ANDST 1 ANDST 1
SHFT A C O N S W ENT
0 2 INST# TMR RST ANDN
SHFT N C O N C A D B ENT
TMR 2 INST# TMR 2 0 3 1
SHFT N C O N D E D G ENT
TMR 2 INST# TMR 3 4 3 6
N C O N 4 5 3 2 V2001
LDLBL
K1 K 4 5 3 2
N C O N 6 1 5 1 V2002
Load the value 1 into the
accumulator specifying the K 6 1 5 1
Data Label Area K1 as the
N C O N 8 8 4 5 V2003
starting address of the data
to be copied. K 8 8 4 5
X X X X V2004
MOVBLK
V2000 .
.
V2000 is the destination
starting address for the data
to be copied.
$ B ENT
STR 1
SHFT L D A E ENT
ANDST 3 0 4
SHFT L D L B L B ENT
ANDST 3 ANDST 1 ANDST 1
M O V B L K C A A A
SHFT ENT
ORST INST# AND 1 ANDST JMP 2 0 0 0
You may recall, from the CPU specifications in Chapter 3, that the DL06’s ports are capable
of 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 PLC
menu, then Setup, then Setup Secondary Comm Port.
• Port: From the port number list box at the top, choose Port 2.
• Protocol: Click the check box to the left of Non-sequence, and then you’ll see the dialog box shown
below.
• Baud Rate: Choose the baud rate that matches your printer.
• Stop Bits, Parity: Choose number of stop bits and parity setting to match your printer.
• Memory Address: Choose a V-memory address for DirectSOFT to use to store the port setup
information. You will need to reserve 66 contiguous words in V-memory for this purpose.
Before ending the setup, click the button indicated to send Port 2
configuration to the CPU, and click Close. See Chapter 3 for port
wiring information, in order to connect your printer to the DL06.
Port 2 on the DL06 has standard RS232 levels, and should work with most printer serial input
connections.
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 preceded by the
dollar sign is interpreted according to the following table:
# Character code Description
1 $$ Dollar sign ($)
2 $” Double quotation (”)
3 $L or $l Line feed (LF)
4 $N or $n Carriage return line feed (CRLF)
5 $P or $p Form feed
6 $R or $r Carriage return (CR)
7 $T or $t Tab
The following examples show various syntax conventions and the length of the output to the
printer.
Example:
” ” Length 0 without character
”A” Length 1 with character A
” ” Length 1 with blank
” $” ” Length 1 with double quotation mark
” $ R $ L ” Length 2 with one CR and one LF
” $ 0 D $ 0 A ” Length 2 with one CR and one LF
” $ $ ” Length 1 with one $ mark
In printing an ordinary line of text, you will need to include double quotation marks before
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
during the application development.
The following example prints the message to port 2. We use a PD contact, which causes the
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.
V-memory element - this is used for printing V-memory contents in the integer format or 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.
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.
Example:
V2000 Print binary data in V2000 for decimal number
V2000 : B Print BCD data in V2000
V2000 : D Print binary number in V2000 and V2001 for decimal number
V2000 : D B Print BCD data in V2000 and V2001
V2000 : R Print floating point number in V2000/V2001 as real number
V2000 : E Print floating point number in V2000/V2001 as real number with exponent
Example: The following example prints a message containing text and a variable. The “reactor
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.
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 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 of ASCII
codes for the text from memory.
Example:
V2000 % 16 16 characters in V2000 to V2007 are printed.
V2000 % 0 The characters in V2001 to Vxxxx (determined by the number in V2000) will
be printed.
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 the
V-memory number or relay number. The output type is described as shown in the table below.
Example:
V2000 . 15 Prints the status of bit 15 in V2000, in 1/0 format
C100 Prints the status of C100 in 1/0 format
C100 : BOOL Prints the status of C100 in TRUE/FALSE format
C100 : ON/OFF Prints the status of C100 in ON/OFF format
V2000.15 : BOOL Prints the status of bit 15 in V2000 in TRUE/FALSE format
The maximum numbers of characters you can print is 128. The number of characters for each
element is listed in the table below:
NOTE: Status flags are valid only until another instruction uses the same flag.
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 locations V1400-V1402.
DirectSOFT CPU Intelligent Module
Direct SOFT 5
Data
}
{
X1 The constant value K0102
LD 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
R D B E A A
SHFT ENT
ORN 3 1 4 0 0
NOTE: Status flags are valid only until another instruction uses the same flag.
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 the
data from V-memory locations V1400-V1402.
CPU Intelligent Module
DirectSOFT Data
{
Direct SOFT 5 12
V1377 X X X X Address 0
}
X1 The constant value K0102 34 Address 1
LD specifies the base number V1400 3 4 1 2
K0102 (01) and the base slot 56 Address 2
V1401 7 8 5 6
number (02). 78
0 1 9 0 Address 3
V1402
The constant value K6 90 Address 4
LD V1403 X X X X
specifies the number of 01 Address 5
K6 bytes to be written. V1404 X X X X
Network Instructions
Read from Network (RX)
DS32 Used
The Read from Network instruction is used by the master device on
HPP Used
a network to read a block of data from a slave device on the same RX
network. The function parameters are loaded into the first and second A aaa
level of the accumulator stack and the accumulator by three additional
instructions.
Listed below are the steps necessary to program the Read from Network function.
• Step 1: Load the slave address (0-- 90 BCD) into the first byte and the PLC internal port (KF2) or
slot number of the master DCM or ECOM (0-- 7) into the second byte of the second level
of the accumulator stack.
• Step 2: L oad the number of bytes to be transferred into the first level of the accumulator stack.
• Step 3: Load the address of the data to be read into the accumulator. This parameter requires a
HEX value.
• Step 4: Insert the RX instruction which specifies the starting Vmemory location (Aaaa) where the
data will be read from in the slave.
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.
Operand Data Type DL06 Range
A aaa
V-memory V See memory map
Pointer P See memory map
Inputs X 0–777
Outputs Y 0–777
Control Relays C 0–1777
Stage S 0–1777
Timer T 0–377
Counter CT 0–177
Special Relay SP 0–777
Program Memory $ 0–7680 (2K program mem.)
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 data (V2000 – V2004) will be read from a CPU at station address 5 and copied into
V-memory locations V2300–V2304 in the CPU with the master port.
DirectSOFT
Direct SOFT32
X1 SP116 LD
KF205
LD
K10
V2277 X X X X X X X X V1777
The constant value K10 V2300 3 4 5 7 3 4 5 7 V2000
specifies the number of
bytes to be read V2301 8 5 3 4 8 5 3 4 V2001
V2302 1 9 3 6 1 9 3 6 V2002
LDA
V2303 9 5 7 1 9 5 7 1 V2003
O 2300
V2304 1 4 2 3 1 4 2 3 V2004
Octal address 2300 is
converted to 4C0 HEX and V2305 X X X X X X X X V2005
loaded into the accumulator.
V2300 is the starting
location for the Master CPU
where the specified data will
be read into
RX
V2000
$ B ENT
STR 1
W SHFT SP B B G ENT
ANDN STRN 1 1 6
SHFT L D A C D A A ENT
ANDST 3 0 2 3 0 0
SHFT R X C A A A ENT
ORN SET 2 0 0 0
Listed below are the program steps necessary to execute the Write to Network function.
Step 1: Load the slave address (0–90 BCD) into the low byte and “F2” into the high
byte of the accumulator (the next two instructions push this word down to the
second layer of the stack).
Step 2: Load the number of bytes to be transferred into the accumulator (the next
instruction pushes this word onto the top of the stack).
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.
Step 4: Insert the WX instruction which specifies the starting V-memory location
(Aaaa) where the data will be written to in the slave.
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.
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 of
data are read from the Master CPU and copied to V-memory locations V2000–V2004 in the
slave CPU at station address 5.
DirectSOFT
Direct SOFT32
X1 SP116 LD
KF205
LD
K10
V2277 X X X X X X X X V1777
The constant value K10 V2300 3 4 5 7 3 4 5 7 V2000
specifies the number of
bytes to be written V2301 8 5 3 4 8 5 3 4 V2001
V2302 1 9 3 6 1 9 3 6 V2002
LDA
V2303 9 5 7 1 9 5 7 1 V2003
O 2300
V2304 1 4 2 3 1 4 2 3 V2004
Octal address 2300 is
converted to 4C0 HEX and V2305 X X X X X X X X V2005
loaded into the accumulator.
V2300 is the starting
location for the Master CPU
where the specified data will
be read from.
WX
V2000
$ B ENT
STR 1
W SHFT SP B C E ENT
ANDN STRN 1 1 6
SHFT L D A C D A A ENT
ANDST 3 0 2 3 0 0
SHFT W X C A A A ENT
ANDN SET 2 0 0 0
LCD
DS Used When enabled, the LCD instruction causes a user-defined text
HPP N/A message to be displayed on the LCD Display Panel. The display LCD
is 16 characters wide by 2 rows high so a total of 32 characters Line Number: Kn
can be displayed. Each row is addressed separately; the maximum "text message"
number of characters the instruction will accept is 16.
The text message can be entered directly into the message field of the instruction set-up dialog,
or it can be located anywhere in user V-memory. If the text is located in V-memory, the LCD
instruction is used to point to the memory location where the desired text originates. The
length of the text string is also required.
From the DirectSOFT project folder, use the Instruction Browser to locate the LCD
instruction. When you select the LCD instruction and click OK, the LCD dialog will appear,
as shown in the examples. The LCD instruction is inserted into the ladder program via this
set-up dialog box.
Display text strings can include embedded variables. Date and time settings and V-memory
values can be embedded in the displayed text. Examples of each are shown.
LCD
Line Number: K1
"Sludge Pit Alarm"
LCD
Line Number: K2
"Effluent Overflo"
S l u d g e P i t A l a r m
E f f l u e n t O v e r f l o
LCD
Line Number: K1
"Alarm 1 " _time:12
LCD
Line Number: K2
_date:us
A l a r m 1 1 1 : 2 1 P M
0 5 - 0 8 - 0 2
LCD
Line Number: K1
"Count = " V2500:B
C o u n t = 0 4 1 2
V10000 d A
V10001 i m
LCD V10002 n
Line Number: K1 V10003 f O
Starting V Memory Address: V10000 V10004 i f
Number of Characters: K16 V10005 e c
V10006
LCD V10007
Line Number: K2 V10010 i H
Starting V Memory Address: V10010 V10011 h g
Number of Characters: K16 V10012 T
V10013 m e
V10014 p
V10015 l A
V10016 r a
A d m i n O f f i c e
V10017 m
H i g h T e m p A l a r m
tart Slave Memory Address: specifies the starting slave memory address of the data to be read.
S
See the table on the following page.
Start Master Memory Address: specifies the starting memory address in the master where the
data will be placed. See the table on the following page.
Number of Elements: specifies how many coils, inputs, holding registers or input register will
be read. See the table on the following page.
MODBUS Data Format: specifies MODBUS 584/984 or 484 data format to be used
Exception Response Buffer: specifies the master memory address where the Exception Response will
be placed (6-bytes in length). See the table on the following page. The exception response buffer uses 3
words. These bytes are swapped in the MRX/MWX exception response buffer V-memory so:
• V-Memory 1 Hi Byte = Function Code Byte (Most Significant Bit Set)
• V-Memory 1 Lo Byte = Address Byte
• V-Memory 2 Hi Byte = One of the CRC Bytes
• V-Memory 2 Lo Byte = Exception Code
• V-Memory 3 Hi Byte = 0
• V-Memory 3 Lo Byte = Other CRC Byte
Number of Elements
Operand Data Type DL06 Range
V–memory V all
Constant K Bits: 1–2000 Registers: 1–125
MRX Example
DL06 port 2 has two Special Relay contacts associated with it (see Appendix D for comm
port special relays). One indicates “Port busy”(SP116), and the other indicates ”Port
Communication Error”(SP117). The “Port Busy” bit is on while the PLC communicates with
the slave. When the bit is off, the program can initiate the next network request. The “Port
Communication Error” bit turns on when the PLC has detected an error. Use of this bit is
optional. When used, it should be ahead of any network instruction boxes, since the error bit
is reset when an MRX or MWX instruction is executed. Typically, network communications
will last longer than 1 CPU scan. The program must wait for the communications to finish
before starting the next transaction.
NOTE: See Chapter 4, page 4-21, for an RLL example using multiple Read and Write interlocks with MRX/
MWX instructions.
tart Slave Memory Address: specifies the starting slave memory address where the data will
S
be written
Start Master Memory Address: specifies the starting address of the data in the master that is
to be written to the slave
Number of Elements: specifies how many consecutive coils or registers will be written to. This
field is only active when either function code 15 or 16 is selected.
MODBUS Data Format: specifies MODBUS 584/984 or 484 data format to be used
Exception Response Buffer: specifies the master memory address where the Exception Response will be
placed (6-bytes in length). See the table on the following page.The exception response buffer uses 3 words.
These bytes are swapped in the MRX/MWX exception response buffer V-memory so:
• V-Memory 1 Hi Byte = Function Code Byte (Most Significant Bit Set)
• V-Memory 1 Lo Byte = Address Byte
• V-Memory 2 Hi Byte = One of the CRC Bytes
• V-Memory 2 Lo Byte = Exception Code
• V-Memory 3 Hi Byte = 0
• V-Memory 3 Lo Byte = Other CRC Byte
MWX Example
DL06 port 2 has two Special Relay contacts associated with it (see Appendix D for comm port
special relays). One indicates “Port busy”(SP116), and the other indicates ”Port Communication
Error”(SP117). The “Port Busy” bit is on while the PLC communicates with the slave. When
the bit is off, the program can initiate the next network request. The “Port Communication
Error” bit turns on when the PLC has detected an error. Use of this bit is optional. When used,
it should be ahead of any network instruction boxes since the error bit is reset when an MRX
or MWX instruction is executed.
Typically, network communications will last longer than 1 CPU scan. The program must wait
for the communications to finish before starting the next transaction.
This rung does a MODBUS write to the first holding register 40001 of slave address
number six. It will write the values over that reside in V2000. This particular function
code only writes to 1 register. Use Function Code 16 to write to multiple registers.
Only one Network instruction (WX, RX, MWX, MRX) can be enabled in one scan.
That is the reason for the interlock bits.
X1 C100
2 SET
NOTE: See Chapter 4, page 4-21, for an RLL example using multiple Read and Write interlocks with MRX/
MWX instructions.
ASCII Instructions
The DL06 CPU supports several instructions and methods that allow ASCII strings to be read
into and written from the PLC communications ports. Specifically, port 2 on the DL06 can be
used for either reading or writing raw ASCII strings, but cannot be used for both at the same
time. The DL06 can also decipher ASCII embedded within a supported protocol (K–Sequence,
DirectNet, Modbus) via the CPU port.
No data will be stored at the Data Destination V–memory location. The bit will reset when the
AIN instruction permissive bits are disabled. 0ms selection disables this feature.
First Character Timeout: if the amount of time from when the AIN is enabled to the time the
first character is received exceeds the set time, the specified First Character Timeout bit will
be set. The bit will reset when the AIN instruction permissive bits are disabled. 0ms selection
disables this feature.
Byte Swap: swaps the high–byte and low–byte within each V–memory register of the Fixed
Length ASCII string. See the SWAPB instruction for details.
Busy Bit: is ON while the AIN instruction is receiving ASCII data
Complete Bit: is set once the ASCII data has been received for the specified fixed length and
reset when the AIN instruction permissive bits are disabled.
Inter–character Timeout Error Bit: is set when the Character Timeout is exceeded. See
Character Timeout explanation above.
First Character Timeout Error Bit: is set when the First Character Timeout is exceeded. See
First Character Timeout explanation above.
Parameter
Data Destination All V–memory
Fixed Length K1–128
Bits: Busy, Complete, C0–3777
Timeout Error, Overflow
Fixed Length example when the PLC is reading the port continuously and timing is not critical
The Timeout Error bit will reset when the AIN instruction permissive bits are disabled. 0ms
selection disables this feature.
First Character Timeout: if the amount of time from when the AIN is enabled to the time the
first character is received exceeds the set time, the specified First Character Timeout bit will
be set. The bit will reset when the AIN instruction permissive bits are disabled. 0ms selection
disables this feature.
Byte Swap: swaps the high–byte and low–byte within each V–memory register of the Variable
Length ASCII string. See the SWAPB instruction for details.
Termination Code Length: consists of either 1 or 2 characters. Refer to Appendix G, ASCII
Table.
Busy Bit: is ON while the AIN instruction is receiving ASCII data
Complete Bit: is set once the ASCII data has been received up to the termination code
characters. It will be reset when the AIN instruction permissive bits are disabled.
Inter–character Timeout Error Bit: is set when the Character Timeout is exceeded. See
Character Timeout explanation above.
First Character Timeout Error Bit: is set when the First Character Timeout is exceeded. See
First Character Timeout explanation above.
Overflow Error Bit: is set when the ASCII data received exceeds the Maximum Variable
Length specified.
Parameter
Data Destination All V–memory
Fixed Length K1–128
Bits: Busy, Complete, C0–3777
Timeout Error, Overflow
AIN variable length example used to read barcodes on boxes (PE = photoelectric sensor)
ASCII Characters
HEX Equivalent
CMPV Example
The CMPV instruction executes when the AIN instruction is complete. If the compared V–
memory tables are equal, SP61 will turn ON.
AIN Complete
C1
CMPV
tarting V–memory Address +1: the 2nd and subsequent registers will contain the ASCII
S
string printed to V–memory.
VPRINT Time/Date Stamping– the codes in the table below can be used in the VPRINT
ASCII string message to “print to V–memory” the current time and/or date.
VPRINT V-memory element – the following modifiers can be used in the VPRINT ASCII
string message to “print to V–memory” register contents in integer format or 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.
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.
Examples:
V2000 Print binary data in V2000 for decimal number
V2000 : B Print BCD data in V2000
V2000 : D Print binary number in V2000 and V2001 for decimal number
V2000 : D B Print BCD data in V2000 and V2001
V2000 : R Print floating point number in V2000/V2001 as real number
V2000 : E Print floating point number in V2000/V2001 as real number with exponent
The following modifiers can be added to any of the modifies above to suppress or convert
leading zeros or spaces. The character code must be capital letters.
# Character code Description
1 S Suppresses leading spaces
2 C0 Converts leading spaces to zeros
3 0 Suppresses leading zeros
VPRINT V-memory text element – the following is used for “printing to V–memory” text
stored in registers. Use the % followed by the number of characters after V-memory number
for representing the text. If you assign “0” as the number of characters, the function will read
the character count from the first location. Then it will start at the next V-memory location and
read that number of ASCII codes for the text from memory.
Example:
V2000 % 16 16 characters in V2000 to V2007 are printed.
V2000 % 0 The characters in V2001 to Vxxxx (determined by the number in V2000) will be
printed.
VPRINT Bit element – the following is used for “printing to V–memory” the state of the
designated bit in V-memory or a control relay bit. The bit element can be assigned by the
designating point (.) and bit number preceded by the V-memory number or relay number. The
output type is described as shown in the table below.
# Data format Description
1 none Print 1 for an ON state, and 0 for an OFF state
2 : BOOL Print “TRUE” for an ON state, and “FALSE” for an OFF state
3 : ONOFF Print “ON” for an ON state, and “OFF” for an OFF state
Example:
V2000 . 15 Prints the status of bit 15 in V2000, in 1/0 format
C100 Prints the status of C100 in 1/0 format
C100 : BOOL Prints the status of C100 in TRUE/FALSE format
C100 : ON/OFF Prints the status of C100 in ON/OFF format
V2000.15 : BOOL Prints the status of bit 15 in V2000 in TRUE/FALSE format
The maximum numbers of characters you can VPRINT is 128. The number of characters
required for each element, regardless of whether the :S, :C0 or :0 modifiers are used, is listed
in the table below.
Maximum
Element type Characters
Text, 1 character 1
16 bit binary 6
32 bit binary 11
4 digit BCD 4
8 digit BCD 8
Floating point (real number) 3
Floating point (real with exponent) 13
V-memory/text 2
Bit (1/0 format) 1
Bit (TRUE/FALSE format) 5
Bit (ON/OFF format) 3
Text element – the following is used for “printing to V–memory” 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 preceded by the dollar sign is interpreted according to the following table:
The following examples show various syntax conventions and the length of the output to the
printer.
In printing an ordinary line of text, you will need to include double quotation marks before 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 VPRINT instruction data during the
application development.
The VPRINT instruction is used to create a string in V–memory. The PRINTV is used to print the string out
of port 2.
"STX" V3000:B"$0D"
See the previous page for an example using the PRINTV instruction.
SWAPB Example
The AIN Complete bit is used to trigger the SWAPB instruction. Use a one–shot so the
SWAPB only executes once.
ACRB Example
The AIN Complete bit or the AIN diagnostic bits are used to clear the ASCII buffer.
Memory IBoxes
Instruction Ibox # Page
Move Single Word (MOVEW) IB-200 5-254
Move Double Word (MOVED) IB-201 5-255
Math IBoxes
Instruction Ibox # Page
BCD to Real with Implied Decimal Point (BCDTOR) IB-560 5-256
Double BCD to Real with Implied Decimal Point (BCDTORD) IB-562 5-257
Math - BCD (MATHBCD) IB-521 5-258
Math - Binary (MATHBIN) IB-501 5-260
Math - Real (MATHR) IB-541 5-262
Real to BCD with Implied Decimal Point and Rounding (RTOBCD) IB-561 5-263
Real to Double BCD with Implied Decimal Point and Rounding (RTOBCDD) IB-563 5-264
Square BCD (SQUARE) IB-523 5-265
Square Binary (SQUAREB) IB-503 5-266
Square Real(SQUARER) IB-543 5-267
Sum BCD Numbers (SUMBCD) IB-522 5-268
Sum Binary Numbers (SUMBIN) IB-502 5-269
Sum Real Numbers (SUMR) IB-542 5-270
Communication IBoxes
Instruction Ibox # Page
ECOM100 Configuration (ECOM100) IB-710 5-272
ECOM100 Disable DHCP (ECDHCPD) IB-736 5-274
ECOM100 Enable DHCP (ECDHCPE) IB-735 5-276
ECOM100 Query DHCP Setting (ECDHCPQ) IB-734 5-278
ECOM100 Send E-mail (ECEMAIL) IB-711 5-280
ECOM100 Restore Default E-mail Setup (ECEMRDS) IB-713 5-283
ECOM100 E-mail Setup (ECEMSUP) IB-712 5-286
ECOM100 IP Setup (ECIPSUP) IB-717 5-290
ECOM100 Read Description (ECRDDES) IB-726 5-292
ECOM100 Read Gateway Address (ECRDGWA) IB-730 5-294
ECOM100 Read IP Address (ECRDIP) IB-722 5-296
ECOM100 Read Module ID (ECRDMID) IB-720 5-298
ECOM100 Read Module Name (ECRDNAM) IB-724 5-300
ECOM100 Read Subnet Mask (ECRDSNM) IB-732 5-302
ECOM100 Write Description (ECWRDES) IB-727 5-304
ECOM100 Write Gateway Address (ECWRGWA) IB-731 5-306
ECOM100 Write IP Address (ECWRIP) IB-723 5-308
ECOM100 Write Module ID (ECWRMID) IB-721 5-310
ECOM100 Write Name (ECWRNAM) IB-725 5-312
ECOM100 Write Subnet Mask (ECWRSNM) IB-733 5-314
ECOM100 RX Network Read (ECRX) IB-740 5-316
ECOM100 WX Network Write(ECWX) IB-741 5-319
NETCFG Network Configuration (NETCFG) IB-700 5-322
Network RX Read (NETRX) IB-701 5-324
Network WX Write (NETWX) IB-702 5-327
ANLGCMB Example
In the following example, the ANLGCMB instruction is used to setup the pointer method 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 format.
ANLGIN Parameters
• Base # (K0-Local): must be 0 for DL06 PLC
• Slot #: specifies which PLC option slot is occupied by the analog module (1–4)
• Number of Input Channels: specifies the number of input channels to scan
• 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
• Input Data Address: specifies the starting V-memory location
that will be used to store the analog input data
ANLGIN Example
In the following example, the ANLGIN instruction is used to setup the pointer method for 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.
ANLGOUT Example
In the following example, the ANLGOUT instruction is used to setup the pointer method 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.
ANSCL Parameters
• 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
• 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
be placed
ANSCL Example
In the following example, the ANSCL instruction is used to scale a raw value (0-4095 BCD)
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.
NOTE: This IBox only works with unipolar unsigned raw values. It does NOT work with
bipolar, sign plus magnitude, or signed 2’s complement raw values.
ANSCLB Parameters
• Raw (12 bit binary): specifies the V-memory location of the unipolar
unsigned raw decimal unscaled value (12 bit binary = 0-4095 decimal)
• High Engineering: specifies the high engineering value
when the raw input is 4095 decimal
• 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 will be placed
ANSCLB Example
In the following example, the ANSCLB instruction is used to scale a raw value (0-4095 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.
FILTER Parameters
• Filter Frequency Timer: specifies the Timer (T) number which is used by the Filter
instruction
• 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
• 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.
• Filtered Value (BCD): specifies the V-memory location where the filtered BCD value will
be placed
Parameter DL06 Range
Filter Frequency Timer T T0-377
Filter Frequency Time (0.01 sec) K K0-9999
Raw Data (BCD) V See DL06 V-memory map - Data Words
Filter Divisor (1-100) K K1-100
Filtered Value (BCD) V See DL06 V-memory map - Data Words
FILTER Example
In the following example, the Filter instruction is used to filter a BCD value that is in V2000.
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.
The Filter Divisor Constant is an integer in the range K1 to K100, such that if it equaled K1
then no filtering would be done.
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 embedded
in the IBox and must NOT be used any other place 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 calculation a
consistent starting point.
FILTERB Parameters
• Filter Frequency Timer: specifies the Timer (T) number which is used by the Filter
instruction
• 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
• 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.
• Filtered Value (Binary): specifies the V-memory location where the filtered binary (decimal)
value will be placed
Parameter DL06 Range
Filter Frequency Timer T T0-377
Filter Frequency Time (0.01 sec) K K0-9999
Raw Data (Binary) V See DL06 V-memory map - Data Words
Filter Divisor (1-100) K K1-100
Filtered Value (Binary) V See DL06 V-memory map - Data Words
FILTERB Example
In the following example, the FILTERB instruction is used to filter a binary value that is in
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.0. 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
HILOAL Example
In the following example, the HILOAL instruction is used to monitor a BCD value that is in
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 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 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 the same
value if one “low” limit or alarm is desired to be used.
HILOALB Example
In the following example, the HILOALB instruction is used to monitor a binary value that is
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
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.
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
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
desired to be used.
OFFDTMR Example
In the following example, the OFFDTMR instruction is used to delay the “turning off”of
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
off, C20 will remain for the specified Off Delay Time (5s), and then turn off.
C100
5 sec 5 sec
C20
This IBox utilizes a Timer resource (TMRF), which cannot be used anywhere else in your
program.
ONDTMR Parameters
• Timer Number: specifies the Timer(TMRF) number which is used by the ONDTMR
instruction
• On Delay Time (0.01sec): specifies how long the Output will remain off once power flow
to the Ibox is applied.
• Output: specifies the output that will be delayed “turning on” by the On Delay Time.
ONDTMR Example
In the following example, the ONDTMR instruction is used to delay the “turning on” of
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
turns off immediately.
C101
2 sec 2 sec
C21
ONESHOT Parameters
• Discrete Output: specifies the output
that will be on for one scan
ONESHOT Example
In the following example, the ONESHOT instruction is used to turn C100 on for one PLC
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.
C0
Scan time
C100
PONOFF Example
In the following example, the PONOFF instruction is used to control the on and off states of
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.
MOVEW Parameters
• From WORD: specifies the word that
will be moved to another location
• To WORD: specifies the location where
the “From WORD” will be move to
MOVEW Example
In the following example, the MOVEW instruction is used to move 16-bits of data from
V2000 to V3000 when C100 turns on.
MOVED Parameters
• From DWORD: specifies the double word
that will be moved to another location
• To DWORD: specifies the location where
the “From DWORD” will be move to
MOVED Example
In the following example, the MOVED instruction is used to move 32-bits of data from V2000
and V2001 to V3000 and V3001 when C100 turns on.
BCDTOR Parameters
• Value (WORD BCD): specifies the word or constant that will be converted to a Real
number
• Number of Decimal Points: specifies the number of implied decimal points in the Result
DWORD
• Result (DWORD REAL): specifies the location where the Real number will be placed
BCDTOR Example
In the following example, the BCDTOR instruction is used to convert the 16-bit data in
V2000 from a 4-digit BCD data format to a 32-bit REAL (floating point) data format and
stored into V3000 and V3001 when C100 turns on.
K2 in the Number of Decimal Points implies the data will have two digits to the right of the
decimal point.
BCDTORD Parameters
• Value (DWORD BCD): specifies the Dword or constant that will be converted to a Real
number
• Number of Decimal Points: specifies the number of implied decimal points in the Result
DWORD
• Result (DWORD REAL): specifies the location where the Real number will be placed
BCDTORD Example
In the following example, the BCDTORD instruction is used to convert the 32-bit data in
V2000 from an 8-digit BCD data format to a 32-bit REAL (floating point) data format and
stored into V3000 and V3001 when C100 turns on.
K2 in the Number of Decimal Points implies the data will have two digits to the right of the
decimal point.
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
* 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
always fit in 16 bits.
You can reference binary V-memory values by using the BCD conversion function on a
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.
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.
MATHBCD Parameters
• 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)
• 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.
MATHBCD Example
In the following example, the MATHBCD instruction is used to calculate the math expression
which multiplies the BCD value in V1200 by 1000 then divides by 4095 and loads the resulting
value in V2000 when C100 turns on.
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,
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.
The divide operation will divide 4095 into the 32-bit accumulator, yielding a result that will
always fit in 16 bits.
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
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
operation to store the result as BCD.
MATHBIN Parameters
• WORD Result: specifies the location where the binary result of the mathematical
expression will be 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 WORD Result. Each V-memory
location used in the expression must be in binary format.
MATHBIN Example
In the following example, the MATHBIN instruction is used to calculate the math expression
which multiplies the Binary value in V1200 by 1000 then divides by 4095 and loads the
resulting value in V2000 when C100 turns on.
MATHR Parameters
• DWORD Result: specifies the location where the Real result of the mathematical
expression will be placed (result must fit into a double word Real formatted location)
• Expression: specifies the mathematical expression to be executed and the
result is stored in specified DWORD Result location. Each V-memory
location used in the expression must be in Real format.
MATHR Example
In the following example, the MATHR instruction is used to calculate the math expression
which multiplies the REAL (floating point) value in V1200 by 10.5 then divides by 2.7 and
loads the resulting 32-bit value in V2000 and V2001 when C100 turns on.
Real to BCD with Implied Decimal Point and Rounding (RTOBCD) (IB-561)
DS Used Real to BCD with Implied Decimal Point and Rounding converts the absolute value of the given
HPP N/A Real number to a 4 digit BCD number, compensating for an implied number of decimal points
(K0-K4) and performs rounding.
For example, RTOBCD R56.74 with an
implied number of decimal points equal to K1,
would yield 567 BCD. If the implied number of
decimal points was 0, then the function would
yield 57 BCD (note that it rounded up).
If the Real number is negative, the Result will
equal its positive, absolute value.
RTOBCD Parameters
• Value (DWORD Real): specifies the Real Dword location or number that will be converted
and rounded to a BCD number with decimal points
• Number of Decimal Points: specifies the number of implied decimal points in the Result
WORD
• Result (WORD BCD): specifies the location where the rounded/implied decimal points
BCD value will be placed
RTOBCD Example
In the following example, the RTOBCD instruction is used to convert the 32-bit REAL (floating
point) data format in V3000 and V3001 to the 4-digit BCD data format and stored in V2000
when C100 turns on.
K2 in the Number of Decimal Points implies the data will have two implied decimal points.
For example, RTOBCDD R38156.74 with an implied number of decimal points equal to K1,
would yield 381567 BCD. If the implied number of decimal points was 0, then the function
would yield 38157 BCD (note that it rounded up).
If the Real number is negative, the Result will equal its positive, absolute value.
RTOBCDD Parameters
• Value (DWORD Real): specifies the Dword Real number that will be converted and
rounded to a BCD number with decimal points
• Number of Decimal Points: specifies the number of implied decimal points in the Result
DWORD
• Result (DWORD BCD): specifies the location where the rounded/implied decimal points
DWORD BCD value will be placed
Parameter DL06 Range
Value (DWORD Real) V,P,R R ; See DL06 V-memory map - Data Words
Number of Decimal Points K K0-8
Result (DWORD BCD) V See DL06 V-memory map - Data Words
RTOBCDD Example
In the following example, the RTOBCDD instruction is used to convert the 32-bit REAL
(floating point) data format in V3000 and V3001 to the 8-digit BCD data format and stored
in V2000 and V2001 when C100 turns on.
K2 in the Number of Decimal Points implies the data will have two implied decimal points.
SQUARE Parameters
• Value (WORD BCD): specifies the BCD
Word or constant that will be squared
• Result (DWORD BCD): specifies the
location where the squared DWORD
BCD value will be placed
SQUARE Example
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 when C100 turns
on.
SQUAREB Example
In the following example, the SQUAREB instruction is used to square the single word Binary
value in V2000 and store the 8-digit double word Binary result in V3000 and V3001 when
C100 turns on.
SQUARER Example
In the following example, the SQUARER instruction is used to square the 32-bit floating point
REAL value in V2000 and V2001 and store the REAL value result in V3000 and V3001 when
C100 turns on.
SUMBCD Parameters
• Start Address: specifies the starting address of a block of V-memory location values to be
added together (BCD)
• End Addr (inclusive): specifies the ending address of a block of V-memory location values
to be added together (BCD)
• Result (DWORD BCD): specifies the location where the sum of the block of V-memory
BCD values will be placed
SUMBCD Example
In the following example, the SUMBCD instruction is used to total the sum of all BCD values
in words V2000 thru V2007 and store the resulting 8-digit double word BCD value in V3000
and V3001 when C100 turns on.
SUMBIN Parameters
• Start Address: specifies the starting address of a block of V-memory location values to be
added together (Binary)
• 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 values will be placed
Parameter DL06 Range
Start Address V See DL06 V-memory map - Data Words
End Address (inclusive) V See DL06 V-memory map - Data Words
Result (DWORD Binary) V See DL06 V-memory map - Data Words
SUMBIN Example
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 when C100 turns on.
When enabled, this instruction will add up all the numbers in the group (so you may want to
place a differential contact driving the enable).
SUMR could be used as the first part of calculating an average.
SUMR Parameters
• Start Address (DWORD): specifies the starting address of a block of V-memory location
values to be added together (Real)
• End Addr (inclusive) (DWORD): specifies the ending address of a block of V-memory
location values to be added together (Real)
• Result (DWORD): specifies the location where the sum of the block of V-memory Real
values will be placed
Parameter DL06 Range
Start Address (inclusive DWORD) V See DL06 V-memory map - Data Words
End Address (inclusive DWORD) V See DL06 V-memory map - Data Words
Result (DWORD) V See DL06 V-memory map - Data Words
SUMR Example
In the following example, the SUMR instruction is used to total the sum of all floating point
REAL number values in words V2000 thru V2007 and store the resulting 32-bit floating point
REAL number value in V3000 and V3001 when C100 turns on.
DS Used ECOM100 Configuration defines the parameters other ECOM100 IBoxes will use when
HPP N/A working with this specific ECOM100 module. Each ECOM100 module that will be used with
IBox instructions will require a unique ECOM1000 Configuration instruction. The addresses
used become workspaces for the IBox instruction to use.
The addresses used in this instruction must
not be used elsewhere in the program.
The instructions must be placed at the top of
ladder, without a contact. The instruction
will inherently run only once, on the first
scan.
IBoxes ECEMAIL, ECRX, ECIPSUP and
others require an ECOM100 Configuration
before they will operate properly.
In order for MOST ECOM100 IBoxes to function, DIP switch 7 on the ECOM100 circuit
board must be ON DIP switch 7 can remainOFF if ECOM100 Network Read and Write
IBoxes (ECRX, ECWX) are the only IBoxes that will be used.
ECOM100 Example
The ECOM100 Config IBox coordinates all of the interaction with other ECOM100 based
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.
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 ECOM100#
parameter.
The Status register is for reporting any completion or error information to other ECOM100
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
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.
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. These V-Memory
registers must not be used anywhere else in your entire program.
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 Flash-
ROM. Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE,
on first 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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECDHCPD 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 reference this logical number
• 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
• 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
ECDHCPD 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, disable 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, Gateway
Address, and Subnet Mask. Typically disabling DHCP is done by assigning a hard-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). 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 C101. If it fails, you
can look at V2000 for the specific error code.
ECDHCPE 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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,
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 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 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 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 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.
ECDHCPQ 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 reference this logical number
• 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
• 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 ECOM100’s DHCP is enabled or
remain off if disabled - after instruction query, be sure to check the state of the Success/
Error bit state along with DHCP Enabled bit state to confirm a successful module query
ECDHCPQ 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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
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 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.
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).
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 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 IP Address, e.g.
http://192.168.12.86
You are limited to approximately 100 characters of message data for the entire instruction,
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
Subject: and Body: fields.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECEMAIL 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 reference this logical number
• 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
• 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
• To: specifies an E-mail address that the message will be sent to
• 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
ECEMAIL 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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 went
down.
The ECEMAIL is leading edge triggered, not power-flow driven (similar to a counter input
leg). An email will be sent whenever the power flow into the IBox goes from OFF to ON. This
helps prevent self inflicted spamming.
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.
For the ECOM100 Send EMail IBOX, the status codes below are specific to this IBox.
Normal Status 0 - 1
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
a PLC logic error (greater than 1000).
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
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 reference this logical number
• 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
• 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
ECEMRDS 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: Whenever an EStop is pushed, ensure that president of the company gets copies of all
EMails being sent.
The ECOM100 EMail Setup IBox allows you to set/change the SMTP EMail settings stored
in the ECOM100.
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.
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
a PLC logic error (greater than 1000).
You are limited to approximately 100 characters/bytes of setup data for the entire instruction.
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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECEMSUP 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 reference this logical number
• 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
• 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
• SMTP Server IP Addr: optional parameter that specifies the IP Address of the SMTP
Server on the ECOM100’s network
• Sender Name: optional parameter that specifies the sender name that will appear in the
“From:” field to those who receive the e-mail
• Sender EMail: optional parameter that specifies the sender EMail address that will appear
in the “From:” field to those who receive the e-mail
ECEMSUP 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 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
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
available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 3: Once the EStop is pulled out, take the president off the cc: list by restoring the
default EMail setup in the ECOM100.
This setup data is stored in Flash-ROM in the 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 IBox ONCE on first 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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECIPSUP 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 reference this logical number
• 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
• 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
• IP Address: specifies the module’s IP Address
• Subnet Mask: specifies the Subnet Mask for the module to use
• Gateway Address: specifies the Gateway Address for the module to use
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Error Code V See DL06 V-memory map - Data Words
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
ECIPSUP 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 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
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
available for use by the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, configure all of the TCP/IP parameters in the ECOM100:
IP Address: 192.168. 12.100
Subnet Mask: 255.255. 0. 0
Gateway Address: 192.168. 0. 1
The ECIPSUP is leading edge triggered, not power-flow driven (similar to a counter input 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.
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.
ECRDDES 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 reference this logical number
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
• Description: specifies the starting buffer location where
the ECOM100’s Module Name will be placed
• Num Char: specifies the number of characters (bytes) to
read from the ECOM100’s Description field
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Description V See DL06 V-memory map - Data Words
Num Chars K K1-128
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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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
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.
If successful, turn on C100. If there is a failure, turn on C101.
ECRDGWA 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 reference this logical number
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
• Gateway IP Addr: specifies the starting address where the ECOM100’s Gateway Address
will be placed in 4 consecutive V-memory locations
ECRDGWA 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, read the Gateway Address of the ECOM100 and store it in V3000
thru V3003 (4 decimal numbers). The ECOM100’s Gateway Address could be displayed by
an HMI.
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.
If successful, turn on C100. If there is a failure, turn on C101.
ECRDIP 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 reference this logical number
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
• IP Address: specifies the starting address where the ECOM100’s IP
Address will be placed in 4 consecutive V-memory locations
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
IP Address (4 Words) V See DL06 V-memory map - Data Words
ECRDIP 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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.
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.
If successful, turn on C100. If there is a failure, turn on C101.
ECRDMID 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 reference this logical number
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
• Module ID: specifies the location where the ECOM100’s
Module ID (decimal) will be placed
ECRDMID 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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
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.
If successful, turn on C100. If there is a failure, turn on C101.
ECRDNAM 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 reference this logical number
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
• Module Name: specifies the starting buffer location where the ECOM100’s Module Name
will be placed
• Num Chars: specifies the number of characters (bytes) to read from the ECOM100’s
Name field
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Module Name V See DL06 V-memory map - Data Words
Num Chars K K1-128
ECRDNAM 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, read the Module Name of the ECOM100 and store it in V3000 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
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.
If successful, turn on C100. If there is a failure, turn on C101.
ECRDSNM 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 reference this
logical number
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
• Subnet Mask: specifies the starting address where the ECOM100’s Subnet Mask will be placed in 4
consecutive V-memory locations
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Subnet Mask (4 Words) V See DL06 V-memory map - Data Words
ECRDSNM 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, read the Subnet Mask of the ECOM100 and store it in V3000 thru
V3003 (4 decimal numbers). The ECOM100’s Subnet Mask could be displayed by an HMI.
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.
If successful, turn on C100. If there is a failure, turn on C101.
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.
Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on first
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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
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 reference this logical number
• 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
• 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
• Description: specifies the Description that will be written to the module
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Error Code V See DL06 V-memory map - Data Words
Description Text
ECWRDES 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, set the Module Description of the ECOM100. Typically this is done
using NetEdit, but this IBox allows you to configure the module description in the ECOM100
using your ladder program.
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.
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.
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 reference this
logical number
• 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
• 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
• Gateway Address: specifies the Gateway IP Address that will be written to the module
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Error Code V See DL06 V-memory map - Data Words
Gateway Address 0.0.0.1. to 255.255.255.254
ECWRGWA 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, assign the Gateway Address of the ECOM100 to 192.168.0.1
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 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 V2000
for the specific error code.
To configure all of the ECOM100 TCP/IP parameters in one IBox, see the ECOM100 IP
Setup (ECIPSUP) IBox.
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.
Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on first
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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
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 reference this
logical number
• 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
• 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
• IP Address: specifies the IP Address that will be written to the module
ECWRIP 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, assign the IP Address of the ECOM100 to 192.168.12.100
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 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 V2000
for the specific error code.
To configure all of the ECOM100 TCP/IP parameters in one IBox, see the ECOM100 IP
Setup (ECIPSUP) IBox.
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.
Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on first
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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
ECWRMID 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 reference this logical number
• 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
• 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
• Module ID: specifies the Module ID that will be written to the module
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Error Code V See DL06 V-memory map - Data Words
Module ID K0-65535
ECWRMID 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, set the Module ID of the ECOM100. Typically this is done using
NetEdit, but this IBox allows you to configure the module ID of the ECOM100 using your
ladder program.
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.
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.
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.
Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on
first 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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
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 reference this logical number
• 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
• 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
• Module Name: specifies the Name that will be written to the module
Parameter DL06 Range
ECOM100# K K0-255
Workspace V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
Error Code V See DL06 V-memory map - Data Words
Module Name Text
ECWRNAM 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, set the Module Name of the ECOM100. Typically this is done using
NetEdit, but this IBox allows you to configure the module name of the ECOM100 using your
ladder program.
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.
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.
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.
Therefore, it is HIGHLY RECOMMENDED that you only execute this IBox ONCE on first
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.
In order for this ECOM100 IBox to function, you must turn ON dip switch 7 on the
ECOM100 circuit board.
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 reference this logical number
• 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
• 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
• Subnet Mask: specifies the Subnet Mask that will be written to the module
ECWRSNM 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
Rung 2: On the 2nd scan, assign the Subnet Mask of the ECOM100 to 255.255.0.0
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
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 V2000
for the specific error code.
To configure all of the ECOM100 TCP/IP parameters in one IBox, see the ECOM100 IP
Setup (ECIPSUP) IBox.
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).
They will execute round-robin style, automatically.
ECRX 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 reference this logical number
• 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
• 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
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
ECRX 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
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).
They will execute round-robin style, automatically.
ECWX 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 reference this logical number
• 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 ECWX instruction
• From Master Element (Src): specifies the location in the master
ECOM100 PLC where the data will be sourced from
• Number of Bytes: specifies the number of bytes to write to the slave ECOM(100) PLC
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
ECWX 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
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 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 available for use by
the other ECxxxx IBoxes using this specific ECOM100 module.
K0
K1
V400
V401
V402 - V502
The 2nd parameter “CPU Port or Slot” is the same value as in the high byte of the first LD
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 DL06 CPU serial port 2. If using a DCM or
ECOM module, use Kx, where x equals the slot where the module is installed.
Since this logic only executes on the first scan, this IBox cannot have any input logic.
NETCFG Parameters
• Network#: specifies a unique # for each ECOM(100) or DCM network to use
• 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
NETCFG Example
The Network Configuration IBox coordinates all of the interaction with other 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 scan.
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 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 enter K0 for
their Network# parameter.
The Workspace register is used to maintain state information about the port or module, along
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.
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
On). They will execute round-robin style, automatically.
NETRX Parameters
• Network#: specifies the (CPU port’s, DCM’s, ECOM’s) Network # defined by the
NETCFG instruction
• 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
• 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
• 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
• Error: specifies a bit that will turn on if the instruction is not successfully completed
Parameter DL06 Range
Network# K K0-255
Workspace V See DL06 V-memory map - Data Words
Slave ID K, V K0-90: See DL06 V-memory map
From Slave Element (Src) X,Y,C,S,T,CT,GX,GY,V,P See DL06 V-memory map
Number of Bytes K K1-128
To Master Element (Dest) V See DL06 V-memory map - Data Words
Success X,Y,C,GX,GY,B See DL06 V-memory map
Error X,Y,C,GX,GY,B See DL06 V-memory map
NETRX Example
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
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.
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
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
enter K0 for their Network# parameter.
The Workspace register is used to maintain state information about the port or module,
along 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.
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
On). They will execute round-robin style, automatically.
NETWX Parameters
• Network#: specifies the (CPU port’s, DCM’s, ECOM’s)
Network # defined by the NETCFG instruction
• 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
• From Master Element (Src): specifies the location in the
master PLC where the data will be sourced from
• 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
• 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
NETWX Example
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
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.
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 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 enter K0 for
their Network# parameter.
The Workspace register is used to maintain state information about the port or module, along
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.
CTRIO Parameters
• CTRIO#: specifies a specific CTRIO module based on a user defined number
• Slot: specifies which PLC option slot the CTRIO module occupies
• Workspace: specifies a V-memory location that will be used by the instruction
• CTRIO Location: specifies where the module is located (local base only for DL06)
• 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.
• 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.
CTRIO Example
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
through V2061 for its output data.
The Workspace register is for internal use by this IBox instruction and MUST NOT be used
anywhere else in your program.
CTRAPT Parameters
• 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
• Entry Type: specifies the Entry Type to be added to the end of a Preset Table
• 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
• 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
• Error: specifies a bit that will turn on if the instruction does not complete successfully
CTRADPT Example
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
through V2061 for its output data.
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.
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 which
it will reset will be 20.
Operating procedure for this example code is to load the CTRADPT_ex1.cwb file to your
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 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 on
to count of 20+ (output #0 should turn off).
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
CTRCLRT Parameters
• 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
• 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
• Error: specifies a bit that will turn on if the instruction does not complete successfully
CTRCLRT Example
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
through V2061 for its output data.
Rung 2: This rung is a sample method for enabling the CTRCLRT command. A C-bit is 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 on
the CTRIO in slot 2.
Operating procedure for this example code is to load the CTRCLRT_ex1.cwb file to your
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 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 on).
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
CTREDPT Parameters
• 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
• 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
• 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
• 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
• 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
•
CTREDPT Example
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
through V2061 for its output data.
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
CTREDRL Parameters
• 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
• 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
• 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
• 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
• 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
•
CTREDRL Example
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
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
CTRINPT Parameters
• 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
• 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
• 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
• 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
•
CTRINPT Example
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
through V2061 for its output data.
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
CTRINTR Parameters
• 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
• 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
• 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
• 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
CTRINTR Example
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
Rung 4: This rung allows the operator to enable output #0 from the ladder code.
CTRLDPR Parameters
• 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
• File#: specifies a CTRIO profile File number to be loaded
• 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
• Error: specifies a bit that will turn on if the instruction does not complete successfully
CTRLDPR Example
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
through V2061 for its output data.
Rung 2: This CTRIO Load Profile IBox will load File #1 into the working memory of Output
0 in CTRIO #1. This example program requires that you load CTRLDPR_IBox.cwb into your
Hx-CTRIO(2) module.
CTRRDER Example
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
through V2061 for its output data.
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
Hx-CTRIO(2) module.
CTRRTLM Parameters
• 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
• Frequency: specifies the output pulse rate (H0-CTRIO:
20Hz - 25KHz / H0-CTRIO2: 20Hz - 250 KHz)
• 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%, 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
• 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
CTRRTLM Example
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
through V2061 for its output data.
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
that you load CTRRTLM_IBox.cwb into your Hx-CTRIO(2) module.
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 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
anywhere else in your program.
CTRRTPM Parameters
• 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
• Frequency: specifies the output pulse rate (H0-CTRIO:
20Hz - 25KHz / H0-CTRIO2: 20Hz - 250 KHz)
• 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 train will be turned off
• 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
• Error: specifies a bit that will turn on if the instruction does not complete successfully
CTRRTPM Example
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
through V2061 for its output data.
Rung 3: If the Run To Position Mode parameters are OK, set the Direction Bit and Enable
the output.
CTRVELO Parameters
• 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
• Frequency: specifies the output pulse rate (H0-CTRIO: 20Hz - 25KHz / H0-CTRIO2:
20Hz - 250 KHz)
• 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: This DWORD value specifies the number of pulses to output. A Step Count
value of -1 (or 0XFFFFFFFF) causes the CTRIO to output pulses continuously. Negative
Step Count values must be V-Memory references.
• 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
• Error: specifies a bit that will turn on if the instruction does not complete successfully
CTRVELO Example
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
through V2061 for its output data.
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.
CTRWFTR Parameters
• 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
• 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
• Error: specifies a bit that will turn on if the instruction does not complete successfully
CTRWFTR Example
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
through V2061 for its output data.
Rung 2: This CTRIO Edit Preset Table Entry IBox will change Entry 0 in Table #2 to be a
RESET at Count 3456. This example program requires that you load CTRWFTR_IBox.cwb
into your Hx-CTRIO(2) module.