programmable controller melsec-a - mitsubishi plc a plc,series...programmable controller melsec-a...

16
PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC MITSUBISHI

Upload: others

Post on 28-Mar-2021

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

PROGRAMMABLE CONTROLLER

MELSEC-ASFM Training Manual

A-SERIES Special Function Module

MITSUBISHIMEAU 980615-B ELECTRIC

MITSUBISHI

Page 2: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

Revisions

* The manual number is noted at the lower left corner of the front cover.

Print Date *Manual Number Revision

06/26/98 MEAU-980615-A Original Version, chapter 1 only.09/24/98 MEAU-980615-B Ladder example, page3, line2 was wrong, was TO H0 K80 D100 K1, correct

Is TO H0 K0 D100 K2

Disclaimer : This manual does not imply guarantee or implementation right for industrial ownership orimplementation of other rights. Mitsubishi Electric Corporation is not responsible for industrial ownership problemscaused by use of the contents of this manual.

1998 Mitsubishi Electric Corporation

Page 3: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

Introduction

Thank you for purchasing the Mitsubishi Programmable Controller Special Function Module,MELSEC-A Series SFM. Before using the equipment, please read this manual carefully todevelop full familiarity with the functions and performance of the special function module youhave purchased, so as to ensure correct use.

Table of Contents

1. EtherNet Module AJ71E71-S3, A1SJ71E71-B2-S3, A1SJ71E71-B5-S31.1 System Configuration

1.1.1 Hardware Requirements ………………………………………………. 11.1.2 System Connection ……………………………………………………. 11.1.3 PLC Ethernet Module Installation …………………………………….. 21.1.4 Module Switches Settings …………………………………………….. 2

1.2 Ethernet Ladder Logic1.2.1 PLC Ladder Sample ……………………………………………………. 3

1.3 Windows95 Network Setup1.3.1 PC Ethernet Card Installation …………………………………………. 41.3.2 PC Network IP Address Setup …………………………………………4

1.4 Network Confirmation1.4.1 PC Network Confirmation ……………………………………………… 51.4.2 PLC Network Confirmation ……………………………………………. 6

1.5 MelDDE Software1.5.1 Software Installation ……………………………………………………. 71.5.2 Create MelDDE Configuration File …………………………………… 8

1.6 Accessing PLC Data Through DDE1.6.1 Reading Data with Microsoft Excel ………………………………..…. 91.6.2 Writing Data with Microsoft Excel ………………………………..…… 111.6.3 Reading Data with Microsoft Visual Basic ………………………..…. 121.6.4 Writing Data with Microsoft Visual Basic ……………………..…..…. 13

Page 4: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.1 SYSTEM CONFIGURATION

MEAU 980615-B 1

1.1 SYSTEM CONFIGURATION

1.1.1 Hardware Requirements

To connect A-Series PLC to a personal computer the following hardware is required.

! A Personal Computer with Windows95 or NT.

" A Personal ComputerEthernet interface for 10base2.

# The A1SJ71E71, or AJ71E71 PLC Ethernet module.

$ 2-BNC T-Adapters % 2-Terminators, 50 ohm & RG59 U/A Coax Cable with BNC connectors

1.1.2 System Connection

There are 3 levels of networks in most factory settings, SUPERVISORY (Ethernet),CONTROL (Net10), and DEVICE (DeviceNet). Ethernet connects a supervisory PCto the master PLC controller. The master PLC controller is tied to slave PLCcontrollers by Net10, or some other control level network. Then finally bus friendlydevices are tied to the slave controllers by a device level network.This chapter only describes the PC Master PLC to PC connection.

ETHERNET

MELSEC NET10

SLAVE 3 SLAVE 1SLAVE 2

MASTER PLC

LOCAL DEVICE NETLOCAL DEVICE NET

LOCAL DEVICE NET

REMOTE NODE

Page 5: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.1 SYSTEM CONFIGURATION

MEAU 980615-B 2

1.1.3 PLC Ethernet Module Installation

This example assumes that the EtherNet module will be placed into SLOT 0, if this isnot the case, the X and Y addresses in the ladder example will need to be changedaccordingly.

