Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 35 of 53

DL06 Micro PLC User Manual, Volume 1 of 2, pages 340 to 349

Pages 340 to 349 of 524

The original document is the PDF (6.4 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 AutomationDirect Direct Logic DL06 and Koyo DL06 D0-06DD1

Page 340

Chapter 5: Standard RLL Instructions - Message Instructions

Message Instructions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Fault (FAULT) DS5

Used

HPP

Used

The Fault instruction is used to display a message on the handheld FAULT programmer, the optional LCD display or in the DirectSOFT 5 A aaa status bar. The message has a maximum of 23 characters and can 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. Operand Data Type

DL06 Range aaa

V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K

See memory map 1-FFFF

Discrete Bit Flags SP50

Description On when the FAULT instruction is executed

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 5 X1

Handheld Programmer Keystrokes $

FAULT K1

B STR

1 A

SHFT

F

SHFT

E

SHFT

D

SHFT

A

SHFT

N TMR

C

SHFT

N TMR

C

ENT U ISG

5

0

N TMR

D

4

B

3

L ANDST C

L ANDST

T MLR

B 1

ENT

END DLBL

5–186

K1 ACON A SW

NCON K 2031

0

3

ENT B

1

L ANDST

O INST#

N TMR

S

2

RST

W ANDN

ENT

O INST#

N TMR

C

A

D

2

N TMR

D

2

O INST#

NCON K 3436

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1

ENT

2

0 E

3

B 3

D 4

1 G

3

6

ENT ENT

Page 341

Chapter 5: Standard RLL Instructions - Message Instructions

Data Label (DLBL) DS5

Used

HPP

Used

The Data Label instruction marks the beginning of an ASCII/numeric data area. DLBLs are programmed after the End statement. A maximum of 64 DLBL instructions can be used in a program. Multiple NCONs and ACONs can be used in a DLBL area. Operand Data Type

K aaa

DLBL

DL06 Range aaa

Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K

1-FFFF

ASCII Constant (ACON) DS5

Used

HPP

Used

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

ACON A aaa

DL06 Range aaa

ASCII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A

0-9 A-Z

Numerical Constant (NCON) DS5

Used

HPP

Used

The Numerical Constant instruction is used with the DLBL instruction to store the HEX ASCII equivalent of numerical data for use with other instructions. Two digits can be stored in an NCON instruction. Operand Data Type

NCON K aaa

DL06 Range aaa

Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K

1-FFFF

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5–187

Page 342

Chapter 5: Standard RLL Instructions - Message Instructions

Data Label Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

In the following example, an ACON and two NCON instructions are used within a DLBL instruction to build a text message. See the FAULT instruction for information on displaying messages. The DV-1000 Manual also has information on displaying messages.

5–188

DL06 Micro PLC User Manual, 3rd Edition Rev. A

DirectSOFT Direct SOFT325

END

DLBL K1

ACON A SW

NCON K 2031

NCON K 3436

Handheld Programmer Keystrokes

SHFT

E 4

N TMR

SHFT

D

SHFT

A

L B ANDST 1

L ANDST

B

3

C

SHFT

N TMR

C

SHFT

N TMR

C

0

D 3

ENT

1

ENT

2

O INST#

N TMR

S RST

W ANDN

ENT

O INST#

N TMR

C

A

D

2

O INST#

N TMR

D

2

2

0 E

3

B 3

D 4

1 G

3

6

ENT ENT

Page 343

Chapter 5: Standard RLL Instructions - Message Instructions

Move Block Instruction (MOVBLK) DS5

Used

HPP

Used

The Move Block instruction copies a specified number of words from a Data Label Area of program memory (ACON, NCON) to the specified V-memory location. Below are the steps for using the Move Block function:

MOVBLK V aaa

• Step 1: Load the number of words (octal) to be copied into the 1st level of the accumulator stack. • Step 2: Load the source data label (LDLBL Kaaa) into the accumulator. This is where the data will be copied from. • Step 3: Insert the MOVBLK instruction that specifies the V-memory destination. This is where the data will be copied to.

Copy Data From a Data Label Area to V-memory In the example below, data is copied from a Data Label Area to V-memory. When X1 is on, the octal value (O4) is copied to the first level of the accumulator stack using the Load Address (LDA) instruction. This value specifies the number of words to be copied. Load Label (LDLBL) instruction will load the source data address (K1) into the accumulator. This is where the data will be copied from. The MOVBLK instruction specifies the destination starting location and executes the copying of data from the Data Label Area to V-memory. Direct SOFT 5 X1

. .

Data label area to be copied

LDA O4

DLBL

Load the value 4 into the accumulator specifying the number of words to be copied.

LDLBL K1 Load the value 1 into the accumulator specifying the Data Label Area K1 as the starting address of the data to be copied.

X

X

X

X V1777

1

2

3

4 V2000

4

5

3

2 V2001

6

1

5

1 V2002

8

8

4

5 V2003

X

X

X

X V2004

K1

N

C

O

N

K

1

2

3

N

4

C

O

N

K 4

5

3

N

C

O

N

K

6

1

5

N

C

O

N

K

8

8

4

2

1

5

MOVBLK

. .

V2000 V2000 is the destination starting address for the data to be copied.

Handheld Programmer Keystrokes $

B

ENT

STR

1

SHFT

L D ANDST 3

A

SHFT

L D 3 ANDST

L B ANDST 1

SHFT

M ORST

V AND

O INST#

E 4

0

B 1

ENT

L ANDST L ANDST

B 1 K JMP

ENT C

A 2

A 0

A 0

0

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

ENT

5–189

Page 344

Chapter 5: Standard RLL Instructions - Message Instructions

Print Message (PRINT)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

DS5

Used

HPP

N/A

5–190

PRINT

A aaa

The Print Message instruction prints the embedded text “Hello, this is a PLC message” or text/data variable message (maximum 128 characters) to the specified communications port (Port 2 on the DL06 CPUor D0-DCM module), which must have the communications port configured. Operand Data Type

DL06 Range aaa

Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K

2

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 5, 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 5 to use to store the port setup information. You will need to reserve 9 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.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 345

Chapter 5: Standard RLL Instructions - Message Instructions 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 2 3 4 5 6 7

$$ $” $L or $l $N or $n $P or $p $R or $r $T or $t

Dollar sign ($) Double quotation (”) Line feed (LF) Carriage return line feed (CRLF) Form feed Carriage return (CR) 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. X1

PRINT

CPU K2

Print the message to Port 2 when X1 makes an off-to-on transition.

“Hello, this is a PLC message.$N”

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5–191

Page 346

Chapter 5: Standard RLL Instructions - Message Instructions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5–192

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.

#

Character code

Description

1 2 3 4 none :B :D :DB

16-bit binary (decimal number) 4 digit BCD 32-bit binary (decimal number) 8 digit BCD

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 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. X1

PRINT K2 “Reactor temperature = ” V2000 “deg. $N” ⊥ ⊥ Message will read: Reactor temperature = 0156 deg.

Print the message to Port 2 when X1 makes an off-to-on transition. ⊥ represents a space

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.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 347

Chapter 5: Standard RLL Instructions - Message Instructions Bit element This is used for printing the state of the designated bit in V-memory or a relay bit. The bit element can be assigned by the designating point (.) and bit number preceded by the Vmemory number or relay number. The output type is described as shown in the table below. #

Data Format

Description

1 none

2

:BOOL

3

:ONOFF

Print 1 for an ON state, and 0 for an OFF state Print “TRUE” for an ON state, and “FALSE” for an OFF state 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 print is 128. The number of characters for each element is listed in the table below: Element Type

Maximum Characters

Text, 1 character 16 bit binary 32 bit binary 4 digit BCD 8 digit BCD Floating point (real number) Floating point (real with exponent) V-memory/text Bit (1/0 format) Bit (TRUE/FALSE format) Bit (ON/OFF format)

1 6 11 4 8 12 12 2 1 5 3

The handheld programmer’s mnemonic is “PRINT” followed by the DEF field. Special relay flags SP116 and SP117 indicate the status of the DL06 CPU ports (busy, or communications error). See the appendix on special relays for a description. NOTE: You must use the appropriate special relay in conjunction with the PRINT command to ensure the ladder program does not try to PRINT to a port that is still busy from a previous PRINT or WX or RX instruction.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

5–193

Page 348

Chapter 5: Standard RLL Instructions - Intelligent I/O Instructions

Intelligent I/O Instructions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Read from Intelligent Module (RD) DS32

Used

HPP

Used

5–194

The Read from Intelligent Module instruction reads a block of data (1-128 bytes maximum) from an intelligent I/O RD module into the CPU’s V-memory. It loads the function V aaa parameters into the first and second level of the accumulator stack and the accumulator by three additional instructions. Listed below are the steps to program the Read from Intelligent module function. Step 1: 앥 Load the base number (0-3) into the first byte and the slot number (0-7) into the second byte of the second level of the accumulator stack. Step 2: 앥 Load the number of bytes to be transferred into the first level of the accumulator stack (maximum of 128 bytes). Step 3: 앥 Load the address from which the data will be read into the accumulator. This parameter must be a HEX value. Step 4: 앥 Insert the RD instruction which specifies the starting V-memory location (Vaaa) where the data will be read into. Helpful Hint: 앥 Use the LDA instruction to convert an octal address to its HEX equivalent and load it into the accumulator when the HEX format is required. Operand Data Type

DL06 Range aaa

V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V

See memory map

Discrete Bit Flags SP54

Description On when RX, WX RD, WT instructions are executed with the wrong parameters.

NOTE: Status flags are valid onlyh 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 loacations V1400-V1402. X1

Intelligent Module

CPU

Direct SOFT 5 LD K0102

LD K6

LD K0

Data

The constant value K0102 specifies the base number (01) and the base slot number (02). The constant value K6 specifies the number of bytes to be read.

The constant value K0 specifies the starting address in the intelligent module.

V1400

3

4

1

2

V1401

7

8

5

6

V1402

0

1

9

0

V1403

X

X

X

X

V1404

X

X

X

X

RD V1400

{

Address 0

34

Address 1

56

Address 2

78

Address 3

90

Address 4

01

Address 5

Handheld Programmer Keystrokes $

B STR

V1400 is the starting location in the CPU where the specified data will be stored.

}

12

1

SHFT

L ANDST

D

SHFT

L ANDST

D

SHFT

L ANDST

D

SHFT

R ORN

D

3 3 3

ENT PREV

A

PREV

G

PREV B

3

DL06 Micro PLC User Manual, 3rd Edition Rev. A

B

6 A 0 E

1

A 1

0

2

ENT ENT A

4

C 0

A 0

0

ENT

ENT

Page 349

Chapter 5: Standard RLL Instructions - Intelligent I/O Instructions

Write to Intelligent Module (WT) DS32

Used

HPP

Used

The Write to Intelligent Module instruction writes a block of data (1-128 bytes maximum) to an intelligent WT I/O module from a block of V-memory in the CPU. The V aaa function parameters are loaded into the first and second level of the accumulator stack and the accumulator by three additional instructions. Listed below are the steps to program the Read from Intelligent module function. Step 1: 앥 Load the base number (0-3) into the first byte and the slot number (0-7) into the second byte of the second level of the accumulator stack. Step 2: 앥 Load the number of bytes to be transferred into the first level of the accumulator stack (maximum of 128 bytes). Step 3: 앥 Load the intelligent module address which will receive the data into the accumulator. This parameter must be a HEX value. Step 4: 앥 Insert the WT instruction which specifies the starting V-memory location (Vaaa) where the data will be written from in the CPU. Helpful Hint: 앥 Use the LDA instruction to convert an octal address to its HEX equivalent and load it into the accumulator when the HEX format is required.

1 2 3 4 5 6 7 8 Operand Data Type DL06 Range 9 aaa 10 Discrete Bit Flags Description 11 NOTE: Status flags are valid onlyh until another instruction uses the same flag. 12 In the following example, when X1 is on, the WT instructionwill write six bytes of data to an intelligent module in base 1, slot 2 starting at address 0 in the intelligent module and copy 13 the data from V-memory locations V1400-V1402. 14 } A B C D V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V

SP54

See memory map

On when RX, WX RD, WT instructions are executed with the wrong parameters.

Intelligent Module

CPU

Data

Direct SOFT 5 X1

LD

K0102

LD

K6

LD

K0

The constant value K0102 specifies the base number (01) and the base slot number (02). The constant value K6 specifies the number of bytes to be written.

The constant value K0 specifies the starting address in the intelligent module.

V1377

X

X

X

X

V1400

3

4

1

2

V1401

7

8

5

6

V1402

0

1

9

0

V1403

X

X

X

X

V1404

X

X

X

X

WT

V1400

{

Address 0

34

Address 1

56

Address 2

78

Address 3

90

Address 4

01

Address 5

Handheld Programmer Keystrokes $

B

STR

V1400 is the starting location in the CPU where the specified data will be written from.

12

1

SHFT

L ANDST

D

SHFT

L ANDST

D

SHFT

L ANDST

D

SHFT

W ANDN

T

3 3 3

ENT

PREV

A

PREV

G

PREV

B MLR

B

6

A

0

E 1

A

1

0

2

ENT

ENT

ENT

A 4

C

0

A 0

0

DL06 Micro PLC User Manual, 3rd Edition Rev. A

ENT

5–195