1. Trang chủ
  2. » Địa lý

Tổng Hợp Lệnh Lập Trình PLC Mitsubishi

39 75 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 39
Dung lượng 1,14 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

When writing is completed during RUN for a circuit including an instruction for falling edge pulse (PLF instruction), the instruction for falling edge pulse is not executed regardless of[r]

Trang 1

This chapter explains types and functions of basic sequence instructions.

For beginners to sequence control, we offer "Introduction Course" and "Relay Ladder Course" learning texts for

reference

We can also offer the PLC learning software "Beginner Course"

Contact Instruction

LD Load

Initial logical operation contact type NO (normally open)

X,Y,M,S,D b,T,C Section 7.1

LDI Load Inverse

Initial logical operation contact type NC (normally closed)

X,Y,M,S,D b,T,C Section 7.1

LDP Load Pulse Initial logical operation of rising edge pulse X,Y,M,S,D b,T,C Section 7.5

LDF Load Falling Pulse Initial logical operation of falling/trailing edge pulse X,Y,M,S,D b,T,C Section 7.5

AND AND Serial connection of NO (normally open) contacts X,Y,M,S,D b,T,C Section 7.3

ANI AND Inverse Serial connection of NC (normally closed) contacts X,Y,M,S,D b,T,C Section 7.3

ANDP AND Pulse Serial connection of rising edge pulse X,Y,M,S,D b,T,C Section 7.5

ANDF AND Falling Pulse Serial connection of falling/trailing edge pulse X,Y,M,S,D b,T,C Section 7.5

OR OR Parallel connection of NO (normally open) contacts X,Y,M,S,D b,T,C Section 7.4

ORI OR Inverse Parallel connection of NC (normally closed) contacts X,Y,M,S,D b,T,C Section 7.4

ORP OR Pulse Parallel connection of rising edge pulse X,Y,M,S,D b,T,C Section 7.5

ORF OR Falling Pulse Parallel connection of falling/

trailing edge pulse X,Y,M,S,D b,T,C Section 7.5

Trang 2

FX3S/FX3G/FX3GC/FX3U/FX3UC Series

Programming Manual - Basic & Applied Instruction Edition

7 Basic Instruction

Connection Instruction

ANB AND Block Serial connection of multiple

parallel circuits − Section 7.7

ORB OR Block Parallel connection of multiple contact circuits − Section 7.6

MPS Memory Point Store Stores the current result of the internal PLC operations

− Section 7.10

MEP MEP

Conversion of operation result

to leading edge pulse

− Section 7.11

MEF MEF

Conversion of operation result

to trailing edge pulse

− Section 7.11 Out Instruction

OUT OUT Final logical operation type coil drive Y,M,S,D b,T,C Section 7.2

RST Reset Reset bit device OFF Y,M,S,D b,T,C,D,R,V,Z Section 7.13

PLF Pulse Falling Falling/trailing edge pulse Y,M Section 7.12 Master Control Instruction

MC Master Control Denotes the start of a master control block Y,M Section 7.9 MCR Master Control Reset Denotes the end of a master control block − Section 7.9 Other Instruction

MPSMRD

Applicable devices

MC N

MCR N

Trang 3

LD and LDI instructions are contacts connected to bus lines.

When combined with ANB instruction described later, LD and LDI instructions can be used for the start of branches

1 Instruction format

→ For the number of instruction steps, refer to Section 7.16.

2 Applicable devices

S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z)

S2: State relays (S) cannot be indexed with index registers (V and Z)

Explanation of function and operation

1 LD instruction (initial logical operation, NO contact type)

Instruc-tion

System User Digit Specification System User Special Unit Index Con-stant NumberReal ter StringCharac- Pointer

LDI

LoadInverse

Basic Instruction

LDI

Continuous Operation Pulse (Single) Operation Mnemonic Operation Condition

X000

ONON

Y000

Timing chart

Bus line

Trang 4

Devices used in LD and LDI instructions allow indexing with index registers (V and Z).

(State relays (S), special auxiliary relays (M), 32-bit counters (C), and "D b" cannot be indexed.)

