Beruflich Dokumente
Kultur Dokumente
PROGRAMMABLE CONTROLLER
MELSEC-A
SFM Training Manual
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.
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
# The A1SJ71E71,
or AJ71E71 PLC Ethernet module.
$ 2-BNC T-Adapters
% 2-Terminators, 50 ohm
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
1. ETHERNET MODULE
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.
Rotary Switch
Setting Name
Setting Description
0 1 2 3 4
AJ71 A1SJ71
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.
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.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.
D108
K 1
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
INIT DONE
T0 OPEN PORT 1
1. ETHERNET MODULE
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]
[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
' 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.
'
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
' 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
MEAU 980615-B
1. ETHERNET MODULE
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] , 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
'
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 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 through DDE 1.6.1 Reading Data with Microsoft Excel
'
Open a new EXCEL spreadsheet and enter the following DDE call
=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
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.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
'
Open a new EXCEL spreadsheet and enter the following DDE macro
' Press [CTRL A] to execute the macro. The following window will appear.
MEAU 980615-B
11
1. ETHERNET MODULE
'
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
'
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