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

The text of a manual · part 6 of 11

MELSEC FX Family Programmable Logic Controllers Beginners Manual, pages 51 to 60

Pages 51 to 60 of 106

The original document is the PDF (969 KB). 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 Mitsubishi FX2NC-32MT

Page 51

An Introduction to Programming

Programming PLC Applications

쎲 Alarm activation delay Ladder Diagram

Instruction List K100 T1

M1 18

18 19 22 23

K300 T2

T1 22

LD OUT LD OUT

M1 T1 T1 T2

K100 K300

When an alarm is triggered (M1 switches to “1”) the 10s delay timer starts. After the 10 seconds T1 then starts timer T2, which is set to 30 seconds, and the siren activation time begins. 쎲 Alarm display (switch on siren and rotating beacon) Ladder Diagram T1

Instruction List

T2

26 27 28 29 30

Y001

26 T1

Y002

29

LD ANI OUT LD OUT

T1 T2 Y001 T1 Y002

The siren is activated after the 10s activation delay (T1) and remains on while timer T2 is running. After the end of the 30s activation period (T2) the siren deactivates. The rotating beacon is also switched on after the 10s delay. The following illustration shows the signal sequence generated by this section of the program: 1

M1 0 1

10 s

T1 0 1

30 s

T2 0 ON

Y1

OFF ON

Y2

OFF t

FX Beginners Manual

3 – 25

Page 52

Programming PLC Applications

An Introduction to Programming

쎲 Resetting all outputs and the relay Ladder Diagram

Instruction List

X001 31

RST

Y000

RST

Y001

RST

Y002

RST

Y003

RST

Y004

RST

Y005

RST

M1

31 32 33 34 35 36 37 38

LDI RST RST RST RST RST RST RST

X001 Y000 Y001 Y002 Y003 Y004 Y005 M1

When the alarm system is switched off with the key-operated switch all the outputs used by the program and the relay M1 are all reset. If an alarm was triggered the interrupted alarm circuit which was released until the system was switched off is displayed.

3 – 26

MITSUBISHI ELECTRIC

Page 53

An Introduction to Programming

Programming PLC Applications

Connection of the PLC The sketch below shows how easy it is to implement this alarm system with a PLC of the FX family. The example shows an FX1N-14MR. S1

S11

S21

S31

S12

S22

S32

S/S 0 V N PE L1

S/S

100-240 VAC

L

N

X1 X0

X3 X2

X5

X7

X4

X6

0 1 2 3 4 5 6 7

MITSUBISHI

IN

POWER RUN ERROR

FX1S-14MR OUT

0 1 2 3 4 5 0V 24V

H0

FX Beginners Manual

E1

Y0 COM0

Y1 COM1

Y2 COM2

H1

Y4 Y3

Y5

14MR -ES/UL

H2

H3

H4

3 – 27

Page 54

Programming PLC Applications

3.6.2

An Introduction to Programming

A rolling shutter gate Task description We want to implement a control system for a warehouse’s rolling shutter gate that will enable easy operation from both outside and inside. Safety facilities must also be integrated in the system.

Warning lamp H1

S7

S3

S1

S5

STOP S6 S0

S2

S4

쎲 Operation – It must be possible to open the gate from outside with the key-operated switch S1 and to close it with pushbutton S5. Inside the hall it should be possible to open the gate with pushbutton S2 and to close it with S4. – An additional time switch must close the gate automatically if it is open for longer than 20 s. – The states “gate in motion” and “gate in undefined position” must be indicated by a blinking warning lamp. 쎲 Safety facilities

3 – 28

–

A Stop button (S0) must be installed that can halt the motion of the gate immediately at any time, stopping the gate in its current position. This Stop switch is not an Emergency OFF function, however! The switch signal is only processed by the PLC and does not switch any external power connections.

–

A photoelectric barrier (S7) must be installed to identify obstacles in the gateway. If it registers an obstacle while the gate is closing the gate must open automatically.

–

Two limit switches must be installed to stop the gate motor when the gate reaches the fully open (S3) and fully closed (S6) positions.

MITSUBISHI ELECTRIC

Page 55

An Introduction to Programming

Programming PLC Applications

Assignment of the input and output signals The task description clearly defines the number of inputs and outputs needed. The gate drive motor is controlled with two outputs. The signals required are assigned to the PLC inputs and outputs as follows: Function

Inputs

Outputs

Timer

Name

Adress

Remarks Break contact (when the switch is operated X0 = “0” and the gate stops)

STOP button

S0

X0

OPEN key-operated switch (outside)

S1

X1

OPEN button (inside)

S2

X2

Upper limit switch (gate open)

S3

X3

CLOSE button (inside)

S4

X4

CLOSE button (outside)

S5

X5

Lower limit switch (gate closed)

S6

X6

Break contact (X6 = “0” when the gate is down and S6 is activated)

Photoelectric barrier

S7

X7

X7 is set to “1” when an obstacle is registered

Warning lamp

H1

Y0, Motor contactor (motor reverse)

K1

Y1

Reverse = OPEN gate

Motor contactor (motor forward)

K2

Y2