'''' Install the Ethernet module into SLOT 0, then connect the PC to PLC cable.

1.1.4 Module Switch Settings

The A1SJ71E71 module has 4 dip switches,and the AJ71E71 has 8 dip switches,they both have a rotary switch on the front.

'''' Confirm that the module switches are set correctly.

Rotary Switch Setting Name Setting Description

0 On-Line Connect with remote node, normal operation1 Off-Line Disconnect with remote node, Ethernet stop2 Test 1 Self Diagnostic test, self wrap test3 Test 2 Self Diagnostic test, RAM test4 Test 3 Self Diagnostic test, ROM test

AJ71 A1SJ71 Setting Name Setting Description

Sw1 Sw1 Line processingduring TCP time-out

Off : Closes line when TCP time-out occursOn : Line stays open after TCP time-out

Sw2 Sw2 Data Code Setting Off : Conducts exchange in Binary codeOn : Conducts exchange in ASCII code

Sw7 Sw3 CPU Exchange Off : Forbids data exchange during PLC stopOn : Allows data exchange during PLC stop

Sw8 Sw4 Initial Timing Off : Network starts without delay.On : Network starts after 20 second delay.

DIP SWITCHES = ALL ON

ROTARY SWITCH = 0

Page 6: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.2 ETHERNET LADDER LOGIC

MEAU 980615-B 3

1.2 ETHERNET LADDER LOGIC

1.2.1 PLC Ladder Sample

The ethernet requires some ladder logic to initialize the module, check for conflictsbetween your ladder and the data registers that are used in the example. When theladder is correctly loaded and running, the AJ71E71 RUN led is on steady and theRDY led will flash.

'''' Add the following logic to your ladder program.

SET PLC IP ADDRESS to 200.0.0.2

H K KTO 0 0 D100 2

HDMOV C8000002 D100

M9038

ONESHOT

KMOV 15 D102

KMOV 5 D103

KMOV 5 D104

KMOV 10 D105

KMOV 16 D106

KMOV 30 D107

H K KTO 0 10 D102 6

SET Y19

SEND IP ADDRESS TO PLC

SET TCP TIME-OUT TIMER

SET TCP ZERO WINDOW

SET TCP RE-TRANSMIT TIMER

SET TCP COMPLETE TIMER

SET IP ASSEMBLY TIMER

SET RESPONSE WATCH-DOG

SEND TIMER DATA TO PLC

SET INITIALIZE NORMAL END

X1A

INIT ERROR

H K KFROM 0 80 D108 1

RST Y19

CHECK FOR INITIAL ERRORS

RESET INITIAL NORMAL END

X19

INIT END

PLS M50 IF NORMAL END = OK, PULSE M50M50

SETUP PORT

H KFMOV 8001 D110 8

H K H KTO 0 24 500 1

CONFIG= RECEIVE UNPASSIVE

H K KTO 0 16 D110 8 SEND PORT CONFIG TO PLC

SET PORT 1 = H500

X19

INITDONE

Y8

SET Y8

K20 T0

T0

OPEN PORT 1

PLF M60

X10

M60

PORT CLOSE

RST Y8

CHECK FOR CLOSED PORT

TIME DELAY TO OPEN PORT

CLOSE PORT 1

Page 7: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.3 WINDOWS95 NETWORK SETUP

MEAU 980615-B 4

1.3 Windows95 NETWORK SETUP

1.3.1 PC Ethernet Card Installation

If your ethernet card is Plug-&-Play Windows95 will auto-detect the card at power-upand prompt you through the setup process. Otherwise follow the card manufacturersinstructions to get the card driver loaded.

'''' With power turned off, mount the Ethernet card in your PC. Turn ON power,then as the PC boots, Windows95 will auto-detect the new hardware and the ADDNEW HARDWARE function will be invoked. Select the type of card you have or putin the driver disk provided by the manufacturer.

When the software driver install is complete, Windows will prompt you to rebootanswer [YES]

1.3.2 PC Network IP Address Setup