V0 to V7 and Z0 to Z7 are available in indexing.When used devices are inputs (X) and outputs(Y), values of index registers (V and Z) areconverted into octal numbers, and then added.Example: When the value of V0 is 10, LD contact

is set to ON (becomes conductive) orOFF (becomes non-conductive) byX012

4 Bit specification of data register (D)

A bit in data register (D) can be specified as a device used in LD and LDI instructions

When specifying a bit in data register, input "."after a data register (D) number, and then input abit number (0 to F) consecutively

Only 16-bit data registers are available

Specify a bit number as "0, 1, 2, 9, A, B, F"from the least significant bit

Example: In the example shown on the left, LD

contact is set to ON (becomesconductive) or OFF (becomes non-conductive) by bit 3 of D0

ONON

0003 D0.3Y000

Trang 5

S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z).

S2: State relays (S) cannot be indexed with index registers (V and Z)

Explanation of function and operation

1 When a bit device is used

A device described in OUT instruction turns ON or OFF according to the driven contact status

Parallel OUT instructions can be used consecutively as many times as necessary

In the program example shown below, OUT M100 and OUT M101 are parallel

If two or more OUT instructions are executed for the same device number, however, it results in a double output

(double coil) operation

Instruc-tion

System User Digit Specification System User Special Unit Index Con-stant NumberReal ter StringCharac- Pointer

X Y M T C S D b KnX KnY KnM KnS T C D R U \G V Z Modify K H E " " P OUT S1 S1

S

Set value

Program step numbers areautomatically controlled

LD

OUT

LDI

OUT OUT

00000001000200030004

X000Y000X001M100M101

X000

Y000X001

M100

M101

OUT instruction

OUT instructionOUT instructionDrive contact of

OUT instruction

Trang 6

FX3S/FX3G/FX3GC/FX3U/FX3UC Series

Programming Manual - Basic & Applied Instruction Edition

7 Basic Instruction

7.2 OUT

2 When a timer or counter is used

The set value is required after OUT instruction for the counting coil of a timer or counter

The set value can be specified directly by a decimal number (K) or indirectly using a data register (D) or extensionregister (R)

1) Direct specification

The set value of a timer or counter can bespecified directly by a decimal number (K)

2) Indirect specification

The set value of a timer or counter can be set

by a data register (D) or extension dataregister (R) At this time, the current value ofthe data register (D) or extension register (R)

is regarded as the set value of the timer orcounter

It is necessary to write the set value to a dataregister (D) or extension register (R) used forthe set value by MOV instruction, DSWinstruction or display unit before driving thetimer or counter

3) Setting range of timers and counters

The table below shows the set value range of timers and counters, the actual timer constants and the number ofprogram steps (including the set value) for OUT instruction

Timer/counter (Value of K or current value of D or R) Setting range Actual set value Number of steps

ONON

Timing chart

OUT instruction

OUT instruction

ONON

X000

ONY000

ONX001

ONM100

ONM101

T0K30

X000T0K30X001T1K30C0K50

X000

X001

T11

C10D20

T10D10

X000T10D10X001T11R15C10D20

Trang 7

Devices used in OUT instruction can be indexed with index registers (V and Z).

(State relays (S), special auxiliary relays (M), 32-bit counters (C), and "D b" cannot be indexed.)

The index registers V0 to V7 and Z0 to Z7 areavailable for indexing

When a used device is an input (X) or output (Y),the value of an index register (V or Z) isconverted into an octal number, and then added

Example: When the value of Z0 is "20", Y024

turns ON or OFF

4 Bit specification of data register (D) *1

A bit in data register (D) can be specified as a device used in OUT instruction

When specifying a bit in data register, input "."

after a data register (D) number, and then input abit number (0 to F) consecutively

Only 16-bit data registers are available

Specify a bit number as "0, 1, 2, 9, A, B, F"

from the least significant bit

Example: In the example shown on the left, the

bit 3 of D0 turns ON or OFF when X000turns ON or OFF

Caution

• When a special internal relay (M), timer or counter is used, program steps increase as described in "Setting range

