Está en la página 1de 16

MITSUBISHI

PROGRAMMABLE CONTROLLER

MELSEC-A
SFM Training Manual

A-SERIES Special Function Module

MEAU 980615-B

MITSUBISHI ELECTRIC

Revisions
Print Date 06/26/98 09/24/98 *Manual Number MEAU-980615-A MEAU-980615-B * The manual number is noted at the lower left corner of the front cover. Revision Original Version, chapter 1 only. 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 or implementation of other rights. Mitsubishi Electric Corporation is not responsible for industrial ownership problems caused by use of the contents of this manual.

1998 Mitsubishi Electric Corporation

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 to develop full familiarity with the functions and performance of the special function module you have purchased, so as to ensure correct use.

Table of Contents
1. EtherNet Module AJ71E71-S3, A1SJ71E71-B2-S3, A1SJ71E71-B5-S3 1.1 System Configuration 1.1.1 Hardware Requirements . 1 1.1.2 System Connection . 1 1.1.3 PLC Ethernet Module Installation .. 2 1.1.4 Module Switches Settings .. 2 1.2 Ethernet Ladder Logic 1.2.1 PLC Ladder Sample . 3 1.3 Windows95 Network Setup 1.3.1 PC Ethernet Card Installation . 4 1.3.2 PC Network IP Address Setup 4 1.4 Network Confirmation 1.4.1 PC Network Confirmation 5 1.4.2 PLC Network Confirmation . 6 1.5 MelDDE Software 1.5.1 Software Installation . 7 1.5.2 Create MelDDE Configuration File 8 1.6 Accessing PLC Data Through DDE 1.6.1 Reading Data with Microsoft Excel ... 9 1.6.2 Writing Data with Microsoft Excel .. 11 1.6.3 Reading Data with Microsoft Visual Basic ... 12 1.6.4 Writing Data with Microsoft Visual Basic ..... 13

1. ETHERNET MODULE

1.1 SYSTEM CONFIGURATION

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 Computer


Ethernet 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 PC to the master PLC controller. The master PLC controller is tied to slave PLC controllers by Net10, or some other control level network. Then finally bus friendly devices are tied to the slave controllers by a device level network. This chapter only describes the PC Master PLC to PC connection.
REMOTE NODE MASTER PLC

ETHERNET

MELSEC NET10

SLAVE 3

SLAVE 2

SLAVE 1

LOCAL DEVICE NET MEAU 980615-B

LOCAL DEVICE NET

LOCAL DEVICE NET

1. ETHERNET MODULE

1.1 SYSTEM CONFIGURATION

1.1.3 PLC Ethernet Module Installation This example assumes that the EtherNet module will be placed into SLOT 0, if this is not the case, the X and Y addresses in the ladder example will need to be changed accordingly.

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


DIP SWITCHES = ALL ON ROTARY SWITCH = 0

Rotary Switch

Setting Name

Setting Description

0 1 2 3 4
AJ71 A1SJ71

On-Line Off-Line Test 1 Test 2 Test 3

Connect with remote node, normal operation Disconnect with remote node, Ethernet stop Self Diagnostic test, self wrap test Self Diagnostic test, RAM test Self Diagnostic test, ROM test
Setting Description Off : Closes line when TCP time-out occurs On : Line stays open after TCP time-out Off : Conducts exchange in Binary code On : Conducts exchange in ASCII code Off : Forbids data exchange during PLC stop On : Allows data exchange during PLC stop Off : Network starts without delay. On : Network starts after 20 second delay.

Sw1 Sw2 Sw7 Sw8

Sw1 Sw2 Sw3 Sw4

Setting Name Line processing during TCP time-out Data Code Setting CPU Exchange Initial Timing

MEAU 980615-B

1. ETHERNET MODULE

1.2 ETHERNET LADDER LOGIC

1.2 ETHERNET LADDER LOGIC 1.2.1 PLC Ladder Sample The ethernet requires some ladder logic to initialize the module, check for conflicts between your ladder and the data registers that are used in the example. When the ladder is correctly loaded and running, the AJ71E71 RUN led is on steady and the RDY led will flash.

' Add the following logic to your ladder program.


M9038 H DMOV C8000002 D100 TO MOV MOV MOV MOV MOV MOV TO SET X1A H K 0 0 K 15 K 5 K 5 K 10 K 16 K 30 H K 0 10 Y19 D100 D102 D103 D104 D105 D106 D107 D102 K 6 K 2 SET PLC IP ADDRESS to 200.0.0.2 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 ONE SHOT

H K FROM 0 80 RST Y19

D108

K 1

CHECK FOR INITIAL ERRORS RESET INITIAL NORMAL END

INIT ERROR

X19 M50 PLS M50 D110 D110 H 500 K20 T0 SET Y8 X10 PLF M60 M60 RST Y8 PORT CLOSE MEAU 980615-B CLOSE PORT 1 CHECK FOR CLOSED PORT K 8 K 8 K 1 IF NORMAL END = OK, PULSE M50 CONFIG= RECEIVE UNPASSIVE SEND PORT CONFIG TO PLC SET PORT 1 = H500