'''' From the Windows95 [START] menu select [SETTINGS], [CONTROL PANEL], then double click the [NETWORK] icon. The following window should appear.

In the component box, the first linesayes Client for Microsoft Networks.This appears as the default client.

The second line shows the type ofnetwork adapter you have installed. Thisinformation was derived from the driverinstalled above in section 1.3.1.

The Third line is NetBEUI. This is aprotocol which allows networkingbetween Win95 and WinNT. If it doesnot appear in your component box, clickthe [ADD], double click [PROTOCOL],click [MICROSOFT], [NETBEUI] thenclick the [OK] button. The software mayprompt you for the Windows95installation disks.

The Fourth line is TCP/IP. This is the internet protocol and is the most commonprotocol used. If it does not appear in your component box, click the [ADD],double click [PROTOCOL], click [MICROSOFT], [TCP/IP] then click the [OK]button. The software may prompt you for the Windows95 installation disks.

The Fifth line is FILE and PRINTER SHARING. This is a service providedthrough Win95. If it does not appear, click the [ADD], double click [SERVICES],click [MICROSOFT], [FILE and PRINTER SHARING] then click the [OK] button.The software may prompt you for the Windows95 installation disks

Page 8: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.3 WINDOWS95 NETWORK SETUP

MEAU 980615-B 5

1.3.2 PC Network IP Address Setup

'''' In the component box click to highlight [TCP/IP] then click the [PROPERTIES]button. The following window should appear.

Click on [SPECIFY an IP address] thenenter the IP address [200.0.0.1] andsubnet mask address [255.255.255.0]

The other tabs on this window do notneed any changes, the default settingsshould work fine.

Click [OK]. Windows95 will prompt youto reboot the system, choose [YES].

During reboot, the Windows NetworkLogon window should appear, enteryour user name and password.

1.4 NETWORK CONFIRMATION

1.4.1 PC Network Confirmation

'''' Double click the [Network Neighborhood] icon, which should now appear onyour desktop. The window should appear with an icon labeled with thecomputers network name. If you cannot see yourself in the NetworkNeighborhood window, select [VIEW], [REFRESH] on the top menu bar.

If your computer does not appear on the network neighborhood window, there issome problem with the PC network setup. Review your steps and confirm eachprocedure above.

The PLC does not appear on the network neighborhood window, this is normal.The PLC is considered to be a network server.

Your computer nameshould appear here.

The PLC does notappear in this window.

Page 9: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.4 NETWORK CONFIRMATION

MEAU 980615-B 6

1.4.2 PLC Network Confirmation

'''' From the Windows95 [START] menu select [PROGRAMS], [MSDOS PROMPT],then a window with the MS DOS prompt will appear. At the C: prompt typePING 200.0.0.2 then press ENTER.

The PING command sends 4 packets of data out to the specified address andlooks for them to be returned. The packet has instructions for the destinationnode to return the data to the node that the command originated with.

If the communication is established and the node is responding correctly themessage “Reply from 200.0.0.2: bytes=32 time=xms TTL=15” appears.

If the communication is not established the message will be “Request timed out”In this case confirm the following items …

! Does the PC appear in the Network Neighborhood window ?If not, confirm the PC network setup.

" Is the RDY led on the PLC ethernet module blinking ?If not, confirm the PLC ladder is correct.

# When the PING command is issued, does the PC ethernet interface card LED blink?

If not, confirm the Ethernet hardware. Is the interface card good?Is the coax cable in good condition?Are terminating resistors installed on each end of the network ?

Page 10: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.5 MelDDE SOFTWARE INSTALLATION

MEAU 980615-B 7

1.5 MelDDE Software

1.5.1 Software Installation

The MelDDE software is a Dynamic Data Exchange application the will access thePLC through RS232, or Ethernet. On the disk there is 2 different folders, MelDDE16and MelDDE32, 16bit and 32bit versions.

'''' Open the [MELDDE32] file folder. Execute [SETUP.EXE], the following message appears.

'''' Click [YES] then the following message will appear.

'''' Click [YES] , the AJ1E71 is the Ethernet module. If you select NO then you will only have access through RS232. Finally the last message box appears …

'''' Click [YES], This will add MelDDE to your programs list on the START menu.

Page 11: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.5 MelDDE SOFTWARE INSTALLATION