of timers and counters" on the previous page

• Do not use the last bit number of a data register (D) or extension register (R) as the set value of a 32-bit counter

Errors

• When an I/O number used in OUT instruction does not exist due to indexing, M8316 (Non-existing I/O specification

error) turns ON

• When the device number of a device (M, T or C) other than I/O used in OUT instruction does not exist due to

indexing, an operation error (error code: 6706) occurs

Trang 8

AND and ANI instructions connect one contact in series.

The number of contacts connected in series is not limited, so AND and ANI instructions can be used consecutively asmany times as necessary

Output to another coil by way of a contact after the OUT instruction is called cascade output

Such a cascade output can be repeated as many times as necessary as long as the order is correct

1 Instruction format

→ For the number of instruction steps, refer to Section 7.16.

2 Applicable devices

S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z)

S2: State relays (S) cannot be indexed with index registers (V and Z)

Explanation of function and operation

1 AND instruction (serial connection of NO (normally open) contacts)

Instruc-tion

System User Digit Specification System User Special

Unit Index

stant

Con-Real Number

ter String Pointer

Charac-X Y M T C S D b KnCharac-X KnY KnM KnS T C D R U \G V Z Modify K H E " " P AND S1 S1

X002

Y003AND instruction

LD

AND

OUT

000000010002

X002X000Y003

Contact connected

in seriesX000

Timing chart

Trang 9

Devices used in AND and ANI instruction can be indexed with index registers (V and Z).

(State relays (S), special auxiliary relays (M), 32-bit counters (C), and "D b" cannot be indexed.)

The index registers V0 to V7 and Z0 to Z7 areavailable for indexing

When a used device is an input (X) or output (Y),the value of an index register (V, Z) is convertedinto an octal number, and then added

Example: When the value of V0 is "10", AND

contact is set to ON or OFF by X012

4 Bit specification of data register (D) *1

A bit in data register (D) can be specified as a device used in AND and ANI instructions

When specifying a bit in data register, input "."

after a data register (D) number, and then input abit number (0 to F) consecutively

Only 16-bit data registers are available

Specify a bit number as "0, 1, 2, 9, A, B, F"

from the least significant bit

Example: In the example shown on the left, AND

contact turns ON (becomesconductive) when the bit 3 of D0 turnsON

Errors

• When an I/O number used in AND or ANI instruction does not exist due to indexing, M8316 (Non-existing I/O

specification error) turns ON

• When the device number of a device (M, T or C) other than I/O used in AND or ANI instruction does not exist due to

indexing, an operation error (error code: 6706) occurs

X002

Y003ANI instruction

ANI

OUT

000000010002

X002X000Y003

X002

ONY003

ONON

X002X000V0Y003X002

X002D0.3Y003X002

Trang 10

OUT

AND

OUT(SP)LD

ANI

OUT

00000001000200030004000500060007001000110012

X000X001Y003X002X003Y004X004T0K30X005T0Y005

Contact connected

in seriesX001

X004AND instruction

Contact connected

in seriesContact connected

in series

Trang 11

OR and ORI instructions are used to connect one contact in parallel.

If two or more contacts are connected in series, use ORB instruction described later to connect such a serial circuit

block to another circuit in parallel

A step containing OR or ORI instruction is connected in parallel to a preceding step containing LD or LDI instruction

There is no limitation in the number of times of parallel connection

1 Instruction format

→ For the number of instruction steps, refer to Section 7.16.

2 Applicable devices

S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z)

S2: State relays (S) cannot be indexed with index registers (V and Z)

Explanation of function and operation

1 OR instruction (parallel connection of NO (normally open) contacts)

Instruc-tion

System User Digit Specification System User Special

Unit Index

stant

Con-Real Number

ter String Pointer

Timing chart

OR instruction

LD instruction X000

Y000X001

LD

OR

OUT

000000010002

X000X001Y000Y000

X001X000

ON

ONON

Trang 12

FX3S/FX3G/FX3GC/FX3U/FX3UC Series