INIT END

H FMOV 8001 TO TO H K 0 16 H 0 K 24

SETUP PORT

X19

Y8

TIME DELAY TO OPEN PORT

INIT DONE

T0 OPEN PORT 1

1. ETHERNET MODULE

1.3 WINDOWS95 NETWORK SETUP

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-up and prompt you through the setup process. Otherwise follow the card manufacturers instructions 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 ADD NEW HARDWARE function will be invoked. Select the type of card you have or put in the driver disk provided by the manufacturer. When the software driver install is complete, Windows will prompt you to reboot answer [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 line sayes Client for Microsoft Networks. This appears as the default client. The second line shows the type of network adapter you have installed. This information was derived from the driver installed above in section 1.3.1. The Third line is NetBEUI. This is a protocol which allows networking between Win95 and WinNT. If it does not appear in your component box, click the [ADD], double click [PROTOCOL], click [MICROSOFT], [NETBEUI] then click the [OK] button. The software may prompt you for the Windows95 installation disks. The Fourth line is TCP/IP. This is the internet protocol and is the most common protocol 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 provided through 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

MEAU 980615-B

1. ETHERNET MODULE

1.3 WINDOWS95 NETWORK SETUP

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] then enter the IP address [200.0.0.1] and subnet mask address [255.255.255.0] The other tabs on this window do not need any changes, the default settings should work fine. Click [OK]. Windows95 will prompt you to reboot the system, choose [YES]. During reboot, the Windows Network Logon window should appear, enter your user name and password.

1.4 NETWORK CONFIRMATION 1.4.1 PC Network Confirmation

'

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

Your computer name should appear here. The PLC does not appear in this window.

If your computer does not appear on the network neighborhood window, there is some problem with the PC network setup. Review your steps and confirm each procedure above. The PLC does not appear on the network neighborhood window, this is normal. The PLC is considered to be a network server.

MEAU 980615-B

1. ETHERNET MODULE

1.4 NETWORK CONFIRMATION

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 type PING 200.0.0.2 then press ENTER.

The PING command sends 4 packets of data out to the specified address and looks for them to be returned. The packet has instructions for the destination node to return the data to the node that the command originated with. If the communication is established and the node is responding correctly the message 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 ?

MEAU 980615-B

1. ETHERNET MODULE

1.5 MelDDE SOFTWARE INSTALLATION

1.5 MelDDE Software 1.5.1 Software Installation The MelDDE software is a Dynamic Data Exchange application the will access the PLC through RS232, or Ethernet. On the disk there is 2 different folders, MelDDE16 and 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.

MEAU 980615-B

1. ETHERNET MODULE

1.5 MelDDE SOFTWARE INSTALLATION

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 IP address in hexadecimal. In this example the IP address is 200.0.0.2, convert it to hex, 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 PORT1 equal 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 button
Command1 and a textbox Textbox1 then enter the following code selection for the RS232 / RS422 / RS485 special function module.

MEAU 980615-B

1. ETHERNET MODULE

1.6 ACCESSING PLC DATA

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
Call MelDDE.EXE Use configuration ENET.CFG Get data from register DO

'

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. B1 on the PLC E71 module should illuminate and the led on the PC The led Ethernet interface card should begin to blink.

MEAU 980615-B

1. ETHERNET MODULE

1.6 ACCESSING PLC DATA

1.6.1 Reading Data with Microsoft Excel With the MelDDE software running, the data from register D0 should appear in the spreadsheet cell.

If the read data is 0 add a line to your PLC ladder to move some data into register D0 so you can confirm the DDE call is working.
M1000 MOV Dummy K78 D0

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

MEAU 980615-B

10

1. ETHERNET MODULE

1.6 ACCESSING PLC DATA

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 should illuminate 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 when the MelDDE software runs. The data will only be written 1 time. Use MEDOC to monitor the contents of data register D0.

MEAU 980615-B

11

1. ETHERNET MODULE

1.6 ACCESSING PLC DATA

1.6.3 Reading Data with Microsoft Visual Basic

'

Open a new VISUAL BASIC project. On the form make a command button Command1 and a textbox Textbox1 then enter the following code

When you run the project and click on the command button, the Ethernet becomes 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 into register D0 so you can confirm the DDE call is working.
M1000 MOV Dummy K78 D0

MEAU 980615-B

12

1. ETHERNET MODULE

1.6 ACCESSING PLC DATA

1.6.4 Writing Data with Microsoft Visual Basic

'

Open a new VISUAL BASIC project. On the form make a command button Command1 and a textbox Textbox1 then enter the following code

When you run the project and click on the command button, the Ethernet becomes active and the data 79 will be written to the PLC data register D0. Use MEDOC to monitor the contents of data register D0.

MEAU 980615-B

13

También podría gustarte