MEAU 980615-B 8

1.5.2 Create MelDDE Configuration File

'''' Click on the [START] button, [PROGRAMS], [MelDDE], then [CfgDDE]. The configuration window will appear …

In the protocol box, click to select [E71]. In the E71 address box, set the IPaddress in hexadecimal. In this example the IP address is 200.0.0.2, convert it tohex, 200=C8 0=00, 0=00, 2=02,

'''' Set the IP address = C8000002.

The port number is determined in the PLC ladder. In this example we set PORT1equal to hex 500,

'''' Set the PORT = 500.

'''' In the top menu bar select [FILE], [SAVE AS], then name the file ENET and click [OK]

The file ENET.CFG was just created, it can be found in the WINDOWS directory.

You can create as many configuration files as you want. PLC protocol C24 is the

'''' Open a new VISUAL BASIC project. On the form make a command buttonCommand1 and a textbox Textbox1 then enter the following code …selection for the RS232 / RS422 / RS485 special function module.

Page 12: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.6 ACCESSING PLC DATA

MEAU 980615-B 9

1.6 Accessing PLC Data through DDE

1.6.1 Reading Data with Microsoft Excel

'''' Open a new EXCEL spreadsheet and enter the following DDE call …

The statement =MelDDE|enet!d0 accesses the data register D0.

=MelDDE|enet!d0

'''' After entering the formula, click the green [ ✔ ] check mark or press [ENTER]. The following window will appear …

'''' Click on [YES]. This starts the MelDDE application.The led ‘B1’ on the PLC E71 module should illuminate and the led on the PCEthernet interface card should begin to blink.

Get data from register DO

Use configuration ENET.CFG

Call MelDDE.EXE

Page 13: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.6 ACCESSING PLC DATA

MEAU 980615-B 10

1.6.1 Reading Data with Microsoft Excel

With the MelDDE software running, the data from register D0 should appear in thespreadsheet cell.

If the read data is ‘0’ add a line to your PLC ladder to move some data into registerD0 so you can confirm the DDE call is working.

During the read function the MelDDE software continuously reads until the MelDDEwindow is closed.

M1000

MOV K78 D0

Dummy

Page 14: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.6 ACCESSING PLC DATA

MEAU 980615-B 11

1.6.2 Writing Data with Microsoft Excel

'''' Open a new EXCEL spreadsheet and enter the following DDE macro …

'''' Press [CTRL A] to execute the macro. The following window will appear.

'''' Click on [YES].

This starts the MelDDE application. The led ‘B1’ on the PLC E71 module shouldilluminate and the led on the PC Ethernet interface card should begin to blink.

In this example the data ‘4’ in cell B2 will be placed into data register D0 whenthe MelDDE software runs. The data will only be written 1 time.

Use MEDOC to monitor the contents of data register D0.

Page 15: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.6 ACCESSING PLC DATA

MEAU 980615-B 12

1.6.3 Reading Data with Microsoft Visual Basic

'''' Open a new VISUAL BASIC project. On the form make a command buttonCommand1 and a textbox Textbox1 then enter the following code …

When you run the project and click on the command button, the Ethernetbecomes active and the data ‘78’ will be read from the PLC data register D0.

If the read data is ‘0’ add a line to your PLC ladder to move some data intoregister D0 so you can confirm the DDE call is working.

M1000

MOV K78 D0

Dummy

Page 16: PROGRAMMABLE CONTROLLER MELSEC-A - mitsubishi plc A PLC,Series...PROGRAMMABLE CONTROLLER MELSEC-A SFM Training Manual A-SERIES Special Function Module MITSUBISHI MEAU 980615-B ELECTRIC

1. ETHERNET MODULE 1.6 ACCESSING PLC DATA

MEAU 980615-B 13

1.6.4 Writing Data with Microsoft Visual Basic

'''' Open a new VISUAL BASIC project. On the form make a command buttonCommand1 and a textbox Textbox1 then enter the following code …

When you run the project and click on the command button, the Ethernetbecomes active and the data ‘79’ will be written to the PLC data register D0.

Use MEDOC to monitor the contents of data register D0.