Programming Manual - Basic & Applied Instruction Edition

7 Basic Instruction

7.4 OR, ORI

2 ORI instruction (parallel connection of NC (normally closed) contacts)

3 Relationship with ANB instruction

The parallel connection by OR or ORI instruction

is connected to the preceding LD or LDIinstruction in principle After ANB instruction,however, the parallel connection by OR or ORIinstruction is connected to the second preceding

LD or LDI instruction

4 Indexing *1

Devices used in OR and ORI instruction can be indexed with index registers (V and Z)

(State relays (S), special auxiliary relays (M), 32-bit counters, and "D b" cannot be indexed.)

The index registers V0 to V7 and Z0 to Z7 areavailable for indexing

When the used device is an input (X) or output(Y), the value of an index register (V or Z) isconverted into an octal number, and then added.Example: When the value of V0 is "10", OR

contact is set to ON (becomesconductive) or OFF (becomes non-conductive) by X013

Timing chart

ORI instruction

LD instruction X000

Y001X002

LD

ORI

OUT

000000010002

X000X002Y001Y001

X002X000

ONON

ONON

OROROR

OR

Before ANBinstruction

After ANB instruction

LD

OR

OUT

000000010004

X000X001V0Y000Y000

X001V0X000

Trang 13

5 Bit specification of data register (D) *1

A bit in data register (D) can be specified as a device used in OR and ORI instructions

When specifying a bit in data register, input "."

after a data register (D) number, and then input abit number (0 to F) consecutively

Only 16-bit data registers are available

Specify a bit number as "0, 1, 2, 9, A, B, F"

from the least significant bit

Example: In the example shown on the left, OR

contact is set to ON (becomesconductive) or OFF (becomes non-conductive) by bit 3 of D0

Errors

• When an I/O number used in OR or ORI instruction does not exist due to indexing, M8316 (Non-existing I/O

specification error) turns ON

• When the device number of a device (M, T or C) other than I/O used in OR or ORI instruction does not exist due to

indexing, an operation error (error code: 6706) occurs

LD

OR

OUT

000000010004

X000D0.3Y000Y000

D0.3X000

Trang 14

FX3S/FX3G/FX3GC/FX3U/FX3UC Series

Programming Manual - Basic & Applied Instruction Edition

7 Basic Instruction

7.5 LDP, LDF, ANDP, ANDF, ORP, ORF

7.5 LDP, LDF, ANDP, ANDF, ORP, ORF

Outline

LDP, ANDP, and ORP instructions for contacts detect the rising edge, and become active during one operation cycleonly at the rising edge of a specified bit device (that is, when the bit device turns from OFF to ON)

Contact instructions LDF, ANDF and ORF detect the falling edge, and become active during one operation cycle only

at the falling edge of a specified bit device (that is, when the bit device turns from ON to OFF)

System User Digit Specification System User Special

Unit Index

stant

Con-Real Number

ter String Pointer

Trang 15

Explanation of function and operation

1 LDP, ANDP, and ORP instructions (initial logical operation of rising edge pulse, serial

connection of rising edge pulse, and parallel connection of rising edge pulse)

In the example shown above, M0 or M1 is ON during only one operation cycle when X000 to X002 turn from OFF to

Timing chart

ORP instruction

LDP instruction X000

M0X001

ON

ON during one operation cycle

ORP instructionLDP instruction

ANDP instruction

Trang 16

FX3S/FX3G/FX3GC/FX3U/FX3UC Series

Programming Manual - Basic & Applied Instruction Edition

7 Basic Instruction

7.5 LDP, LDF, ANDP, ANDF, ORP, ORF

2 LDF, ANDF, and ORF instructions (initial logical operation of falling/trailing edge pulse, serial connection of falling/trailing edge pulse, and parallel connection of falling/trailing edge pulse)

In the example shown above, M0 or M1 is ON during only one operation cycle when X000 to X002 turn OFF from ON

3 Bit specification of a data register (D) *1

A bit in data register (D) can be specified as a device used in LDP, LDF, ANDP, ANDF, ORP and ORF instructions