Forward = CLOSE gate

Delay for automatic close, T0

Time: 20 seconds

Make contacts Break contact (X2 =”0” when the gate is up and S3 is activated) Make contacts

The program components 쎲 Operation of the rolling shutter gate with the pushbuttons The program must convert the input signals for the operation of the gate into two commands for the drive motor: “Open Gate” and “Close Gate”. Since these are signals from pushbuttons that are only available briefly at the inputs they need to be stored. To do this we use two relays to represent the inputs in the program and set and reset them as required: –

M1: open gate

–

M2: close gate

Ladder Diagram

Instruction List

X001 0

PLS

M100

SET

M1

PLS

M200

SET

M2

X002

M100

M2

4 X004 7 X005

M200 11

0 1 2 4 5 6 7 8 9 11 12 13

LD OR PLS LD ANI SET LD OR PLS LD ANI SET

X001 X002 M100 M100 M2 M1 X004 X005 M200 M200 M1 M2

M1

The signals for opening the gate are processed first: When key-operated switch S1 or button S2 are operated a signal is generated and M001 is set to a signal state of “1” for just one pro-

FX Beginners Manual

3 – 29

Page 56

Programming PLC Applications

An Introduction to Programming gram cycle. This ensures that the gate cannot be blocked if the button sticks or of the operator does not release it. It must be ensured that the drive can only be switched on when it is not already turning in the opposite direction. This is implemented by programming the PLC so that M1 can only be set when M2 is not set. NOTE

The motor direction interlock must also be complemented by an additional interlock with physical contactors outside the PLC (see wiring diagram). A similar approach is used to process the signals from buttons S4 and S5 for closing the gate. Here, M1 is polled for a signal state of “0” to ensure that M1 and M2 cannot both be set at the same time. 쎲 Close gate automatically after 20 seconds Ladder Diagram

Instruction List

X003

K200 T0

14 T0 18

SET

M2

14 15 18 19

LDI OUT LD SET

X003 T0 T0 M2

K200

When the gate is open limit switch S3 activates and input X3 is switched off. (For safety reasons S3 is a break contact.) When this happens timer T0 starts the 20s delay (K200 = 200 x 0.1s = 20s). When the timer reaches 20s relay M2 is set and the gate is closed. 쎲 Stop gate with STOP switch Ladder Diagram

Instruction List

X000 20

RST

M1

RST

M2

20 LDI 21 RST 22 RST

X000 M1 M2

Pressing the STOP button (S0) resets relays M1 and M2, stopping the gate motor. 쎲 Identifying obstacles with the photoelectric barrier Ladder Diagram X007 23

Instruction List

M2 RST

M2

SET

M1

23 24 25 26

LD AND RST SET

X007 M2 M2 M1

If an obstacle is registered by the photoelectric barrier while the gate is closing relay M2 is reset and the close operation is halted. After this relay M1 is set, opening the gate again.

3 – 30

MITSUBISHI ELECTRIC

Page 57

An Introduction to Programming

Programming PLC Applications

쎲 Switching the motor of with the limit switches Ladder Diagram

Instruction List

X003 27

RST

M1

RST

M2

X006 29

27 28 29 30

LDI RST LDI RST

X003 M1 X006 M2

When the gate is open limit switch S3 is activated and input X3 is switched off. This resets relay M1, turning off the motor. When the gate is fully closed S6 is activated, X6 is switched off and M2 is reset, turning off the motor. For safety reasons the limit switches are break contacts. This ensures that the motor is also switched off automatically (or cannot be switched on) if the connection between the switch and the input is interrupted. NOTE

The limit switches must be wired so that they also switch off the motor automatically without support from the PLC (see wiring diagram). 쎲 Controlling the motor Ladder Diagram

Instruction List

M1 31

Y001 M2

33

Y002

31 32 33 34

LD OUT LD OUT

M1 Y001 M2 Y002

At the end of the program the signal states of relays M1 and M2 are transferred to outputs Y001 and Y002. 쎲 Warning lamp: “Gate in Motion” and “Gate in Undefined Position” Ladder Diagram

Instruction List

X003 X006 M8013 35

Y000

35 36 37 38

LD AND AND OUT

X003 X006 M8013 Y000

If neither of the limit switches is activated this means that the gate is being opened or closed or has been stopped in an intermediate position. In all these situations the warning lamp blinks. The blink speed is controlled with special relay M8013, which is automatically set and reset at 1s intervals (see Chapter 4.2).

FX Beginners Manual

3 – 31

Page 58

Programming PLC Applications

An Introduction to Programming

Connection of the PLC

24 V

S1

S0

S2

S3

S4

S5

S6

Photoelectric barrier

Lower limit switch

Close gate (outside)

Close gate (inside)

Upper limit switch

Open gate (inside)

STOP

Open gate (outside)

The rolling shutter gate control system can be implemented with a controller like the FX1N-14MR.

S7

L1 N PE S/S 0 V

S/S

100-240 VAC

L

N

X1

X3

X0

X5

X2

X4

X7 X6

0 1 2 3 4 5 6 7

MITSUBISHI

IN

