The text of a manual · part 5 of 11
DL305 Handheld Programmer, pages 41 to 50
Pages 41 to 50 of 107
The original document is the PDF (2.6 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Koyo D3-HP
Page 41
2--20
Entering RLL Programs
Entering RLL Programs
Entering RLL Programs
Entering Shift Registers
The DL305 CPUs allow you to use Control Relays with a Shift Register. You can have any number of Shift Registers, but there are only 128 Control Relays that can be used (400--577). Also, you cannot use these bits as Control Relays and Shift Register bits. (See the DL305 User Manual for more details.) The Shift Register has three input contacts. S Data, used to determine a value (1 or 0) that will be shifted through the register S Clock, on each low to high transition, the value that is on the data line will be shifted into the shift register. S Reset, if the reset contact comes on, then the Shift Register is reset and all Control Relays are reset. The following diagram shows a brief example of how the Shift Register works. 001
Data
002
Clock
003
Reset
SR
SR420
Inputs on Successive Scans Data
Clock
Reset
1
1
0
0
1
0
0
1
0
1
1
0
0
1
0
0
0
1
SR400
Shift Register Bits 400
417
-- indicates ON
REV A
-- indicates OFF
Page 42
2--21
Entering RLL Programs You can use the following keystrokes to enter a Shift Register. Enter the Data input STR
SHF
1
Data Display before ENT is pressed
001
ENT
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
Enter the Clock input STR
SHF
2
002
ENT
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
Enter the Reset input STR
SHF
3
003
ENT
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
Enter the Shift Register and starting location SR
SHF
4
0
400
0
ADDRESS/DATA
ENT
ON/OFF
RUN BATT PWR CPU
Enter the end of the Shift Register SHF
4
1
7
ENT
417
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
Entering RLL Programs
4 OUT 5 TMR 6 CNT 7 SR
Entering RLL Programs
0 AND 1 OR 2 STR 3 NOT
Page 43
2--22
Entering RLL Programs
Entering Data Instructions
In addition to the simple RLL instructions, the DL305 CPUs also provide Data Instructions that allow you to manipulate words of data. For example, you may want to perform simple math operations on register values. The following table provides a listing of the various Data Operation Instructions. You should see the DL305 User Manual for complete details on how the instructions operate.
Entering RLL Programs
Entering RLL Programs
Category
Data Load Instructions
Mnemonic
Function #
Description
DSTR
F50
Load a 4-digit constant or 2-bytes of register data into the accumulator
DSTR 1
F51
Load 1-byte of register data into the accumulator
DSTR 2
F52
Load the upper 4 bits of a register into the lower 4 bits of the accumulator
DSTR 3
F53
Load the lower 4 bits of a register into the upper 4 bits of the accumulator
DSTR 5
F55
Load the digital value of a 16 point module (2 bytes) into the accumulator
DOUT
F60
Write the accumulator to 2 sequential registers
DOUT 1
F61
Write the lower byte of the accumulator to a register
DOUT 2
F62
Write the lower 4 bits of the accumulator to the upper 4 bits of a register
DOUT 3
F63
Write the lower 4 bits of the accumulator to the lower 4 bits of a register
DOUT 5
F65
Write the contents of the accumulator to a 16-point output module (2 bytes)
CMP
F70
Compare a 2-byte BCD reference or a 4-digit BCD constant to the accumulator
ADD
F71
Add a 2-byte BCD reference or a 4-digit BCD constant to the accumulator
SUBTRACT
F72
Subtract a 2-byte BCD reference or a 4-digit BCD constant from the accumulator
MULTIPLY
F73
Multiply a 2-byte BCD reference or a 4-digit BCD constant by the value in the accumulator
DIVIDE
F74
Divide the accumulator by a 2-byte BCD reference or a 4-digit BCD constant
Data Out Instructions
Math Instructions
Page 44
Entering RLL Programs
Category
Bit Manipulation Instructions
Function #
Description
DAND
F75
Performs a bit “AND” on a 2-byte reference or a 4-digit BCD constant and the bits in the accumulator
DOR
F76
Performs a bit “OR” on a 2-byte reference or a 4-digit BCD constant and the bits in the accumulator
SHIFT RIGHT
F80
Shifts the contents of the accumulator to the right a specified number of times. 1 -- 15 bits can be shifted.
SHIFT LEFT
F81
Shifts the contents of the accumulator to the left a specified number of times. 1 -- 15 bits can be shifted.
DECODE
F82
Decodes the first 4 bits of the accumulator into a decimal number.
ENCODE
F83
Encodes an accumulator bit into a 4-bit code that represents the decimal number (0--15).
INV
F84
Logically inverts the bit pattern contained in the accumulator (1 to 0, 0 to 1).
BCD--BIN
F85
Converts the accumulator value from BCD to Binary
BIN--BCD
F86
Converts the accumulator value from Binary to BCD
FAULT
F20
Sends a 4-digit BCD number, from a 2-byte reference or a constant, to the programmer display
The following pages show you how to enter these functions with the Handheld Programmer.
Entering RLL Programs
Fault Detection Instructions
Mnemonic
Entering RLL Programs
Data Conversion Instructions
2--23
Page 45
2--24
Entering RLL Programs If you examine the Handheld Programmer keypad, you’ll notice two keys labeled F and R. These keys are used to access the various Data Operation Instructions. We’ll use the following example to show how the keys are used. 001
DSTR
F50
K1234
DOUT
Constant
Register
The example uses the DSTR and DOUT instructions. As you enter the instructions you will use the Function Numbers that were shown in the previous instruction table.
Entering RLL Programs
Entering RLL Programs
R400
F60
Instruction
REV A
Page 46
Entering RLL Programs
2--25
Enter the contact STR
SHF
1
001
ENT
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
Enter the DSTR instruction F
5
0
F50
ENT
(Notice that you did not have to press the SHF key before entering the numbers.)
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
Entering RLL Programs
0 AND 1 OR 2 STR 3 NOT
Enter the constant 1
2
3
4
1234
ADDRESS/DATA
ENT
ON/OFF
RUN BATT PWR CPU
Enter the DOUT instruction F
6
0
F60
ENT
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
Enter the Register location R
4
0
0
ENT
(Notice that the R key is used for entering registers and that you do not have to press the SHF key before entering the numbers.)
r400
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
Entering RLL Programs
SHF
Page 47
2--26
Entering RLL Programs
Checking for Program Errors Automatic Error Checking Syntax Check
The Handheld automatically checks for some errors during program entry. Chapter 6 provides a complete listing of the error codes. You can also execute a program syntax check which will identify programming errors. This check can be performed in either Program mode or Run mode. The following example shows how the syntax check works.
Entering RLL Programs
001
CNT
CT601 K50
Counter Reset Leg is missing Execute the syntax check CLR
E07
SCH
Entering RLL Programs
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
0 MCS 1 MCR 2 SET 3 RST
4 ADR 5 SHF 6 DATA 7 REG
Press CLR to display the address where the error occurred
0003 ....
CLR
ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
Correct the problem and continue running the Syntax check until the E07 message no longer appears.
REV A
Page 48
Entering RLL PLUS Programs In This Chapter. . . ., RLL PLUS Programming Basics, Entering an Initial Stage, Entering Jump Instructions, Entering Stage Instructions, Entering Timers, Entering Counters, Entering Shift Registers
13
Page 49
3--2
Entering RLL Plus Programs
Entering RLL Programs
Entering Programs
RLL PLUS Programming Basics RLL PLUS is a simplified programming method that makes program design and troubleshooting much easier. This programming method is similar to Sequential Function Chart programming and only uses a few new instructions. Before you continue, make sure you have a Handheld Programmer that supports the extra instructions needed with this style of programming (part number DL3--HPP). This chapter does not provide a complete discussion of these instructions. Instead, it just provides a quick overview of how to enter the instructions with the DL305 Handheld Programmer. The primary benefit from this programming method is the number of logic interlocks is significantly reduced. This is because the individual program segments, called “stages” are completely self contained. When a program segment is active, the inputs and outputs in that stage will be examined and updated as appropriate. If the stage is not active, that portion of the program is not even scanned. How does this remove the interlocking burden? Simple, most interlocks are used because you not only have to make something happen, but you also have to prevent unwanted actions from happening. See the DL305 User Manual for details on RLL PLUS programming. We’ll use the following cutoff saw example to show the different instructions that are used. This example is not intended to show you how to design RLL PLUS programs, but is merely used to point out the instructions and the Handheld Programmer keystrokes needed to enter the instructions. If you want to know more about this style of programming, see the DL305 User Manual for complete details. This simple cutoff saw operates in the following manner. 1. Once the operator presses a start switch, the pipe conveyor is started. (The operator can also press a Stop switch to stop the operation at any time.) 2. The pipe travels along a conveyor until it reaches a physical stop. The stop contains a limit switch that signals the system to stop the conveyor and begin the cutting operation. 3. The pipe is clamped in place. 4. The saw motor is started and the saw cuts the pipe. 5. The saw is retracted, the motor is turned off and the clamp is released. 6. If the saw is in one-cycle mode, the operator must press the start switch again. If it is not in one-cycle mode, the saw continues the operations sequence.
Cutoff Saw
The operator can stop the process at any time just by pressing a stop switch.
Page 50
3--3
Entering RLL Plus Programs
The instructions used to create this program are very similar to the ones used in normal RLL programs. For example, you still enter contacts and output coils the same way. There are a couple of new instructions and these instructions have keys on the Handheld Programmer. You’ll notice the Initial Stage (ISG) instruction begins the program. If you examine the Handheld you’ll notice a key for the ISG instruction. Here’s a list of the primary instructions you’ll use with RLL PLUS programs. S Initial Stage (ISG) S Stage (SG) S Jump to Stage (JMP) There are also a few other instructions that are used differently (and entered differently) in RLL PLUS programs. S Timers S Counters S Shift Registers The following pages show you how to enter these instructions.
ISG S0000
Wait for start Start
S1 JMP
000 SG
Move pipe down conveyor
S0001
S10 JMP Conveyor OUT 020
Pipe Limit
S2 JMP
001 SG
Lock the clamp
S0002
Clamp SET 021 S3 JMP
Pipe Locked 002 SG
Cut the pipe
S0003
Saw On SET 022 Saw Down OUT 023
Lower Limit
S4 JMP
003 SG
Raise the saw
S0004
TMR
T600 50
Top Limit
600
Saw Off RST 022 Clamp RST 021
004
S5 JMP SG
One cycle or automatic?
S0005
One Cycle
S0 JMP
005 One Cycle
S1 JMP
005 SG
Monitor for Stop
S0010 Stop
S0 -- S5 RST
010 S0 JMP
Entering RLL Programs
WARNING: The example program shown is not suitable for actual applications. There are many safety aspects that have not been considered, which could result in a risk of personal injury or damage to equipment.
Only executes logic in stages that are active
Entering Programs
The following diagram shows a very simple RLL PLUS program that would control this operation. This representation is what you could expect to see if you were using our DirectSOFT programming software. You may notice the diagram doesn’t appear very different from a normal RLL program. However, there are significant advantages that aren’t obvious at first glance. If you want to know more, take a few extra minutes to read about this time-saving approach in the DL305 User Manual.