When specifying a bit in a data register, input "."after a data register (D) number, and then input abit number (0 to F) consecutively

Only 16-bit data registers are available

Specify a bit number as "0, 1, 2, 9, A, B, F"from the least significant bit

Example: In the example shown on the left, LDP

contact turns ON (becomes conductive) or OFF (becomes non-conductive) when bit 3 of D0 turns ON

ORF instruction

LDF instruction X000

M0X001

ON

ON during one opera- tion cycle

LDF instruction

ORF instructionANDF instruction

0003 D0.3Y000

Trang 17

4 Output drive side

The following two circuits offer the same operation:

In each circuit, M6 is ON during only one operation cycle when X010 turns from OFF to ON

In each circuit, MOV instruction is executed only once when X020 turns from OFF to ON

X010

M 6

Operationcycle

Trang 18

FX3S/FX3G/FX3GC/FX3U/FX3UC Series

Programming Manual - Basic & Applied Instruction Edition

7 Basic Instruction

7.5 LDP, LDF, ANDP, ANDF, ORP, ORF

5 Differences in the operation caused by auxiliary relay (M) numbers

When an auxiliary relay (M) is specified as a device in LDP, LDF, ANDP, ANDF, ORP and ORF instructions, theoperation varies depending on the device number range as shown in the figure below

<M0 to M2799, M3072 to M7679>

After M0 is driven by X000, all contacts [1] to [4] corresponding toM0 are activated

•The contacts [1] to [3] detect the rising edge of M0

•Because of LD instruction, the contact [4] is conductive while M0 is ON

By utilizing these characteristics, "transition of state by same signal"

in a step ladder circuit can be efficiently programmed

M0[1]

M0

M51

X000

M0SET[2]

M0[4]

M0

M52SET

[3]

M50SET

M0SET

M2800

M2800

M3SET

M2SET

M2800

M2800

M5SET

M4SET

M2800

M2800

M6SET

Block A

M7M2800

Block C

Trang 19

1 Cautions when the LDP, LDF, ANDP, ANDF, ORP, or ORF instruction programmed in the same

step is executed two or more times within one operation cycle

When LDP, LDF, ANDP, ANDF, ORP or ORF instruction programmed in the same step is executed two or more times

within one operation cycle, the following operation results:

Programs executed two or more times

• Program between FOR and NEXT instructions

• Program which executes the same subroutine program from two or more

CALL instructions during one operation cycle

• Program which jumps to a label (P) in a smaller step number by CJ

instruction

Operation

1) When a device turns from OFF to ON

1st time: LDP, ANDP or ORP instruction turns ON

2nd time and later: When the device status is the same as the time when the instruction was executed last, theinstruction turns OFF

2) When a device turns OFF from ON

1st time: LDF, ANDF or ORF instruction turns ON

2nd time and later: When the device status is the same as the time when the instruction was executed last, theinstruction turns OFF

2 Cautions on writing during RUN

1) Instructions for falling edge pulse

When writing is completed during RUN for a circuit including an instruction for falling edge pulse (LDF, ANDF, orORF instruction), the instruction for falling edge pulse is not executed regardless of the ON/OFF status of thetarget device of the instruction for falling edge pulse

When writing is completed during RUN for a circuit including an instruction for falling edge pulse (PLF instruction),the instruction for falling edge pulse is not executed regardless of the ON/OFF status of the operation conditiondevice

It is necessary to set to ON the target device or operation condition device once and then set it to OFF forexecuting the instruction for falling edge pulse

2) Instructions for rising edge pulse

When writing is completed during RUN for a circuit including an instruction for rising edge pulse, the instruction forrising edge pulse is executed if a target device of the instruction for rising edge pulse or the operation conditiondevice is ON

Target instructions for rising edge pulse: LDP, ANDP, ORP, and pulse operation type applied instructions (such

as MOVP)

Contact ON/OFF status (while writing is executed during RUN) Instruction for rising edge pulse Instruction for falling edge pulse

X000

FNC 08

FNC 09NEXT

Ngày đăng: 31/01/2021, 22:49

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w