POWER RUN ERROR

FX1S-14MR OUT

0 1 2 3 4 5 0V 24V

Y0 COM0

Y1 COM1

Y2 COM2

Y4 Y3

Y5

14MR -ES/UL

Interlock by contactor

3 – 32

S3

S6

K1

K2

Deactivation by limit switches

Close gate

K1

Open gate

Warning lamp

H1

K2

MITSUBISHI ELECTRIC

Page 59

Devices in Detail

4

Inputs and Outputs

Devices in Detail The devices in PLCs are used directly in control program instructions. Their signal states can be both read and changed by the PLC program. A device reference has two parts: – the device name and

– the device address.

Example of a device reference (e.g. input 0):

X0 Device name

4.1

Device address

Inputs and Outputs The PLC’s inputs and outputs connect it to the process that it is controlling. When an input is polled by the PLC program the voltage on the input terminal of the controller is measured. Since these inputs are digital they can only have two signal states, ON or OFF. When the voltage at the input terminal reaches 24V the input is on (state “1”). If the voltage is lower than 24V the input evaluates as off (signal state “0”). In MELSEC PLCs the identifier “X” is used for inputs. The same input can be polled as often as necessary in the same program.

NOTE

The PLC cannot change the state of inputs. For example, it is not possible to execute an OUT instruction on an input device. If an output instruction is executed on an output the result of the current operation (the signal state) is applied to the output terminal of the PLC. If it is a relay output the relay closes (all relays have make contacts). If it is a transistor output the transistor makes the connection and activates the connected circuit. The illustration on the left shows an example of how you can connect switches to the inputs and lamps and contactors to the outputs of a MELSEC PLC. X000 X001 X002

Y000 Y001 Y002

The identifier for output devices is “Y”. Outputs can be used in logic operation instructions as well as with output instructions. However, it is important to remember that you can never use an output instruction on the same output more than once (see also chapter 3.4.2).

FX Beginners Manual

4–1

Page 60

Inputs and Outputs

Devices in Detail

The following table provides a general overview of the inputs and outputs of the controllers of the MELSEC FX family. Device

Inputs

Outputs

Device identifier

X

Y

Device type

Bit device

Possible values

0 or 1

Device address format

Octal

Number of devices and addresses (depends on controller base unit type)

FX1S

6 (X00–X05) 8 (X00–X07) 12 (X00–X07, X10, X11, X12, X13) 16 (X00–X07, X10–X17)

4 (Y00–Y03) 6 (Y00–Y05) 8 (Y00–Y07) 14 (Y00–Y07, Y10–Y15)

FX1N

8 (X00–X07) 14 (X00–X07, X10–X15) 24 (X00–X07, X10–X17, X20–X27) 36 (X00–X07, X10–X17, X20–X27, X30–X37, X40, X41, X42, X43) The total number of inputs can be increased to max. 84 (X123) with expansion modules. However, the sum of all inputs and outputs cannot exceed 128.

6 (Y00–Y05) 10 (Y00–Y07, Y10, Y11) 16 (Y00–Y07, Y10–Y17) 24 (Y00–Y07, Y10–Y17, Y20–Y27) The total number of outputs can be increased to max. 64 (Y77) with expansion modules. However, the sum of all inputs and outputs cannot exceed 128.

FX2N

8 (X00–X07) 16 (X00–X07, X10–X17) 24 (X00–X07, X10–X17, X20–X27) 32 (X00–X07, X10–X17, X20–X27, X30–X37) 40 (X00–X07, X10–X17, X20–X27, X30–X37, X40–X47) 64 (X00–X07, X10–X17, X20–X27, X30–X37, X40–X47, X50–X57, X60–X67, X70–X77)

8 (Y00–Y07) 16 (Y00–Y07, Y10–Y17) 24 (Y00–Y07, Y10–Y17, Y20–Y27) 32 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37) 40 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37, Y40–Y47) 64 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37, Y40–Y47, Y50–Y57, Y60–Y67, Y70–Y77)

FX2NC

8 (X00–X07) 16 (X00–X07, X10–X17) 32 (X00–X07, X10–X17, X20–X27, X30–X37) 48 (X00–X07, X10–X17, X20–X27, X30–X37, X40–X47, X50–X57)

8 (Y00–Y07) 16 (Y00–Y07, Y10–Y17) 32 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37) 48 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37, Y40–Y47, X50–X57)

FX3U

8 (X00–X07) 16 (X00–X07, X10–X17) 24 (X00–X07, X10–X17, X20–X27) 32 (X00–X07, X10–X17, X20–X27, X30–X37) 40 (X00–X07, X10–X17, X20–X27, X30–X37, X40–X47)

8 (Y00–Y07) 16 (Y00–Y07, Y10–Y17) 24 (Y00–Y07, Y10–Y17, Y20–Y27) 32 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37) 40 (Y00–Y07, Y10–Y17, Y20–Y27, Y30–Y37, Y40–Y47)

* The total number of inputs can be increased to max. 248 (X367) with expansion modules. However, the sum of all inputs and outputs cannot exceed 256.

4–2

MITSUBISHI ELECTRIC