Home

MELSEC-L CPU Module User`s Manual (Built

image

Contents

1. Connection 1 to 16 Select the checkboxes appropriate to the target connection MELSOFT Transmission Port TCP IP i MELSOFT Transmission Port UDP IP 2 Select one of them when the remote password is to be enabled for FTP Transmission Port TCP IP the builtin Ethernet port Direct Connection of MELSOFT Select this when enabling this operation Useful for detecting unauthorized access Page 114 Section 9 4 Specify the maximum number of mismatches 1 to 65535 Select the checkbox when this operation is to be performed 1 One byte alphanumeric and special characters can be used for remote password entry Case sensitive 2 To enable the remote password for the port for which the open system is set to MELSOFT Connection in PLC Parameter select the following checkbox When Protocol is set to TCP gt MELSOFT Transmission Port TCP IP When Protocol is set to UDP gt MELSOFT Transmission Port UDP IP 3 When connecting the CPU module and a GOT via Ethernet do not select MELSOFT Transmission Port UDP IP 4 Select this checkbox to enable the remote password for the CPU module that is directly connected to the programming tool using the built in Ethernet port lt _ gt Page 28 CHAPTER 4 111 Buines plomsseg ajowuay Z 6 2 Writing to the CPU module Write the remote password to the CPU module from the Write to PLC screen O Online gt Write to PLC After writ
2. 4 3 4 23 8220446 40 i934 td a a a 34 521 Command US aaa as aide eve patios 34 522 ANalahe IC abad 35 Bid Precaution Ss ue crac oe arene neat eau eae eon wee Cae eae ee Ge oe ae eee bata eae 36 5 4 Error Codes for MC Protocol Communication 0 000 eee eee es 38 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 39 6 1 Communication Using TOP escudos Aaa wn wide en a Bde aa kU A eee So Aa eed 41 6 2 Communication Using UDP o o o o eens 50 6 3 Precautions for the Socket Communication Function 0000 eee eee 56 6 4 Socket Communication Function Instructions 0 0 0000 eee 58 6 4 1 Establishing a connection SP SOCOPEN 0 000 ccc eee eee 59 6 4 2 Disconnecting a connection SP SOCCLOSB 00 00 ccc eee ee ee ees 64 6 4 3 Reading out received data in the END processing SP SSOCRCV 08 67 6 44 Reading out received data during instruction execution S SOCRCVS 70 645 Sendingdata SP SOCSND ua dd 73 6 4 6 Reading out connection information SP SOCCINF 0 0 TT 6 4 7 Changing the target of a connection UDP IP SP SOCCSET oo oooooocooooo 80 6 4 8 Changing the receive mode of a connection SP SOCRMODE oo oooooooo 82 6 4 9 Socket communication receive data read S P SOCRDATA 0000000 85 CHAPTER 7 TIME SETTING FUNCTION SNTP CLIENT Vol SCN MENO caseras ca la a alt aa ca 7 2 ESC UIE ONS oe
3. Personal computer Control room Factory For access via routers set the parameters as shown below gt Page 21 Section 3 1 for other settigs KO Project window gt gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting IP Address Setting Geen Salt pen Setting Input Format DEC IP Address 192 FTP Setting Time Setting Subnet Mask Pattern 255 255 255 ol gt D Default Router IP Address 192 168 ol 254 foetifitisneededi Default Changed Communication Data Code Set the subnet mask pattern Binary Code feo and the default router ASCII Code IP address 20 sJamoy Bla UONeDIUNWWOD p e 3 9 26 1 2 3 4 Precautions IP address duplication Check that the IP address is not duplicated when configuring a network or connecting a new device to a network If the IP address is duplicated a device may communicate with the wrong device Check for the IP address duplication in the following ways e Check for the IP address duplication with the find CPU function e Disconnect the device from the line and send ping to the IP address of the disconnected device Having a response means the IP address duplication KeepAlive check When the protocol is set to TCP KeepAlive check is performed Checking for a response to a KeepAlive ACK message An alive check message is sent five seconds after reception of the last message fr
4. Unset f Set k 112 CHAPTER 9 REMOTE PASSWORD 9 3 Precautions 1 When a remote password is set for UDP connections e Determine a target device before data communication The communication target needs to be determined because after unlocking of the remote password communication is available with any other devices e At the end of data communication always lock the remote password If the lock processing is not performed the unlock state is held until a timeout occurs No communication for 10 minutes causes a timeout and the CPU module automatically performs lock processing To prevent unauthorized access using the remote password setting it is recommended to set all connection protocols to TCP IP and disable direct connection with the parameter 2 When a TCP IP connection is closed before lock processing The CPU module automatically performs lock processing o w U a D O 0 Cc O m mn 113 9 4 Detection of Unauthorized Access and Actions When the remote password mismatch count reaches the upper limit in unlock processing REMOTE PASS FAIL error code 2700 is detected If this occurs unauthorized access from the outside of the system can be considered as a cause of the error Take the following actions as needed 1 Monitor the Remote password count SD979 to SD999 and identify the connection of which remote mismatch count has reached the upper limit in unlock processing 2 Stop the
5. me os Write L26CPU BT L26CPU PBT sl ei e 1 Number of points for each device bit device and word device 135 uoouny UONCOIUNWWOD 74 ajdulis jo sI a9ueuloJIagy y xipuaddy 2 Condition 2 e Communication Setting Fixed Interval e Destination device MELSEC Q L Built in Ethernet Function L26CPU BT e Sequence scan time host station 10ms the period before the execution of simple PLC communication function e Sequence scan time destination device 1ms The destination device means both the transmission source and transmission destination for data transfer e Device data Bit device M Word device D e Number of settings The number of destination devices Double the number for data transfer e The retry of communication is not performed Processing time by the number of Communica Number of communication points for one CPU module er ia a unit ms tion Pattern setting 16 q T Write LO2CPU LO2CPU P ps Mid me y q Write L26CPU BT L26CPU PBT a id dia dd 4 Number of points for each device bit device and word device 136 INDEX A M ACIE OPEN meente ee EES reuse areas 41 WMG Protocol bie iaa sack ie ae oe 31 Maclean a ae aed 100 B FUNG IR eae dat an at een aa ea Tea ee o ae 100 MOE Lores o eee sans a enn eee dy eee 101 T AEE E E eee 99 A E tr E EEE EE 101 T A as deed E E EN 99 A aa tied Ei a a wen a pare 101
6. write password lt ret gt Enter a file password delete file name lt ret gt or rename current file name new file name lt ret gt Delete or rename the file Write the file put file name lt ret gt CHAPTER 8 FILE TRANSFER FUNCTION FTP a Logging in to the CPU module The following explains the operation flow from starting an FTP session until log in to the CPU module lex Start up the FTP from the MS DOS prompt of Microsoft Windows cx Command Prompt ftp lof x Microsoft Windows XP Version 5 1 26001 lt C gt Copyright 1985 2661 Microsoft Corp 7 SS and Settings ZBO3341 gt ftp Shaky 2 p DO AA Connected to 192 168 3 39 eady 3 gt ESMAS BEBES OIDO ASE 331 Password required 4 EEE 230 User logged in ft p gt 1 Start an FTP session FTP lt ret gt 2 Open a connection to the FTP server open IP address of the CPU module lt ret gt 3 Specify the login name Login name lt ret gt 4 Specify the password Password lt ret gt b Locking and unlocking a remote password If the FTP communication port is specified as a remote password check target in the remote password settings unlock the remote password using the following command quote password unlock Remote password lt ret gt When terminating the operation lock the unlocked remote password using the following command quote password lock lt ret gt P
7. Built in Ethernet Port Setting gt FTP Setting 3 Configure the FTP parameter settings again 4 Write the parameters to the CPU module from the Write to PLC screen W Online gt Write to PLC 5 Power off and then on or reset the CPU module to enable the parameters 108 CHAPTER 9 REMOTE PASSWORD CHAPTER 9 REMOTE PASSWORD A remote password is checked when a connection is requested for the following e Communication using a programming tool e Communication using MC protocol e File transfer FTP Point The remote password function is one of the preventive methods against unauthorized access e g destruction of data and programs from external devices However this function cannot completely prevent unauthorized access Other preventive measures should be taken at users discretion if security of the programmable controller system needs to be maintained against unauthorized access from external devices We cannot be held responsibility for any problems caused by unauthorized access Examples of measures against unauthorized access e Install a firewall e Set up a personal computer as a relay station and control the relay of communication data using an application program e Set up an external device that can control access rights as a relay station For devices that can control access rights please consult your network service provider or networking equipment vendors 109 9 1 Communication Using Remote
8. Built in Ethernet port Function LCPU Basic model QCPU Ethernet module Communication specification High Performance model QCPU Ethernet module MELSOFT connection MELSEC Q Ethernet Module Process CPU Ethernet module Universal model QCPU Ethernet module MELSEC QnA Ethernet Module QnACPU Ethernet module ACPU Ethernet module MC protocol A MELSEC A Ethernet Module High Performance model QCPU A mode Ethernet c Settin module g for each device for communications The settings vary depending on the device for communications compatible 1E frame binary code communication O Setting is required A Setting is required if the password is set for destination device for communications x Setting is not required Device for communications IP Address Setting item MELSEC Q L Built in Ethernet x x A Function A oo ee ose S meer 1S se 4 Setting of the host station is required 2 For MELSEC Q Ethernet Module and MELSEC QnA Ethernet Module settings of these items in Simple PLC Communication Setting are required because these modules perform communication processing by using the network No and the station No Data flow Ethernet 10 fi oh i y y an gt ia A 4 E d Network No 1 Network No 1 Network No 1 Network No 1 Station No 1 Station No 2 Station No 1 Station No 2 The settings must be configured in The settings must be con
9. Class A 255 0 0 0 Class B 255 255 0 0 Class C 255 255 255 0 30 CHAPTER 5 MC PROTOCOL COMMUNICATION CHAPTER 5 mc PROTOCOL COMMUNICATION The built in Ethernet port allows MC protocol communication From an peripheral device such as a personal computer or HMI device data of the CPU module can be read or written using MC protocol Monitoring of CPU module operation data analysis and production control are available on a personal computer or HMI by these device data reading and writing Besides the remote password function can prevent unauthorized access from outside of the system 2 gt Page 109 CHAPTER 9 Personal computer HMI etc Communication using MC protocol Point From the peripheral device such as a personal computer or HMI only the CPU module connected can communicate using MC protocol An access to a CPU on another station via CC Link network is not allowed To start MC protocol communication perform the following steps Connect cables and devices required for MC protocol Connecting cables and external devices communication Setting parameters Configure PLC parameters by the programming tool Page 32 Section 5 1 Writing to the CPU module Write the configured parameters to the CPU module Power it on again or reset it for the parameters to take effect MC protocol communication is available For the MC protocol communication refer to the followi
10. Completion status is stored 62 1 is 0000H Completed System Other than OOOOH Failed Error code 3 0 Send data length The length of send data is specified in bytes 1 to 2046 9 1 to Send data Send data are specified 3 n g The Set by column indicates the following User The data must be set before executing the SP SOCSND instruction System The CPU module stores the execution result of the SP SOCSND instruction Completion User 3 Function This instruction sends data set in 6 to the target device of the connection specified by 63 CPU module Send data length Send data Send data External device SP SOCSND Sending data Send data The result of the SP SOCSND instruction can be checked with the completion device D 0 and 1 e Completion device D 0 Turns on in the END processing of the scan after completion of the SP SOCSND instruction and turns off in the next END processing e Completion device D 1 Turns on or off according to the result of the SP SOCSND instruction State Description When completed Remains off Turns on in the END processing of the scan after completion of the SP SOCSND instruction and turns off When failed l in the next END processing 14 CHAPTER 6 SOCKET COMMUNICATION FUNCTION The following figure shows the timing of reception processing with the SP SOCRCV instruction lt Transmission control method gt Data Open t a processing ransmi
11. INSTRUCTION INDEX REVISION te ote serna eed ee alee ee eee ent ee eae ao eee WARRANT rset eae a ON 139 140 141 11 MANUAL PAGE ORGANIZATION In this manual pages are organized and the symbols are used as shown below The following page illustration is for explanation purpose only and is different from the actual pages is used for screen names and items 7 1 1 Setting method The chapter of 1 Settingiparameters ihe current ae NA 1 shows operating a Qperating procedure Open th PLC Parameter dialog box procedures 1 open ng PLc Parameter DO Project window Parameter PLC parameter Select the I O Assignment tab O shows mouse operations 1 is used for items in the menu bar and the project window Type Select the type of the connected module Page 74 Section 7 1 2 Model Name Select the model name of the connected module Page 74 Section 7 1 3 Points Set the number of points assigned to each slot Page 74 Section 7 1 4 Start XY Specify a start VO number for each slot Page 74 Section 7 1 5 Switch Setting Configure the switch setting of the built in I O or intelligent function modules Page 74 Section 7 1 6 gt Set the following of The section of Detaled Setting cekam an a Page 75 Section 7 1 7 za Bin the current page is shown 2g 3 a Setting Start X Y enables modification on the start I O numbers assigned to connected modules i 1000 is spe i
12. M1003 M3000 D3000 and D3001 M300 and M301 D300 to D303 M3002 M3003 M4000 M4001 SD1282 SD1284 SD1286 SD1288 D200 and D201 M200 and M201 M4002 M4003 M4004 D400 to D403 D5000 and D5001 M500 and M501 D500 and higher M5002 M5003 Application Open direction SP SOCOPEN instruction control data SP SOCOPEN instruction completion device Normal open indication Open error indication Send direction SP SOCSND instruction control data SP SOCSND instruction completion device Send data length and send data 6 bytes of 12H 34H 56H 78H 9AH and BCH Normal send indication Send error indication Close direction Disconnection by the other device Open completion signal Open request signal Receive state signal Connection state signal SP SOCCLOSE instruction control data SP SOCCLOSE instruction completion device Normal close indication Close error indication Closing flag SP SOCRMODE instruction control data SP SOCRCV instruction control data SP SOCRCV instruction completion device Receive data length and receive data Normal receive indication Receive error indication 43 dol Buisn UOIEOSIUNWLWWOD 9 c Sample program 1 lt lt Fixed length mode setting gt gt SM402 f 1 MOV KI D402 Setting TCP receive mode to 1 MOV K6 D403 Setting receive data size to 6 SP SOCRMODE U0 K1 D400 Changing TCP receive mode of l Connection No 1 lt lt Connection No 1 open processing Active gt
13. Network No Network No of Ethernet module set in parameter Station No Station No that does not overlap on the same loop Network No and station No are not used when communicating with an Ethernet port of CPU Built in Ethernet port Protocol 2 Select PLC Module for PLC side I F Enter the IP address or host name of the CPU module in the PLC side I F Detailed Setting of PLC Module dialog box as shown below oo Huluuwes6oJg ay 104 Bunes z For the host name enter the name set in the Microsoft Windows hosts file PLC side I F Detailed Setting of PLC Module PLC Mode JLcPu E Ethernet Port Direct Connection Connection via HUB Cancel Please select Connection via HUB when you use hub HUB even if the equipments to be communicated is one The load hangs to the line when Ethernet Port Direct e IP Address UB a a Connection is selected with other equipment connected with IP Input Format DEC hub HUB and it communicates and there is thing that influences the communication of other equipment Host Name 3 Set Other Station Setting Select an item appropriate to the operating environment Se a 23 3 3 24 Searching CPU Modules on the Network In a configuration using a hub clicking _fnd lt Pu Guit in ethernet port on network in the PLC side I F Detailed Setting of PLC Module dialog box will start searching for CPU modules connected to the hub where the p
14. Password Setting Password Y Connection 1 Connection 2 Connection 3 Connection 4 Characters that can be used in password 4 characters Numbers 4 2 a z Special characters Connection 5 Connection 6 Connection 7 Connection 8 Connection 9 Connectioni0 Connection 11 Connection 12 M Connection13 T Connection14 Connection15 Connection 16 Password Active Module Setting Model Name Startx System Connection MELSOFT Transmission Port TCP IP MELSOFT Transmission Port UDP IP FTP Transmission Port TCP 1P M Direct Connection of MELSOFT V Regard as Error when Remote Password Mismatch Count Reaches Upper Limit Upper Limit of Mismatch 10 Count V Clear Mismatch Count when Remote Password Matches When the remote password is enabled write the parameter to the PLC and reset the PLC or turn off the power and turn on the power again End Cancel End Cancel Necessary Setting No Setting Already Set Clear Up to four Enter a remote password to be set for the CPU module l P characters Select a CPU model to enable the remote password for the built in Model Name Ethernet port of the CPU module Only one CPU model is selectable S this to display the Remote Password Detail Setting dialog i Select one of them when the remote password is to be enabled for the built in Ethernet port Setting of an unused connection or MELSOFT connection is ignored LCPU
15. Precaution for Active open communication Configure an interlock circuit using the Open completion signal SD1282 and Open request signal SD1284 in the program The following chart shows on off timings of the Open completion signal and Open request signal lt When disconnected by the CPU module gt Open completion signal ON SD1282 Open request signal SD1284 TCP disconnection completed upon response from the external device OFF ON TCP disconnection request from the CPU module OFF z l l t t SOCOPEN instruction SOCCLOSE instruction lt When disconnected by the external device gt TCP disconnection request from the external device TCP disconnection completed upon E E response from the CPU module I t SOCCLOSE instruction 45 dol Buisn UOICSIUNWWOD 9 3 Program example for Passive open The following shows a communication flow of a Passive open Waiting for TCP connection in Passive open state Send or receive Send by the SP SOCSND instruction or receive by the SP SOCRCV or S SOCRCVS instruction a Parameter setting The following parameters are set for the sample program O Project window Parameter gt PLC Parameter gt Built in Ethernet Port Setting gt Open Setting Built in Ethernet Port Open Setting Host Station Destination Destination Host station port No destination port No Please input in HEX caos
16. SPUBWILWOS dl4 30 slejeq EVs SspueWWOD dit 78 put Function Specification format Example 1 Example 2 Note pwd Function Specification format Note quit Function Specification format Identical command quote Function Specification format Example Note rename Function Specification format Example Note user Function Specification format Example 1 Example 2 102 Writes a file to the CPU module put source file path name destination file path name When writing the MAINSEQ1 QDR file to the standard RAM with the same file name put MAINSEQ1 QDR 3 MAINSEQ1 QDR When writing the MAINSEQ QDR file to the standard RAM with a different file name put MAINSEQ QDR 3 MAINSEQ1 QDR e If no directory is specified for the source file path name FTP client side the file on the current directory where FTP is started up and connected to the server is written e When no destination file path name FTP server side is specified the file is saved in the memory in which current parameter files are stored Displays the current directory name of the CPU module pwd is displayed as the execution result of the pwd command Disconnects the line from the FTP server and terminates the FTP session quit bye Sends an FTP server subcommand a subcommand dedicated to CPU modules quote quote password lock Only CPU module dedicated subcommands can
17. The set values will take effect at the following timing of the SP SOCRMODE instruction execution e Before opening Values take effect after opening a connection When there are data in the Socket communication receive data area Values take effect after execution of the SP SOCRCV or S SOCRCVS instruction once after the S SOCRMODE instruction e When there is no data in the Socket communication receive data area Values take effect after the SP SOCRMODE instruction is executed 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when e The connection number specified for is other than 1 to 16 Error code 4101 The device number specified for 62 exceeds the device point range Error code 4101 e Invalid device is specified Error code 4004 Even when the Receive state signal is not on in the TCP fixed length receive mode the data received at the point can be read out with the SP SOCRDATA instruction This allows you to check whether the data sent from the connected device is adequate in size eeeeoeeoeoeooeoeoeoeaeaeaeaeaeeeeeeaeaeseeaeeeeeeaeesesesesesesea se aesaeaeeaeeaeaeaeaeaeaeeeeeeaee ee ee 8 oe 5 Program example When M4000 is turned on connection No 1 is set to the TCP fixed length receive mode and the receive data size is set to 256 bytes After execution of the instruction and when the receive data size of connection No 1
18. and clears the write password file password 32 that is registered to the file transfer target With this command the CPU module checks the write password when access is made to the transfer target file quote passwd wr write password Any of the following is displayed as an execution result upon completion e When setting a write password 200 Command successful e When displaying a write password 200 Write password is write password e When clearing a write password 200 Command successful e When attempting to display a write password with no write password set 200 Write password is not set When setting a write password 1234 ABCDefgh quote passwd wr 1234 ABCDefgh When displaying a write password that is currently set to FTP quote passwd wr When clearing a write password that is currently set to FTP quote passwd wr c or quote passwd wr C e One write password can be set to FTP of the CPU module When the transfer target file is changed if a write password is preset for the new target file set the write password of the target file again e When the CPU module is logged in the write password is cleared CHAPTER 8 FILE TRANSFER FUNCTION FTP 8 5 Precautions 1 FTP clients e Some FTP clients may have FTP command specifications different from those described in this manual In such a case check the functions and operation methods referring to the manuals for the FTP client e An FTP operation from Microsoft Int
19. instruction 1 scan Completion Bre 4 device Abnormal termination Completion Je a ey device qa Data read ACK processing TCP only uo1 d 1 ejeq 68 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when The connection number specified for 6 is other than 1 to 16 Error code 4101 e The received data size exceeds the size of the receive data storage device Error code 4101 The device numbers specified for 62 and exceed the device point range Error code 4101 e An invalid device is specified Error code 4004 5 Program example When M5000 is turned on data received from the connected device are read out e Devices used Device number Application D1282 Open completion signal SD1286 Receive state signal D5000 SP SOCRCV instruction control data D500 Receive data length and receive data storage location M500 SP SOCRCV instruction completion device e Program Ee apo SOTO MP PSOCROV uo KI DS000 D500 M500 J data of Connection M500 M501 a SET M502 Normal completion M501 FA SET M503 Error completion Point O To avoid receiving large amounts of data the volume of received data can be limited by setting the receive data size using the SP SOCRMODE instruction O Consecutively sent data can be consecutively read out by connecting the completion device of
20. which is used for other setting No Point O Actual time of execution interval may be longer than the value of the setting because the time is affected by the specified devices or Ethernet line congestion For the preventive measures refer to the troubleshooting described in the following manual MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection poyan Bumas 101 O If latency time is set data communication is started after the latency time has passed _ gt Page 127 Section 10 1 12 117 118 3 Register Destination a Setting of devices for communications Set the devices for both transmission source and transmission destination Up to 64 devices can be registered This setting also can be done in Destination Setting List dialog box that will open by clicking Destination Setting List button in Simple PLC Communication Setting dialog box Use Destination Setting List dialog box as well to change the setting information Register Destination Registration Mo 1 IP Address Port Mo Input Format i Module Type II IP Address Pork Mo Station Mo 3 Network Mo F Remote Password Host Station Pork Mo Host Station Set the field marked with as needed ceel IP Address Port No Input Select the input format of IP address and port No DEC HEX Format Module Type Select the device for communications lt a Page 119
21. 14 70 SP SOCCSET SOCCSET 13 30 42 90 12 70 a mode gt Fixed length mode SP SOCRMODE 16 00 39 60 13 70 Fixed wae mode gt wae mode srsocroam SOCRDATA ssesocroaia Hor bytes 500 00 521 60 389 70 SP SOCRCV uoion13su y9ey 104 au Buissa9o1y uonelado xipueddy Instructions for the socket Maximum 45 50 43 80 39 20 35 20 413 20 35 20 413 20 48 20 278 20 48 20 278 20 32 30 31 40 29 30 26 10 404 30 133 Appendix 2 Port Numbers Used by System The following table lists port numbers used for the system Port number Application For future extension For Q series Ethernet modules this port number is used for Auto Open UDP Port For future extension For Q series Ethernet modules this port number is used for over UDP IP and Ethernet module 1388H 5000 1389H 5001 For future extension For Q series Ethernet modules this port number is 138AH 5002 l used for over TDP IP and Ethernet module 138BH 5003 to 138DH 5005 For future extension 138EH 5006 MELSOFT communication port over UDP IP and CPU module 138FH 5007 MELSOFT communication port over TDP IP and CPU module 1390H 5008 MELSOFT direct connection port over CPU module 1391H 5009 For future extension Appendix 3 Added and Changed Functions The following table shows the built in Ethernet function which is changed or added to the CPU module and GX Works2 as well as the serial No and soft
22. 2 Invalid for connections in UDP communications 3 The Set by column indicates the following User The data must be set before executing the SP SOCRMODE instruction System The CPU module stores the execution result of the SP SOCRMODE instruction 3 Function This instruction changes the TCP receive mode and receive data size of the connection specified in 6 The mode is changed as specified in 62 2 This instruction is invalid for UDP connections 82 CHAPTER 6 SOCKET COMMUNICATION FUNCTION a TCP standard receive mode When data are received they are stored in the Socket communication receive data area and SD1286 turns on If data are received exceeding the specified receive data size the excess data are read out the next time Ex The receive data size is set to 300 bytes and 500 byte data are received SP SOCRCV or SP SOCRCV or Reading receive data S SOCRCVS S SOCRCVS instruction instruction Socket communication Data stored Data reading Data stored Data reading receive data area 300 bytes 200 bytes l l ON 1 SD1286 OFF l Data reception 500 bytes b TCP fixed length receive mode When data are received they are stored in the Socket communication receive data area and SD1286 Receive state signal turns on However if the size of the data does not reach the specified receive data size SD1286 does not turn on Data reception is repeated and once the data size reaches to the spec
23. 4 e Createv an initial processing program and do the settings as shown below e Set the IP address and the port No by referring 3 in this section e Set UDP for the communication method e Turn on the bit 15 in the exchange instruction area during STOP address 496 1F0 of buffer memory and the bits corresponding to the connection No used for bits O to 7 4 DIP switch on the front of the module Set the following items e SW3 Automatic start up mode setting ON e SW7 CPU exchange timing setting ON Set the following items e SW2 Data code setting OFF e SW7 CPU exchange timing setting ON The module has the setting by default to communicate with one device whose protocol is UDP To execute the simple PLC communication function when the CPU module destination device for communications is in RUN state turn on this switch If Ethernet module is in Automatic startup mode turn on this switch To execute the simple PLC communication function when the CPU module destination device for communications is in STOP state or in stop error state turn on the bits The module cannot communicate regardless of the setting if a stop error occurs in it CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 5 Available devices The devices that can be specified as transmission source and transmission destination vary depending on the destination device for communications Both a bit device and a wo
24. C N change aea x Goss he netsh wea io wat ait an ees a rte ala aaa 103 NAK message 2 ee eee eee eee eee 33 ASS a anon Meise retin ia 30 O NN 99 O CPU OCU CS diri Dad dates ita da 15 CPU module dedicated subcommands 103 A A O epee 101 D P Data communication frame 36 Passive OPE pianos as 41 A O E A E Ne NC a 99 passwd rd ccdstissets dar sack amada 105 QI soa Stee a IN re a a 99 DASSWO Wr 1 es 106 DIRECT CONNECTION 20000 28 password lock 000 cee eee eee eee eee 104 password unlock o o o oooooooo ooo 103 E DIME WHLC sesos e aaa a 105 Programming t00l o o oooooooooo o 15 Ethernet cable o o oooooooooo ooo 18 Pb ooo 102 Ethernet communication 20 POr 102 F Q FILE TRANSFER FUNCTION 90 quit Sp ic ce Se Se WS ae ar ae EN Za e AOS ear eae ah Pad aye Cae Sem ae a 102 A dns che peat dae Ge ane ec Set eg 90 quote Sea ee ty wee Md we a ele de e ee ay ab ee cia St Na 102 FTP COMmMAndS 3 402 E 96 FTP server support commands 99 R PUD ASSIVG id Aone ee ed aks eG dot ai 41 recv function cited ia pal aia 37 G FRANC bik tr adh O 102 FOU eran ate acd tdi Srv cece eas pales ach eh a 92 A CON 100 ROUES ns hb oe cee lool wh leeds e adi 25 CO er he cece eaten Seta dh atten ata alla esate tit he nateees tte 20 Ue See terete sate sae fans es dig ah tw Mb ce PAC A ae Ae Des gmaven ean sh eee 104 H S hostname e
25. Communication Data Code and restart When Communication Data Code is set to ASCII Code ASCII the CPU module code data that cannot be converted to binary were received e Correct the send data of the connected device and resend the data Correct the number of read or write points and resend the data to Th mber of read or write points is outside the allowable range dl AA ca je 9 the CPU module Correct the start address or the number of read or write points and The read or write request exceeds the maximum address resend the data to the CPU module The maximum address must not be exceeded The request data length after ASCIl to binary conversion does not Check and correct the text data or the request data length of the match the data size of the character area a part of text data header and resend the data to the CPU module e The command and or subcommand are specified incorrectly e Check the request e The CPU module does not support the command and or e Use commands and or subcommands supported by the CPU subcommand module The CPU module cannot read data from or write data to the q Check the device to be read or written specified device The request data is incorrect e g reading or writing data in units of Correct the request data and resend it to the CPU module bits from or to a word device e g subcommand correction No monitor registration Perform monitor registration before monitoring e C
26. MOVP K6 D300 Setting send data length MOVP H3412 D301 H7856 D302 Setting send data HOBC9A D303 SP SOCSND U0 D300 M300 Sending data to Connection No 1 M300 M301 SET M3002 Normal completion M301 l a EA M3003 Error completion r 2 SD1282 0 SD1286 0 M500 eee ee SP SOCCINF UO K1 D450 D460 Obtaining information of target device SP SOCRCV U0 K1 D5000 D500 M500 Receiving data M500 M501 SET M5002 Normal completion M501 t_ gt 2S HAST _L__ 2J 1__ _ _ 1 _ _ set M5003 Error completion END For changing the target device run the program enclosed by a dotted line It can be omitted when the communication target is not changed For details refer to the section of the SP SOCCSET instruction gt Page 80 Section 6 4 7 For acquiring information of the target device connected on UDP run the program enclosed by a dotted line It can be omitted when the information acquisition is not meeded CHAPTER 6 SOCKET COMMUNICATION FUNCTION 2 Simultaneous broadcast For simultaneous broadcast using UDP set the parameters as follows e Destination IP Address FF FF FF FFH e Destination Port No FFFFH CPU module IP address xx xx xx xx Subnet mask 255 255 255 0 Ethernet Sending data from port No A of the CPU Port No A module to each port No N of all external devices ES External device 1 IP address xx xx xx yy External device 2 IP address xX xX xX ZZ Exter
27. Password Communication is performed in the order described below when a remote password is set for the CPU module 1 Allowing access unlock processing On a communication device such as a personal computer unlock the remote password set for the CPU module If it is not unlocked an error will occur on the connected device because the CPU module will prohibit any access 2 Access processing Access the CPU module after completion of the remote password unlock processing 3 Prohibiting access lock processing When terminating access from the personal computer lock the remote password to prohibit an access from any other personal computers Accessing the host CPU a Unlocking Enable Disable ee See ee ee Ke KH HG i a ae Accessing a CPU on another station a Unlocking Ethernet Enable Disable 110 9 2 CHAPTER 9 REMOTE PASSWORD Remote Password Setting 1 Setting a remote password Password Setting Password Active Module Setting User Connection No System Connection Regard as Error when Remote Password Mismatch Count Reaches Upper Limit Upper Limit of Mismatch Clear Mismatch Count when Remote Password Matches Set a remote password and a target connection in the programming tool and write the data to the CPU module Project window gt gt Parameter gt Remote Password Remote Password Setting Remote Password Detail Setting User Connection No
28. Remote password STOP _ Write Locked enabled disabled Displays or changes the CPU module file attribute Displays or changes the CPU module file attribute 2 O o f o a TT TACA Die E ECO O E ca TS Js A IEEE A AM E E E E A O So ss o Ss 9 9 A e A Even if the subcommand is executed the remote password remains locked with no error occurred This command can include a folder name in the file specification x x 1 O 97 SpueWWOD d14J01817 Lys SPUBEWUIWOD d1i3 V8 8 4 2 How to specify an FTP command This section explains how to specify a file with an FTP command on the FTP client connected device which is supported by the CPU module 1 File specification A file can be specified for an FTP command on the FTP client side as follows For CPU modules each file is specified using a drive name and a file name 2 e When specifying a file in the CPU module using the FTP function specify the target file in the following order Specification format Drive name Folder name File name Extension Example 3AMAINSEQ1 QDR other than drive 2 2 LOGGING LOG01 00000001 LOG01_00000001 CSV drive 2 Specification details Refer to a and b below 1 Only for a file in drive 2 the folder name can be specified 2 Use as a delimiter a Drive name drive No Specify the drive name of the file transfer target memory For the CPU module s memories and drive names refer to 2
29. area CPU module Receive data D 0 length On Socket communication receive data area External device E a No specified by S Receiving Reading receive data O The following figure shows the timing of reception processing with the S SOCRCVS instruction Data Open reception Data read processing processing processing S SOCRCVS instruction execution signal SD1286 n ON Open completion OFF signal SD1282 n END END processing processing Sequence program Reception status S SOCRCVS instruction Data read processing ACK TCP only uondasal ejeq 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when The connection number specified for is other than 1 to 16 Error code 4101 e The received data size exceeds the size of the receive data storage device Error code 4101 e The device number specified for exceeds the device point range Error code 4101 e An invalid device is specified Error code 4004 5 Precaution Do not use both this and SP SOCRCV instructions when reading out receive data of the same connection 11 SADNIOS S uognoax vonon sul Buunp ejep panisgal no Bulipeay y y 9 SUOI JONIJSU UOIOUN4 UOI EDIUNWWOYD JONDOS y 9 12 6 Program example When M5000 is turned on data received from the connected device are read out e Dev
30. be set lt gt Page 134 Appendix 2 90 CHAPTER 6 SOCKET COMMUNICATION FUNCTION b Devices used in the program The following table lists the device numbers and applications used in the sample program Device number M3000 D3000 and D3001 M300 and M301 D300 and D303 M3002 M3003 D5000 to D5001 M500 to M501 SD1282 SD1286 SD1288 M3001 D500 and higher M5002 M5003 D400 to D404 D450 to D451 D460 to D464 Application Send direction SP SOCSND instruction control data SP SOCSND instruction completion device Send data length and send data 6 bytes of 12H 34H 56H 78H 9AH and BCH Normal send indication Send error indication SP SOCRCV instruction control data SP SOCRCV instruction completion device Open completion signal Receive state signal Connection state signal Target change direction Receive data length and receive data Normal receive indication Receive error indication SP SOCCSET instruction control data SP SOCCINF instruction control data SP SOCCINE instruction connection information 91 dan Buisn uoedlunwwog 9 92 c Sample program 1 lt lt Target changing gt gt M3001 D1282 0 iH DMOVP HOA6155DE MOVP H2001 SP SOCCSET uo K1 D402 Setting target IP address D404 Setting target port No D400 Changing setting of lt lt Data sending gt gt lt lt Data receiving gt gt Sd 2 Connection No 1 M3000 SD1282 0 SD1288 A t m
31. cable Incorrect wiring connecting the cable to an incorrect interface may cause failure of the module and external device Tighten the terminal block screw within the specified torque range Undertightening can cause short circuit fire or malfunction Overtightening can damage the screw and or module resulting in drop short circuit fire or malfunction When disconnecting the cable from the module do not pull the cable by the cable part For the cable with connector hold the connector part of the cable For the cable connected to the terminal block loosen the terminal screw Pulling the cable connected to the module may result in malfunction or damage to the module or cable Prevent foreign matter such as dust or wire chips from entering the module Such foreign matter can cause a fire failure or malfunction A protective film is attached to the top of the module to prevent foreign matter such as wire chips from entering the module during wiring Do not remove the film during wiring Remove it for heat dissipation before system operation To use the high speed counter function ground the shield cable on the encoder side relay box Always ground the FG and LG terminals to the protective ground conductor Failure to do so may cause malfunction Mitsubishi programmable controllers must be installed in control panels Connect the main power supply to the power supply module in the control panel through a relay terminal block Wiring
32. connection the IP address and host name need not be specified in the connection target setting Simultaneous broadcast is used Programming tool 2 ES ss see Boe sss 2 gt Ses SSS esse RSS 2S2 en SSS LS Ethernet cable Point An Ethernet cable used for direct connection will be longer compared with the case of using a USB cable This can cause an unauthorized connection from a remote location Unauthorized connections can be prevented by selecting the following option in the Built in Ethernet port tab of the PLC parameter dialog box Enable online change FTP MC Protocol seseenseensesssensessssssssssensssssnsssenssssssssessssnesssenssesscssnsessnssssnesseneey Do not respond to search for CPU Built in Ethernet port on network 28 CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL SIMPLE CONNECTION 4 1 Setting Method Set the items on the Transfer Setup screen W Connection Destination window gt Connection1 PC side I F A HE CC IE Cont Li Ethernet Q Serie PLC AF NET 10 H Board Bus Board Board Board Board Network No 1 Station No 1 Protocol p E F PLC side I F z CC IE Cont Li Ethernet C24 GOT A6 Q6TEL Bus NET 10 H Module Module Je 2 PLC Mode LCPU 1 IP Address Host Name Ethernet Port Direct Connection ES Connection Channel List Em No Specification Other Station Other Station 3 Single Network Co existence Network PLC Direct Coup
33. csi E E IN CHAPTER 8 FILE TRANSFER FUNCTION FTP 8 1 Setting for FTP Communication 0 0 0 ce ee 8 2 Files Transferable Using FIP 2 0 0 0 cee eee eee 8 3 Files That Can Be Deleted Using FIP 000005 0 4 jPIP CommandsS 6 46 oy awe oes an See eee aida SAk List On FEF Commands iyo pcx dnaned wina np art amon e aoe 8 4 2 Howto specify an FTP command 00 cee eee eee 8 4 3 Details of FTP commands 00 0 eee Oo iPreCaullOns 254420 da as sa da aaa a Sees CHAPTER 9 REMOTE PASSWORD 9 1 Communication Using Remote Password 0 000 eee eens 9 2 Remote Password Setting o ooooooooooonasn 99 E AA ae ate hike ee Ae e Oe Seow ee ee 9 4 Detection of Unauthorized Access and Actions 05 CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION TOT Seting Metodo ns nears A Saeko See ee 10 2 Program to check communications 0 0000 cee eee eee 10 3 DIAQNOSUCS raa e en ose ae a AS dra o BSS Gee ee ee 10 4 Errors related to the simple PLC communication function 10 5 Precautions sd ee dls Se a dee e A os cal es APPENDICES Appendix 1 Operation Processing Time for Each Instruction Appendix 2 Port Numbers Used by System 0000s eee eee Appendix 3 Added and Changed Functions 0 0 00 c eee ees Appendix 4 Performance List of Simple PLC Communication Function INDEX
34. depending on the system configuration parameter settings and or program size Design circuits so that the entire system will always operate safely regardless of the time Installation Precautions N WARNING O Shut off the external power supply for the system in all phases before mounting or removing a module Failure to do so may result in electric shock or cause the module to fail or malfunction Installation Precautions N CAUTION Use the programmable controller in an environment that meets the general specifications in the MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection Failure to do so may result in electric shock fire malfunction or damage to or deterioration of the product To interconnect modules engage the respective connectors and securely lock the module joint levers Incorrect interconnection may cause malfunction failure or drop of the module Do not directly touch any conductive parts and electronic components of the module Doing so can cause malfunction or failure of the module Securely connect an extension cable to the connectors of a branch module and an extension module After connections check that the cable is inserted completely Poor contact may cause malfunction Wiring Precautions WARNING O Shut off the external power supply for the system in all phases before wiring Failure to do so may result in electric shock or cause the module to fail or
35. for l l no communications SUOIJCOIUNWIWOD YOSYD O WwesBOld COL CE ee ee A A ee M200 MO M100 i Processing when Perform processing for E l e i 7 D1000 H2 E a successful communications i with On Request set RS A ee TO I I x r Processing if communications Perform processing for gt D1000 H4 fai a i i a ated mit On Request set Y communication failure da gt ee ee ee E D1000 H3 me O 127 10 3 Diagnostics The communication status of the simple PLC communication function can be checked in Simple PLC Communication Status tab of the Ethernet Diagnostics dialog box KO Diagnostics gt Ethernet Diagnostics For detail on Ethernet diagnostics refer to the following GX Works2 Version1 Operating Manual Common 10 4 Errors related to the simple PLC communication function If an error related to this function occurs it is not regarded as a diagnostic error in the CPU module Instead the simple PLC communication status the corresponding error code is stored 1 Errors caused by the operation status of the CPU module or the operations of each function The errors are not stored in the history of Ethernet diagnostics Error ae i code After the values in Device of PLC Parameter of the CPU module where the When the parameters ae Power off and on the CPU simple PLC communication function had 4900H are written from the module Or reset the CPU been set were cha
36. gt Mae SD1282 0 SD1284 0 SD1288 A 4 4 MOVP HO D100 Setting Execution completion type to 0 SP SOCOPEN U0 K1 D100 M100 Connection No 1 open M100 M101 l SET M1002 Normal completion M101 HAL SET M1003 Error completion lt lt Data sending gt gt fal SD1282 0 K6 D300 Setting send data length H3412 D301 H7856 D302 Setting send data HOBC9A D303 SP SOCSND U0 D300 M300 Sending data to Connection No 1 M300 M301 SET M3002 Normal completion M301 E SET M3003 Error completion lt lt Data receiving gt gt SD1282 0 SD1286 0 M500 ae o 25 SP socrcv UO K1 D5000 D500 M500 Receiving data M500 M501 SET M5002 Normal completion M501 SET M5003 Error completion lt lt Connection No 1 close processing gt gt SD1 ee 0 SD1284 0 PLS M4001 Processing for disconnection by the target ser sata y ali y SP SOCCLOSE U0 Ki D200 M200 Connection No 1 close M4001 SET M4004 Setting closing flag M200 M201 SET M4002 Normal completion AAA A M4003 Error completion RST M4004 Resetting closing flag END 4 There are two kinds of TCP receive modes TCP standard receive mode and TCP fixed length receive mode For fixing the data size run the program enclosed by a dotted line It can be omitted when the data size is not fixed For the TCP receive mode refer to the section for the SP SOCRMODE instruction _ gt Page 82 Section 6 4 8 44 CHAPTER 6 SOCKET COMMUNICATION FUNCTION d
37. hub or the interfacing device in advance when setting time at the timing of CPU module power on or reset O The time setting results can be checked with the special register SD1270 to SD1275 O During execution of the time setting function other time setting operations are ignored Access through routers is also available When configuring the settings for it set the subnet mask pattern and default router IP address lt _ gt Page 25 Section 3 4 8 7 1 Setting Method Configure the time settings in the Built in Ethernet port tab of the PLC parameter dialog box XO Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting gt Time Setting Built in Ethernet Port Time Setting ime Setting SNTF Function Setting Used SNTP Server IP Address 192 168 oj zoo Input Format DEC Time Zone GMT 00 lf Execute time setting at burn ON reset At Error Decurence Stop Execution Interval Arte f Execution Time 112 E oo Default Check Cancel Item Description SNTP Function Setting Select whether to use this function or not SNTP Server IP Address Specify the IP address of the SNTP server Time Zone Standard Time GMT 9 00 is set by default Execute time setting at turn ON Select whether to execute the time setting function upon power on or reset reset of the CPU module At Error Occurrence detected upon power o
38. malfunction O After installation and wiring attach the included terminal cover to the module before turning it on for operation Failure to do so may result in electric shock Wiring Precautions N CAUTION Ground the FG and LG terminals to the protective ground conductor dedicated to the programmable controller Failure to do so may result in electric shock or malfunction Use applicable solderless terminals and tighten them within the specified torque range If any spade solderless terminal is used it may be disconnected when a terminal block screw comes loose resulting in failure Check the rated voltage and terminal layout before wiring to the module and connect the cables correctly Connecting a power supply with a different voltage rating or incorrect wiring may cause a fire or failure Connectors for external devices must be crimped or pressed with the tool specified by the manufacturer or must be correctly soldered Incomplete connections may cause short circuit fire or malfunction Securely connect the connector to the module Do not install the control lines or communication cables together with the main circuit lines or power cables Failure to do so may result in malfunction due to noise Place the cables in a duct or clamp them If not dangling cable may swing or inadvertently be pulled resulting in damage to the module or cables or malfunction due to poor contact Check the interface type and correctly connect the
39. of connection No 1 which is open is changed e Devices used Device number Application D1282 Open completion signal D400 SP SOCCSET instruction control data e Program M4000 SD1282 0 i DMOVP HOA6155DE D402 Setting target IP address to 10 97 85 222 MOVP H2001 D404 Setting port No of target device to 8193 U0 K1 D400 Changing setting of Connection No 1 END 81 14S9090S dS dl dan uonssuuos e jo Jobe ay Buibuey py 9 suo 9n4su UOIOUN y UOI EDIUNWWOD JaNDOS y 9 6 4 8 Changing the receive mode of a connection SP SOCRMODE a SP SOCRMODE SPSOCRMODE uo amp 82 Settin Internal device Constant 9 UDGO Others data K H 1 Setting data 6 Connection number Setting range 1 to 16 BIN 16 bit 62 Start number of the device from which control data are stored User System Device name 4 The Set by column indicates the following User The data must be set before executing the SP SOCRMODE instruction System The CPU module stores the execution result of the SP SOCRMODE instruction 2 Control data ee ee eee E ee oe eee E E Completion status is stored Completion 62 1 a 0000H Completed System Other than 0000H Failed Error code TCP receive TCP receive mode is alee 62 2 de 0 TCP standard receive mode 0 or 1 did 1 TCP fixed length receive mode User Receive data size in the socket communication Receive data size 1 to 2046 is stored in bytes
40. on or reset the CPU module to enable the parameters CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT 3 2 Setting for the Programming Tool Configure the settings in the Transfer Setup dialog box W Connection Destination window 2 gt Connection1 PC side I F A ii CCIE Cont Li Ethernet Sere PLC AF NET 10 H Board Bus Board Board Board Network No 1 Station No 1 Proto F PLC side I F E N CCIE Cont CC Li Ethernet C24 GOT 46 Q6TEL Bus NET 10 H Module Module a 2 PLC Mode LCPU 1 a IP Address Host Name 0 0 0 0 Other F Station Connection Channel List Setting s No Specification Other Station Other Station j Single Network Co existence Network PLC Direct Coupled Setting 3 Time Out Sec 30 Retry Times 0 Network PLC Type Communication 25 Route CC IE Cont Ethernet CC Link C24 NET II NET 10 H System Image Co existence Network Route CC IE Cont Ethernet CC Link C24 NET II NET 10 H Cancel Connection Test Accessing Host Station EENE 1 Select Ethernet Board for PC side I F In the PC side IF Ethernet Board Setting dialog box select a TCP or UDP protocol gt Page 21 Section 3 1 Select the same protocol as the one set in the Open Setting dialog box PC side I F Ethernet Board Setting Network No 1 Station No 1 Cancel This is the layout setting layout for the Ethernet board Please execute the following setting
41. port and before no response is returned the new request message will be discarded e Setting the same host station port number for multiple UDP connections is regarded as one setting For communication with multiple devices using the same host station port number select TCP 5 File access during MC communication The CPU module will perform file access processing prior to Ethernet communication processing Because of this processing of the MC protocol function may be delayed if a file is accessed by FTP or a programming tool during use of the MC protocol function When accessing a file while response time monitoring is performed on the connected device with the MC protocol function add the time required for file access to the monitoring time CHAPTER 5 MC PROTOCOL COMMUNICATION 6 Receiving a response message The following shows an example of receive processing on the other device side Communication processing on the other device side Request message send processing Response message receive processing Is TCP connection open Received data within the time specified by the monitoring timer value YES Check the received data size Sufficient receive data size Processing for the response message Was the entire received message processed YES Error handling en w y D O Cc O m 10 Point For Ethernet communication TCP socket functions are used inside pers
42. than 0000 Failed Error code Completion status UOFONSU UOPOUN 4 UOPEOUNWWOD JAPOS y 3S010908 dS vonyoeuuos e buypeuuo9sid is instruction closes a connection specified in 61 Disconnection of a connection The result of the SP SOCCLOSE instruction can be checked with the completion device 0 and 1 Completion device 0 Turns on in the END processing of a scan after completion of the SP SOCCLOSE instruction and tums off in the next END processing Completion device 1 Turns on or off according to the result of the SP SOCCLOSE instruction Tums on in the END processing of a scan after completion of the SP SOCCLOSE instruction and turns off in the next END processing A detection of an operation error tums on the Error flag SMO and a corresponding error code is stored in SDO when The connection number specified for is other than 1 to 16 Error code 4101 The device numbers specified for amp and exceed the device point range Error code 4101 An invalid device is specified Error code 4004 Program example When M2000 is tumed on or when the connected device disconnects connection No 1 connection No 1 is disconnected by the following program Device used SP SOCCLOSE instruction control data SP SOCCLOSE instruction completion device Program 5012820 A Processing for dscomecton of Cormecton Na thy the target magoo 501282 0 Mee Cormecton No 1 dose SP SOOOLO
43. the SP SOCRCV instruction to the execution command at the normally closed contact 69 AONOOS dS Bulssasdold GNF 24 U ejep paaregal no Buipeay y 9 suo 9n4su uonouny UOI EDIUNWWOD ey490S y 9 6 4 4 Reading out received data during instruction execution S SOCRCVS Command S SOCRCVS J _ssocrcvs uo Setting data a gt o y O ol leleoel gt o gt 1 Setting data Connection number Setting range 1 to 16 BIN 16 bit Start number of the device from which received data are D Stored System Device name 4 The Set by column indicates the following User The data must be set before executing the S SOCRCVS instruction System The CPU module stores the execution result of the S SOCRCVS instruction 2 Control data sc IA O The length of the data which were read out from Receive data D 0 the Socket communication receive data area is O to 2046 stored in bytes length System D 1 The data which were read out from the Socket to Receive data communication receive data area are stored in D n ascending order of addresses 2 The Set by column indicates the following System The CPU module stores the execution result of the S SOCRCVS instruction 70 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 3 Function This instruction reads out received data of the connection specified in from the Socket communication receive data
44. 0 ON When failed tte 1 scan when normally completed Completion device D 1 I I I I I I I I I I I I I I aeee i close i 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when The connection number specified for is other than 1 to 16 Error code 4101 The device numbers specified for 62 and exceed the device point range Error code 4101 e An invalid device is specified Error code 4004 Do not use Passive open for execution of the SP SOCCLOSE instruction Doing so will turn off the Open completion signal and Open request signal of the connection and cause close processing which disables data transfer SUO ONIJSU UOIOUN UOIeoJUnuIWOo 18y90S y 9 4SO01090S dS vonoauuos e Bunoauuo9sig Z 7 9 65 66 5 Program example When M2000 is turned on or when the connected device disconnects connection No 1 connection No 1 is disconnected by the following program e Devices used Device number Application D1282 Open completion signal SD1284 Open request signal D200 SP SOCCLOSE instruction control data M200 SP SOCCLOSE instruction completion device e Program SD1282 0 SD1284 0 l pH E m TS M161 Processing for disconnection of M2000 SD1282 0 M210 M200 M210 M200 M201 M202 M202 M210 END Connection No 1by the target Connection No 1 close Setting SP SOCCLOSE executing f
45. 00 D301 D302 D303 M300 M302 M303 END Setting send data length gt Setting send data Sending data to Connection No 1 Normal completion Error completion CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6 4 6 Reading out connection information SP SOCCINF Command SPSOCCINE f 1 pa data UO Dummy O Character string 6 TO number Setting range 1 to 16 BIN 16 bit 62 Start number of the device from which control data are stored number of the device from which control data are stored a necia number of the device from which connection information System Device name O is stored 1 The Set by column indicates the following User The data must be set before executing the SP SOCCINF instruction System The CPU module stores the execution result of the SP SOCCINF instruction SUON JONIJSU UOIOUN y UOI EDIUNWWOD JONDOS y 9 4NI990S AS YOHeWJOJU uonoauuoo jno Bulpeay 9 y 9 2 Control data 23 0 62 1 0 D 0 2 3 Or Completion status Target device IP address Target device port number Host station port number Application setting area Pee Completion status is stored 0000H Completed Other than 0000H Failed Error code 1H to FFFFFFFFH OH No target FFFFFFFFH Simultaneous IP address of the target device is stored broadcast 1H to FFFFH oo FFFFH Port number of the target device is stored Simultaneous bro
46. AST REPRESENTATIVES ILAN amp GAVISH Ltd ISRAEL 24 Shenkar St Kiryat Arie IL 49001 Petah Tiqva Phone 972 0 3 922 18 24 Fax 972 0 3 924 0761 GIRIT CELADON LTD 12 H aomanut Street IL 42505 Netanya Phone 972 0 9 863 39 80 Fax 972 0 9 885 24 30 CEG INTERNATIONAL Cebaco Center Block A Autostrade DORA Lebanon Beirut Phone 961 0 1 240 430 Fax 961 0 1 240 438 AFRICAN REPRESENTATIVE CBI Ltd SOUTH AFRICA Private Bag 2016 ZA 1600 Isando Phone 27 0 11 9770770 Fax 27 0 11 977 0761 ISRAEL LEBANON Mitsubishi Electric Europe B V FA European Business Group Gothaer Stra e 8 D 40880 Ratingen Germany FACTORY AUTOMATION Tel 49 0 2102 4860 Fax 49 0 2102 4861 120 info mitsubishi automation com www mitsubishi automation com
47. C L CPU Module User s Manual Function Explanation Program Fundamentals 121 poyan Bumas 101 a Timing of write or read of the device data The data of a bit device and a word device set for each setting No are communicated in the END processing Even so depending on the destination device for communications data communications for one setting may not be done completely resulting in data inconsistency Destination device for Device data communications MELSEC Q L Built in Ethernet Function MELSEC Q Ethernet Module MELSEC QnA Ethernet Module MELSEC A Ethernet Module 122 d 2 3 Data of a bit device and a word device are guaranteed to be communicated by setting unit Data of a bit device Data of a word device are guaranteed to be are guaranteed to be communicated by communicated by setting unit setting unit Within the setting i Within the setting range data of a bit range data of a word device are device are guaranteed to be guaranteed to be communicated in units of 32 bits 2 words communicated in units of 2 words Data inconsistency for one setting Data inconsistency of a bit device and a word device is the same level because the data of both devices are communicated at the same timing If both a bit device and a word device are set for the same setting No the level of data inconsistency of both devices may be different because th
48. CSET instruction System The CPU module stores execution result of the SP SOCCSET instruction 80 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 3 Function This instruction changes the IP address and port number of the target device of which connection is specified in 6 Note that this instruction is available only for UDP IP communications Point O The target device can be changed without closing the connection by using the SP SOCCSET instruction O The set values take effect at the following SP SOCCSET instruction execution timing When data exist in the socket communication receive data area After execution of the SP SOCRCV or S SOCRCVS instruction only once after execution of the SP SOCCSET instruction e When no data exists in the socket communication receive data area After execution of the SP SOCCSET instruction 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when The connection number specified for 6 is other than 1 to 16 Error code 4101 The device number specified for 62 exceeds the device point range Error code 4101 e An invalid device is specified Error code 4004 5 Precaution Do not change the target device using the SP SOCCSET instruction during execution of the SP SOCSND instruction 6 Program example When M4000 is turned on the connection destination IP address and port number of the target device
49. E Input Format DEC y FTP Setting s IP Address 192 168 3 39 Time Setting Subnet Mask Pattern Time Seng Defaut Router IP Addes TT Td atti needed Default Changed Communication Data Code Binary Code C ASCII Code T Enable online change FTP MC Protocol Disable direct connection to MELSOFT Do not respond to search for CPU Built in Ethernet port on network The items indicated in green are set in MELSOFT Navigator Print Window Print Window Preview Acknowledge XY Assignment Default Check Cancel 1 Set the IP address of the CPU module 2 Set MELSOFT connection TZ Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting gt Open Setting Built in Ethernet Port Open Setting Protocol TCP Connection ee percal qt il DP Ee NO O cP MC Protocol x A MELSOFT Connection OoOo vil O One Or ELSOFT Connection ELSOFT Connection ELSOFT Connection ELSOFT Connection j O TU M M M M Host station port No destination port No Please input in HEX caos Item Setting Protocol Select TCP or UDP depending on the connected device Open System Select MELSOFT Connection 21 BINPOW NAO 94 104 Bulnes 22 2 Writing to the CPU module From the Write to PLC screen write the parameter settings to the CPU module O Online gt Write to PLC After writing the parameters to the CPU module power off and
50. Fax 81 3 622 160 75 MITSUBISHI ELECTRIC AUTOMATION Inc 500 Corporate Woods Parkway Vernon Hills IL 60061 Phone 1 847 478 21 00 Fax 1 847 478 22 53 EUROPE FRANCE IRELAND ITALY POLAND RUSSIA SPAIN JAPAN USA MITSUBISHI ELECTRIC GEVA Wiener Stra e 89 AT 2500 Baden Phone 43 0 2252 85 55 20 Fax 43 0 2252 488 60 TECHNIKON Oktyabrskaya 19 Off 705 BY 220030 Minsk Phone 375 0 17 210 46 26 Fax 375 0 17 210 46 26 ESCO DRIVES amp AUTOMATION Culliganlaan 3 BE 1831 Diegem Phone 32 0 2 717 64 30 Fax 32 0 2 717 64 31 Koning amp Hartman b v Woluwelaan 31 BE 1800 Vilvoorde Phone 32 0 2 257 02 40 Fax 32 0 2 257 02 49 INEA RBT d 0 0 BOSNIA AND HERZEGOVINA Aleja Lipa 56 BA 71000 Sarajevo Phone 387 0 33 921 164 Fax 387 0 33 524 539 AKHNATON 4 Andrei Ljapchev Blvd PO Box 21 BG 1756 Sofia Phone 359 0 2 817 6000 Fax 359 0 2 97 44061 INEA RBT d 0 0 Losinjska 4 a HR 10000 Zagreb Phone 385 0 1 36940 01 02 03 Fax 385 0 1 36 940 03 AutoCont C S s r o Technologick 374 6 CZ 708 00 Ostrava Pustkovec Phone 420 595 691 150 Fax 420 595 691 199 Beijer Electronics A S Lykkeg rdsvej 17 DK 4000 Roskilde Phone 45 0 46 75 76 66 Fax 45 0 46 75 56 26 Beijer Electronics Eesti OU P rnu mnt 160i EE 11317 Tallinn Phone 372 0 6 51 81 40 Fax 372 0 6 5181 49 Beijer Electronics
51. Item Setting Protocol TCP Open System Socket Communication TCP Connection Unpassive Host Station Port No 1000H Setting range 0001H to 1387H 1392H to FFFEH 2 Destination IP Address Blank Setting range 0 0 0 1 to 223 255 255 254 Destination Port No Blank Setting range 0001H to FFFEH 4 When Fullpassive is selected for TCP Connection a value must be set gr Since used by the system 1388H to 1391H cannot be set lt gt Page 134 Appendix 2 46 CHAPTER 6 SOCKET COMMUNICATION FUNCTION b Devices used in the program The following table lists the device numbers and applications used in the sample program Device number M3000 D3000 and D3001 M300 and M301 D300 to D303 M3002 M3003 D400 to D403 SD1282 SD1286 D5000 and D5001 M500 and M501 D500 and higher M5002 M5003 D6000 and D6001 D6010 to D6014 Application Send direction SP SOCSND instruction control data SP SOCSND instruction completion device Send data length and send data 6 bytes of 12H 34H 56H 78H 9AH and BCH Normal send indication Send error indication SP SOCRMODE instruction control data Open completion signal Receive state signal SP SOCRCV instruction control data SP SOCRCV instruction completion device Receive data length and receive data Normal receive indication Receive error indication SP SOCCINF instruction control data SP SOCCINF instruction completion device 47 dol Buisn UOIJESIUNWLWWOD 9 c Sample
52. MITSUBISHI Mitsubishi Programmable Controller MELSEG L MELSEC L CPU Module User s Manual Built In Ethernet Function gt f series lt lt lt Q gt LO2CPU LO2CPU P L26CPU BT L26CPU PBT SAFETY PRECAUTIONS Read these precautions before using this product Before using this product please read this manual and the relevant manuals carefully and pay full attention to safety to handle the product correctly In this manual the safety precautions are classified into two levels A WARNING and AN CAUTION NWARNING Indicates that incorrect handling may cause hazardous conditions resulting in death or severe injury Indicates that incorrect handling may cause hazardous conditions J N CAUTION resulting in minor or moderate injury or property damage Under some circumstances failure to observe the precautions given under A CAUTION may lead to serious consequences Observe the precautions of both levels because they are important for personal and system safety Make sure that the end users read this manual and then keep the manual in a safe place for future reference Design Precautions N WARNING O Configure safety circuits external to the programmable controller to ensure that the entire system operates safely even when a fault occurs in the external power supply or the programmable controller Failure to do so may result in an accident due to an incorrect output or ma
53. NWWOD ey490S y 9 AONOOS dS Bulsses0sd GNF 24 U ejep p r no Buipeay y 9 6 3 Function This instruction reads out received data of the connection specified in from the Socket communication receive data area in the END processing after execution of the SP SOCRCV instruction CPU module Receive data 0 length 9 Socket icati ocket communication 0 0 1 Receive data receive data area al asa eo An External device No specified by61 mm SP SOCRCV Receiving Reading receive data Be The result of the SP SOCRCV instruction can be checked with the completion device 63 0 and 63 1 e Completion device 63 0 Turns on in the END processing of the scan after completion of the SP SOCRCV instruction and turns off in the next END processing e Completion device 03 1 Turns on or off according to the result of the SP SOCRCV instruction State Description When completed Remains off When failed Turns on in the END processing of the scan after completion of the SP SOCRCV instruction and turns off in the next END processing The following figure shows the timing of reception processing with the SP SOCRCV instruction O Data pen transmission Data read processing processing processing ON Open completion OFF signal SD1282 n END END END processing processing processing Sequence program a AR instruction execution l ON Reception status FF signal SD1286 n SP SOCRCV
54. OPERATED OR USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS PRECAUTIONS OR WARNING CONTAINED IN MITSUBISHI S USER INSTRUCTION AND OR SAFETY MANUALS TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT Prohibited Application Prohibited Applications include but not limited to the use of the PRODUCT in e Nuclear Power Plants and any other power plants operated by Power companies and or any other cases in which the public could be affected if any problem or fault occurs in the PRODUCT e Railway companies or Public service purposes and or any other cases in which establishment of a special quality assurance system is required by the Purchaser or End User e Aircraft or Aerospace Medical applications Train equipment transport equipment such as Elevator and Escalator Incineration and Fuel devices Vehicles Manned transportation Equipment for Recreation and Amusement and Safety devices handling of Nuclear or Hazardous Materials or Chemicals Mining and Drilling and or other applications where there is a significant risk of injury to the public or property Notwithstanding the above restrictions Mitsubishi may in its sole discretion authorize use of the PRODUCT in one or more of the Prohibited Applications provided that the usage of the PRODUCT is limited only for the specific applications agreed to by Mitsubishi and provided further that no special quality assurance or fail safe redundant or other safety features which
55. OY Peltoie 37 FIN 28400 Ulvila Phone 358 0 207 463 540 Fax 358 0 207 463 541 UTECO 5 Mavrogenous Str GR 18542 Piraeus Phone 30 211 1206 900 Fax 30 211 1206 999 MELTRADE Kft Fert utca 14 HU 1107 Budapest Phone 36 0 1 431 9726 Fax 36 0 1 431 9727 Beijer Electronics SIA Ritausmas iela 23 LV 1058 Riga Phone 371 0 784 2280 Fax 371 0 784 2281 Beijer Electronics UAB Savanoriu Pr 187 LT 02300 Vilnius Phone 370 0 5 232 3101 Fax 370 0 5 232 2980 AUSTRIA BELARUS BELGIUM BELGIUM BULGARIA CROATIA CZECH REPUBLIC DENMARK ESTONIA FINLAND GREECE HUNGARY LATVIA LITHUANIA e MITSUBISHI ELECTRIC ALFATRADE Ltd 99 Paola Hill Malta Paola PLA 1702 Phone 356 0 21 697 816 Fax 356 0 21 697 817 INTEHSIS srl bld Traian 23 1 MD 2060 Kishinev Phone 373 0 22 66 4242 Fax 373 0 22 66 4280 HIFLEX AUTOM TECHNIEK B V Wolweverstraat 22 NL 2984 CD Ridderkerk Phone 31 0 180 46 60 04 Fax 31 0 180 44 23 55 Koning Hartman b v Haarlerbergweg 21 23 NL 1101 CH Amsterdam Phone 31 0 20 587 76 00 Fax 31 0 20 587 76 05 Beijer Electronics AS Postboks 487 NO 3002 Drammen Phone 47 0 32 24 30 00 Fax 47 0 32 84 85 77 Fonseca S A R Jo o Francisco do Casal 87 89 PT 3801 997 Aveiro Esgueira Phone 351 0 234 303 900 Fax 351 0 234 303 910 Sirius Trading amp Serv
56. SE Uo Ki D200 ay L ser Setfing SP SOCCLOSE ing fag M SET Normal compilation Eror competion Resefing SPSOCCLOSE Execution condition of the instruction Structure of the instruction in the ladder mode Setting side User Device value is set by the user System Device value is set by the CPU module 13 14 e Instructions can be executed under the following conditions a On the falling On the falling Execution condition Any time edge edge e The following devices can be used Internal device Link direct device Intelligent TR Setting system user File JO O function distal ONES er data register module Zn UO GO Applicable YMLS TST C D W iene M F B SB F SD SW FD R ZR VUOIGO Z at device i L TR BL X FY ad a 4 For details on each device refer to the following MELSEC L CPU Module User s Manual Function Explanation Program Fundamentals 2 FX and FY can be used for bit data only and FD for word data only 3 In the Constant and Others columns a device s that can be set for each instruction is shown e The following data types can be used Data type Description Bit Bit data or the start number of bit data BIN 16 bit 16 bit binary data or the start number of word device BIN 32 bit 32 bit binary data or the start number of double word device BCD 4 digit Four digit binary coded decimal data BCD 8 digit Eight digit binary coded decimal data Real numb
57. Section 10 1 3 b IP Address Set the IP address of the device 0 0 0 1 to 223 255 255 254 Port No Set the port No of the device 0401 to 13874 13924 to FFFEy Network No Set the network No of the device host station 1 to 239 Station No Set the station No of the device 1 to 64 If a remote password is set for the destination a l 4 characters or less one byte Remote Password device the communication is possible by entering alphanumeric and special characters the password Host Station Port No Set the port No of the host station 04014 to 13874 13924 to EFFF y Host Station No Set the station No of the host station 1 to 64 4 Set the station number not to overlap the numbers set for other devices on the same Ethernet network such as Ethernet module programming tool and GOT Point If the L Q QnA series modules are used for the simple PLC communication FOO0 to FFFEy is automatically selected for the port No of the host station Therefore when using the simple PLC communication function do not set FOOO to FFFE to Host Station Port No for the establishing a connection instruction SP SOCOPEN of the socket communication function If FOOOy to FFFE is set the instruction may not be completed properly CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION b Model Type List The following table shows the communication devices and specifications applicable to each model MELSEC Q L Built in Ethernet QCPU
58. Setting the communications for the specified setting No temporarily stop when Request Contact Device to Stop Fixed Interval Communication turns on The communications re start when Request Contact Device to Stop Fixed Interval Communication turns off The ON OFF status is confirmed in the END processing This stop request is enabled when the communication status is Communicating or Error 1 Request Contact Device to Stop Fixed Interval Communication cannot be specified overlapped with the following devices e Request Contact e Execution Status Flag Device e Source device when the host station is a transmission destination device e Request Contact that is used for other setting No e Execution Status Flag Device that is used for other setting No e Source device when the host station is a transmission destination device which is used for other setting No Point When communications are stopped by the request to stop fixed interval communication the data communications at a specified execution interval which is performed when Fixed Interval is set for Communication Setting is ignored The stop time by the request to stop fixed interval communication is not counted as Execution Interval Current Value O ifthe communications are stopped by the request to stop fixed interval communication during retry of communication the retry count is reset to 0 7 Execution Status Flag Device Select the device from X M B and specify
59. Stra e 8 D 40880 Ratingen Phone 49 0 2102 486 0 Fax 49 0 2102 486 1120 MITSUBISHI ELECTRIC EUROPE B V org sl CZECH REP Czech Branch Avenir Business Park Radlick 714 113a CZ 158 00 Praha 5 Phone 420 251 551 470 Fax 420 251 551 471 MITSUBISHI ELECTRIC EUROPE B V French Branch 25 Boulevard des Bouvets F 92741 Nanterre Cedex Phone 33 0 1 55 68 55 68 Fax 33 0 1 55 68 57 57 MITSUBISHI ELECTRIC EUROPE B V Irish Branch Westgate Business Park Ballymount IRL Dublin 24 Phone 353 0 1 4198800 Fax 353 0 1 4198890 MITSUBISHI ELECTRIC EUROPE B V Italian Branch Viale Colleoni 7 1 20041 Agrate Brianza MB Phone 39 039 60 53 1 Fax 39 039 60 53 312 MITSUBISHI ELECTRIC EUROPE B V Poland Branch Krakowska 50 PL 32 083 Balice Phone 48 0 12 630 47 00 Fax 48 0 12 630 47 01 MITSUBISHI ELECTRIC EUROPE B V 52 bld 3 Kosmodamianskaya nab 8 floor RU 115054 Moscow Phone 7 495 721 2070 Fax 7 495 721 2071 MITSUBISHI ELECTRIC EUROPE B V Spanish Branch Carretera de Rubi 76 80 E 08190 Sant Cugat del Vall s Barcelona Phone 902 131121 34 935653131 Fax 34 935891579 MITSUBISHI ELECTRIC EUROPE B V UK UK Branch Travellers Lane UK Hatfield Herts AL10 8XB Phone 44 0 1707 27 6100 Fax 44 0 1707 27 86 95 MITSUBISHI ELECTRIC CORPORATION Office Tower Z 14 F 8 12 1 chome Harumi Chuo Ku Tokyo 104 6212 Phone 81 3 622 160 60
60. TP client 1 FTP server support commands binary Function Specification format Notifies the FTP server of file transfer without conversion Neither return codes nor kanji codes are converted This command is set automatically in the CPU module binary abbreviated to bin bye Function Disconnects the line to the FTP server and terminates the FTP session Specification format bye Identical command quit Specification format Example close s5 Function Disconnects the line to the FTP server gt in Specification format close g y y O 7 3 2 3 Odelete 71 2 Za Function Deletes a file stored in the CPU module g i 3 mD a Similar command dir Function Specification format Example Similar command delete file path name When deleting a file stored in an SD memory card delete 2 MAINSEQ1 USR mdelete Displays the names creation dates and sizes of the files stored in the CPU module dir drive name When displaying the detailed information of the files stored in an SD memory card dir 2 Is 99 Oget Function Specification format Example 1 Example 2 Note Function Specification format Example Similar command mdelete Function Specification format Example Similar command emdir Function Specification format Example Note Similar command Reads a file from the CP
61. U module get source file path name destination file path name When reading a file stored in the standard RAM and saving it under the same file name get 3 MAINSEQ1 QDR When reading a file stored in the standard RAM and saving it under a different file name get 3 SEQ1BAK QDR ISEQISEQ10LD QDR e When no destination file path name FTP client side is specified the file is saved in the FTP client using the same source file name CPU module side e The transfer destination is on the current directory where FTP is started up and connected to the server Displays the names of the files stored in the CPU module Is drive name When displaying the names of the files stored in an SD memory card Is 24 dir Deletes a file stored in the CPU module To delete multiple files specify the file name and extension within the file path name using a wild card character or mdelete file path name abbreviated to mdel When deleting all the files whose extensions are QPG from the program memory mdelete 0 QPG delete Saves detailed information file names creation dates and sizes of the files stored in the CPU module as log data into a file on the FTP client side mdir source drive name destination file path name When saving detailed information of the files stored in an SD memory card into the S990901 LOG file mdir 21 S990901 LOG e Type immediately after the source drive name e Specify a source drive name wh
62. adcast 1H to 1387H 1392H to FFFEH 3 Port number of the host station is stored b15b14b13 to b10 b9 b8 b7 to bO 81 o kam 0 i 1 Communication method protocol 0 TCP IP 1 UDP IP 2 Socket communication procedure 1 Nonprocedural fixed 3 Open system 00 Active open or UDP IP 10 Unpassive open 11 Fullpassive open 2 The Set by column indicates the following System The CPU module stores the execution result of the SP SOCCINF instruction 3 Host station port numbers 0001H to O3FFH are assigned for reserved port numbers WELL KNOWN PORT NUMBERS and FOOOH to FFFE are for other communication functions Therefore using 0400H to 1387H and 1392H to EFFFH is recommended 3 Function Page 134 Appendix 2 This instruction reads out connection information specified in 4 Error Set by 2 System A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when e The connection number specified for 6 is other than 1 to 16 Error code 4101 e The device numbers specified for 62 and exceed the device point range Error code 4101 e An invalid device is specified 78 Error code 4004 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 5 Program example When M5000 is turned on connection information of connection No 1 is read out e Devices used Device number Application D500 SP SOCSND instruction contro
63. and replacement of a power supply module must be performed by qualified maintenance personnel with knowledge of protection against electric shock For wiring methods refer to the MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection Startup and Maintenance Precautions N WARNING O Do not touch any terminal while power is on Doing so will cause electric shock or malfunction O Correctly connect the battery connector Do not charge disassemble heat short circuit solder or throw the battery into the fire Also do not expose it to liquid or strong shock Doing so will cause the battery to produce heat explode ignite or leak resulting in injury and fire O Shut off the external power supply for the system in all phases before cleaning the module or retightening the terminal block screw Failure to do so may result in electric shock Startup and Maintenance Precautions N CAUTION O Before performing online operations especially program modification forced output and operating status change for the running CPU module from the peripheral device connected read relevant manuals carefully and ensure the safety Improper operation may damage machines or cause accidents Do not disassemble or modify the modules Doing so may cause failure malfunction injury or a fire Use any radio communication device such as a cellular phone or PHS Personal Handy phone System more than 25cm away in all direction
64. aneous broadcast Use a CPU module IP address of which all the bits corresponding to the host address are on When the subnet musk pattern is specified apply the pattern before using the above mentioned IP address Ex IP address of the CPU module side 64 168 3 39 Subnet mask pattern i None IP address of simultaneous broadcast 64 255 255 255 Ex IP address of the CPU module side 64 168 3 39 Subnet mask pattern 255 255 255 0 IP address of simultaneous broadcast 64 168 3 255 dan Buisn uonesiunuiwoy z9 99 6 3 This section provides other precautions for the socket communication function 96 1 2 3 4 5 6 Precautions for the Socket Communication Function Port number Host station port number 0001H to O3FFH are assigned for reserved port numbers WELL KNOWN PORT NUMBERS and FOOOH to FFFEH are for other communication functions Therefore using 0400H to 1387H and 1392H to EFFFH is recommended Since used by the system 1388H to 1391H cannot be set 2 Page 134 Appendix 2 Do not specify 0014H and 0015H for the socket communication function when using the FTP function Do not specify 007BH for the socket communication function when using the time setting function SNTP Reading out received data Read out received data when the Receive state signal SD1286 has turned on Communication via the built in Ethernet port may be affected if a considerable amount of receiv
65. atches using the special relay SM1273 114 CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION CHAPTER 10simPLE PLC COMMUNICATION FUNCTION noto The simple PLC communication function allows data communications between specified devices at the specified timing just by doing simple settings from a programming tool Specify one device transmission source to one device transmission destination The communications are performed between the specified devices The communications using this function are not possible when a stop error occurs in the CPU module where the parameters are set Set the parameters Data communication is also possible between the CPU modules in which the parameters are not set In that case the data communication is done through the CPU module in which the parameters are set Ethernet LCPU Built in Ethernet port QCPU Q series CPU module A series CPU module Ethernet module Ethernet module Point The communications using this function are possible only for the CPU modules connected with Ethernet cable The following communications are not possible e Communication with a CPU module on other stations via CC Link network e Communication with a CPU module except the connected Built in Ethernet port ACPU when multiple CPU system is configured e Communication with a CPU module that does not control the connected Ethernet module when multiple CPU system is configured The c
66. ayed from PLC parameter Ethernet ollo e gt 3 LE SA a A SA a a fe ye MELSOFT devices MELSOFT devices MELSOFT devices Built in Ethernet Port Open Setting pa Frei Destination Destination a Juve v MELSOFT Connection v EL A O Set the same number of protocols as that of MELSOFT devices UDP y MELSOFT Connection AAA AAA 4 O E A EM 7 Point When all MELSOFT devices start to communicate simultaneously the communication may be difficult to succeed due to the concentration of communication In this case start each MELSOFT device at different timings not to concentrate the starts For example when using GOTs set the rising time and the communication timeout time in each GOT a oO U pn D O Cc O 10 6 Sampling trace When the sampling trace function has been executed by the programming tool from the built in Ethernet port stop the function before powering off or resetting the CPU module 7 Remote STOP or remote PAUSE When remote STOP or remote PAUSE has been implemented by the programming tool from the built in Ethernet port perform the following before powering off or resetting the CPU module e Remote RUN e Remote RESET 21 CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL SIMPLE CONNECTION The CPU module can be directly connected to the programming tool with an Ethernet cable without using a hub simple connection For direct
67. be specified Refer to 2 Renames a CPU module file rename old file path name new file path name abbreviated to ren When renaming a file stored in the standard RAM rename 3 MAINSEQ1 QDR 3 SEQ10OLD QDR Either of the following response codes is displayed upon completion 350 Need more info 250 Rename successful Inputs the user name and password of the connected FTP server user user name FTP password e User name Login name set with a CPU module parameter e FTP password FTP password set with a CPU module parameter When specifying a user name user CPU When specifying a user name and password user CPU CPU CHAPTER 8 FILE TRANSFER FUNCTION FTP 2 CPU module dedicated subcommands The CPU module dedicated subcommands affixed to an FTP command quote are described below change Function Displays or changes the attribute of a file stored in the CPU module Specification format 1 When displaying the file attribute quote change file path name Either of the following is displayed as an execution result upon completion e When the specified file is read only R e When the specified file is writable and readable W Specification format 2 When changing the file attribute quote change file path name attribute Use either of the following to specify the attribute e To change it to a read only file r e To change it to a writable and readable file w Example 1 When displaying the at
68. bited The Set by column indicates the following User The data must be set before executing the SP SOCOPEN instruction System The CPU module stores the execution result of the SP SOCOPEN instruction For the Unpassive open the IP address and port number of the target device are ignored Host station port numbers 0001H to O3FFH are assigned for reserved port numbers WELL KNOWN PORT NUMBERS and FOOOH to FFFE are for other communication functions Therefore using 0400H to 1387H and 1392H to EFFFH is recommended gt Page 134 Appendix 2 1H to FFFFFFFFH FFFFFFFFH Simultaneous broadcast 1H to FFFFH FFFFH Simultaneous broadcast Set by User System User System CHAPTER 6 SOCKET COMMUNICATION FUNCTION 3 Function This instruction opens a connection specified in 6 The set values used for the open processing is selected in 62 0 The result of the SP SOCOPEN instruction can be checked with the completion device D 0 and 1 e Completion device D 0 Turns on in the END processing of the scan after completion of the SP SOCOPEN instruction and turns off in the next END processing e Completion device D 1 Turns on or off according to the result of the SP SOCOPEN instruction State Description When completed Remains off Turns on in the END processing of the scan after the SP SOCOPEN instruction is completed and turns off When failed in the next END processing END processing END process
69. cations of the built in Ethernet port of the CPU module Item Specification Data transfer speed 100 or 10 Mbps Communication mode Full duplex or half duplex Transmission method Base band Transmission Maximum distance between hub 100 m specifications and node Maximum 10BASE T Cascade connection Up to four 2 number of nodes 100BASE TX Cascade connection Up to two 2 connection TCP IP Total of 16 for socket communications MELSOFT connections and MC Number of connections DP IP pioinee eke One for FTP 10BASE T Ethernet cable of category 3 or higher STP UTP cable Connection cable 100BASE TX Ethernet cable of category 5 or higher STP cable 4 Straight cables can be used When the CPU module is directly connected to GOT with Ethernet cable a cross cable of Category 5e or lower can also be used 2 This number applies when a repeater hub is used When using a switching hub check the number of cascaded stages with the manufacturer of the hub to be used 3 Use of STP cables is recommended in an environment with noise Hubs with 10BASE T or 100BASE TX ports can be used Up to 16 external devices can access one CPU module at the same time 4 The ports must comply with the IEEE802 3 10BASE T or IEEE802 3 100BASE TX standards Point O When connected to a hub the CPU module determines the cable used 10BASE T or 100BASE TX and the communication mode full duplex or half duplex according to the hub Set the
70. ce with the socket communication function add the time required for file access to the monitoring time CHAPTER 6 SOCKET COMMUNICATION FUNCTION 7 Checking receive data length Since no delimiter is provided for TCP communication data on the receiving end separate data blocks that are sent continuously may be combined or data sent all at once may be segmented The receive data length must be confirmed on the receiving side as necessary When data are received on the CPU side and the data length is determined the fixed length mode is recommended When receiving data on the target device side confirm the receive data length as shown below Receive processing on the other device side Received message receive processing NO Is TCP connection open YES TCP connection is closed Receive the rest of the message Received data within NO the time specified by the monitoring timer value YES Check the received data size NO Sufficient receive data size Processing for the received message NO Was the entire received message processed YES End Error handling UONOUN UOHEDIUNWWOD 18y490S 9U 10 SUONNeIa1d 9 Of 6 4 08 Socket Communication Function Instructions The socket communication function instructions are provided for the CPU module to use the socket communication function This section explains the socket communica
71. client function can directly access any files located in the CPU module CPU module FTP server Target device FTP client L Parameters Programs Storage files Data Ethernet The following operations can be performed between the connected device with the FTP client function and the CPU module a Reading files from the CPU module download The files in the CPU module can be stored in the connected device b Writing files to the CPU module upload The files stored in the connected device can be registered to the CPU module c Browsing the names of the files in the CPU module The files registered to the CPU module can be checked from the connected device Access through routers is also available When configuring the settings for it set the subnet mask and default router IP address gt Page 25 Section 3 4 90 CHAPTER 8 FILE TRANSFER FUNCTION FTP 8 1 Setting for FTP Communication 1 Operation on the CPU module side KO Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting L Parameter Setting PLC Name PLC System PLC File PLCRAS Boot File Program SFC Device 1 0 Assignment Built in Ethernet Port Setting Built in 1 0 Function Setting IP Address Setting Open Setting Input Format DEC v 1 FTP Setting 3 IP Address 192 168 Time Setting Subnet Mask Pattern Default Router IP Address Setif kie nesded D
72. communication port numbers are used to identify respective communications and thereby multiple communications are available both on TCP and UDP e For sending Specify the port number of the CPU module from which data are sent and the port number of the destination device e For receiving Specify the port number of the CPU module and read out the data sent to the port CPU module IP address xx xX xX xX Ethernet i Sending UDP data from port No A of the CPU module to port No L of external device 1 External device 1 IP address yy yy yy yy Sending UDP data from port No L of external device 1 to port No A of the CPU module i E Sending data via TCP connection AAA External device 2 IP address ZZ ZZ ZZ ZZ Sending UDP data from port No C of the CPU module to port No N of external device 3 External device 3 IP address ww ww ww ww Sending UDP data from port No N of external device 3 to port No C of the CPU module CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6 1 Communication Using TCP TCP Transmission Control Protocol establishes a connection to a device with a port number and preforms reliable data communications To perform socket communication using TCP confirm the following in advance e IP address and port number of the target device e IP address and port number of the CPU module e Which side will open a connection the target device or CPU module Active open
73. communication by disabling the connection as shown below e Select the connection in the Ethernet diagnostics dialog box and force it to be deactivated GX Works2 Version1 Operating Manual Common KO Diagnostics gt Ethernet Diagnostics gt Status of Each Connection Ethernet Diagnostics Target Module Setting Change IP Address Display cM No fist Module 1 0 Address O00 PLC No 1 gt DEC HEX Remote Unlock Forced Password Error Deactivation Status Count Status Connection No Host Station Destination Destination E atest pen Function Port No IP Address Port No atte Protocol System Disconnected Clear Latest Error Code Clear Unlock Error Coumt Disable Deactivation of Selected Row Force Deactivation of Selected Hay PING Test M f EM Stop Monitor e Turn on the force deactivation flag of the connection in the special register SD1276 SD1277 3 Clear the REMOTE PASS FAIL error error code 2700 The remote password count SD979 to SD999 is also cleared 4 Inform your system administrator that the number of unlock processing failures exceeded the limit and take appropriate actions Point If the error is detected due to frequent incorrect typing by authorized users prevent this by the following operations e Enable Clear Mismatch Count when Remote Password Matches in the Remote Password Detail Setting dialog box e Clear the accumulated count of remote password mism
74. ction TERMS Chapter 2 Section 3 5 5 1 6 1 6 2 6 3 6 4 1 6 4 3 6 4 4 6 4 5 6 4 6 8 4 2 8 5 Additions Appendix 2 July 2011 SH NA 080891ENG D Partial correction INTRODUCTION Chapter 1 Section 5 2 2 6 3 6 4 1 6 4 6 Appendix 1 Additions Chapter 10 Section 10 1 10 2 10 3 10 4 10 5 Appendix 3 Appendix 4 January 2011 September 2011 SH NA 080891 ENG E Partial correction SAFETY PRECAUTIONS RELEVANT MANUALS TERMS Chapter 2 Section 3 5 5 2 2 Japanese manual version SH 080875 E This manual confers no industrial property rights or any rights of any other kind nor does it confer any patent licenses Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual 2010 MITSUBISHI ELECTRIC CORPORATION 140 WARRANTY Please confirm the following product warranty details before using this product 1 Gratis Warranty Term and Gratis Warranty Range If any faults or defects hereinafter Failure found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company However if repairs are required onsite at domestic or overseas location expenses to send an engineer will be solely at the customer s discretion Mitsubishi shall not be held
75. ction in the program will write or read the file respectively For details refer to the following manual MELSEC Q L Programming Manual Common Instructions Page 96 Section 8 4 1 2 Files can be written to the program memory only when the CPU module is in the STOP state 3 Write destination is the program cache memory The user should back up files using the pm write command as required 4 The following number of files can be stored using FTP Maximum number of files storable on the drive 1 CHAPTER 8 FILE TRANSFER FUNCTION FTP 8 3 Files That Can Be Deleted Using FTP The following table lists the files that can be deleted using the file transfer function O Deletable A Not deletable only in RUN state x Not deletable Not writable Program Standard Standard SD memory memory ROM 4 File type 2 3 RAM y card File name or extension Intelligent functi parameter Programmable controller user 4 Arbitrary file name data Label programming invertible 030 conversion information Data logging setting file P R LOG01 QLG to LOG10 QLG ee Ca d oo f 1 1 The SP FWRITE or SP FREAD instruction in the program will write or read the file respectively For details refer to the following manual MELSEC Q L Programming Manual Common Instructions 2 Files can be written to the program memory only when the CPU module is in the STOP state 3 Write destination is the program cache memory dL4 Bui
76. ctive open The following shows a communication flow of an Active open Open processing SP SOCOPEN instruction Specify the port number of the external device waiting for TCP connection and open a connection by Active open Was data transfer YES Completed or disconnected by the external device completed Send by the SP SOCSND Close processing instruction or receive by the SP SOCCLOSE instruction SP SOCRCV or S SOCRCVS instruction a Parameter setting The following parameters are set for the sample program O Project window gt Parameter lt gt PLC Parameter 2 gt Built in Ethernet Port Setting gt Open Setting Built in Ethernet Port Open Setting Destination IP Address Port No 192 168 3 40 1000 Host station port No destination port No Please input in HE coo Item Setting Protocol TCP Open System Socket Communication TCP Connection Active Host Station Port No 1000H Setting range 0001H to 1387H 1392H to FFFEH Destination IP Address 192 168 3 40 Setting range 0 0 0 1 to 223 255 255 254 Destination Port No 1000H Setting range 0001H to FFFEH 4 Since used by the system 1388H to 1391H cannot be set lt Page 134 Appendix 2 42 CHAPTER 6 SOCKET COMMUNICATION FUNCTION b Devices used in the program The following table lists the device numbers and applications used in the sample program Device number M1000 D100 to D109 M100 and M101 M1002
77. d for reading of device data 126 CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 11 Comment Comment can be set by entering up to 32 one byte characters 16 double byte characters 12 Latency Time By setting the latency time the start timings of the communications can be shifted so that the errors due to concentration of the communications are prevented During the latency time Preparing is indicated in Communication Status Setting item Description Setting range Set the time required to start communications after Latency Time Os to 255s 1s unit completion of the CPU module startup Point Communications at a specified execution interval when Fixed Interval is set for Communication Setting or communications at the rising OFF to ON of Request Contact when On Request is set for Communication Setting are ignored during the latency time 10 2 Program to check communications This section shows the program used to check communications when On Request is set for Communication Setting 1 Devices used for the program Device number Application MO Request Contact for setting No 1 M100 Execution Status Flag Device for setting No 1 M200 Flag to check if Request Contact turns on when Status is Communicating D1000 Status Save Destination Device for setting No 1 2 Program example ij ees sey ee a Sa MO Processing if communications l i D1000 H1 were not performed with Perform processing
78. d with the remote password Or because of the remote password lock status with Unlock the remote password before communication Communication Data Code set to ASCII Code the subcommand and later part cannot be converted to a binary code The connected device is different from the one that requested for From the device that requested the unlock processing request for unlock processing of the remote password lock processing of the remote password CHAPTER 6 SOCKET COMMUNICATION FUNCTION CHAPTER 6 SOCKET COMMUNICATION FUNCTION The socket communication function allows data communications with the devices on Ethernet by TCP or UDP using various dedicated instructions Sending data SP SOCSND instruction Socket communication receive area 1 Connection No 1 l Connection No 2 SP SOCRCV instruction S SOCRCVS instruction Connection No 3 Reading receive data Receiving data Connection No 16 Program External device i bel G Gen aA 1 The area is used for storing data received from the connected open devices e For dedicated instructions used for the socket communication function refer to 1 gt Page 58 Section 6 4 e Access through routers is also available except for simultaneous broadcast When configuring the settings for it set the subnet mask pattern and default router IP address gt Page 25 Section 3 4 39 40 MEFE EE 1 Port numbers In socket
79. dule operation monitoring data analysis and production control Socket communication function gt Page 39 CHAPTER 6 By using instructions dedicated to socket communication any data can be transferred from and to the external devices connected through Ethernet using TCP or UDP Time setting function SNTP client gt Page 87 CHAPTER 7 e Automatic time setting of the CPU module can reduce the maintenance cost for time setting e Because the same time information is shared among the CPU modules on Ethernet in which order the problems have occurred will be clear resulting in fast and easy problem resolution e Since the automatic time setting is enabled upon power on of the CPU module operations can be started based on accurate clock data File transfer function FTP gt Page 90 CHAPTER 8 Each of the files stored in the CPU module can be read or written from the interfacing device with the FTP client function and a large amount of data can be easily transferred Remote password gt Page 109 CHAPTER 9 Remote password setting can prevent unauthorized access from the outside and enhance the security of the system Simple PLC communication function gt Page 115 CHAPTER 10 Device data can be communicated between the CPU modules connected with Ethernet cable without programming CHAPTER 1 OVERVIEW Memo ES 17 CHAPTER 2 COMMUNICATION SPECIFICATIONS The following are the communication specifi
80. e File transfer writing a file cannot be executed when the SD memory card is write protected If attempted a write error occurs e When a file is written a temporary file FTP_I TMP is created automatically This file is renamed to the desination file name upon completion However if power failure or reset of the CPU module occurs during the file writing this temporary file may remain If this occurs delete the temporary file e Before writing or deleting data to the file register in the standard RAM set the CPU module to STOP e When the file register in the standard RAM is set as an auto refresh device do not perform any writing or deletion to the corresponding drive e When writing a large file to an SD memory card set the CPU module to STOP If writing is performed in the RUN state a communication error may occur 5 File deletion e The timing for deleting files must be determined by the user considering the overall system including the CPU module and programming tool e A file cannot be deleted if the SD memory card is write protected If attempted an error occurs 6 Password for FTP When you forgot the FTP password set the FTP parameters again by the following steps 7 Read out the parameters from the CPU module to the programming tool 2 Inthe FTP Parameter Setting dialog box click the Default button to return all the FTP parameters to default values KO Project window gt Parameter gt PLC Parameter gt
81. e been avoided if consumable parts battery backlight fuse etc designated in the instruction manual had been correctly serviced or replaced 5 Failure caused by external irresistible forces such as fires or abnormal voltages and Failure caused by force majeure such as earthquakes lightning wind and water damage 6 Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi 7 Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user 2 Onerous repair term after discontinuation of production 1 Mitsubishi shall accept onerous product repairs for seven 7 years after production of the product is discontinued Discontinuation of production shall be notified with Mitsubishi Technical Bulletins etc 2 Product supply including repair parts is not available after production is discontinued 3 Overseas service Overseas repairs shall be accepted by Mitsubishi s local overseas FA Center Note that the repair conditions at each FA Center may differ 4 Exclusion of loss in opportunity and secondary loss from warranty liability Regardless of the gratis warranty term Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi loss in opportunity lost profits incurred to the user by Failures of Mitsubishi products special damages and secondary damages whether fores
82. e data of each device is communicated at different timing 2 e If both a bit device and a word device are set for the same setting No the level of data inconsistency of both devices may be different because the data of each device is communicated at different timing e If the data of 32 bits 2 words or larger is communicated data inconsistency might differ in units of 32 bits 2 words If the COM instruction is used the data are written or read not only in the END processing but also during sequence scan at the execution of the COM instruction The order of the write and read is shown below e When Write is set for Communication Pattern A word device comes first then a bit device e When Read is set for Communication Pattern A bit device comes first then a word device e When Transfer is set for Communication Pattern The host station reads the data of transmission source in order of a bit device and a word device and writes them to transmission destination in order of a word device and a bit device 1 Because the write and read is performed from the data with smaller device number use the device with the largest No to secure the data CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 6 Request Contact Device to Stop Fixed Interval Communication Select the device from X M B and specify it as Request Contact Device to Stop Fixed Interval Communication If Fixed Interval is set for Communication
83. e it after disconnecting the FTP client 3 Communication processing e If a timeout error occurs during file transfer the TCP connection will be closed disconnected To restart the file transfer log in to the CPU module once again from the FTP client nee oO U pn D O Cc O m 10 e For each FTP connection the existence of the target device is checked For details refer to gt Page 26 Section 3 5 e The processing time for file transfer depends on the factors such as the Ethernet line congestion the number of connections simultaneously used communication processing of other connections and the system configuration e Only one FTP client can log in to a CPU module at the same time If another FTP client attempts to connect to a CPU module that is already in the logged in state the connection cannot be established resulting in an error e An attempt to execute another communication MELSOFT connection or MC protocol using UDP during file transfer using FTP may cause an error such as a timeout error Execute it after completion of the file transfer or use TCP 107 4 File writing e An existing file cannot be overwritten and saved Either delete a file with the file delete command delete or mdelete or rename the file with the file rename command rename and then write the file e Writing is not allowed to read only files and files locked by a function other than FTP If attempted a write error occurs
84. e of the host station transmission source to the specified destination device transmission destination Tianefer Read the data of the specified destination device transmission source and write it to another specified destination device transmission destination 4 The device data is not reflected in the CPU module where the parameters are set the CPU module that relays the data 2 Communication Setting Execution Interval ms Request Contact Select the communication timing from the following items Data are communicated between the devices at a specified execution Fixed Interval interval Execu tion o Execution interval is set 10ms to 65535ms 1ms unit Interval On Request Data are communicated between the devices only when requested Data are communicated at the rising OFF to ON of the device that is specified as Request Contact The ON OFF status of Request Contact X M B is confirmed in the END processing Request Contact 1 Request Contact cannot be specified overlapped with the following devices e Request Contact Device to Stop Fixed Interval Communication e Execution Status Flag Device e Source device when the host station is a transmission destination device e Request Contact Device to Stop Fixed Interval Communication that is used for other setting No e Execution Status Flag Device that is used for other setting No e Source device when the host station is a transmission destination device
85. e scan upon System O completion of the instruction Bit D 1 also turns on when failed 2 The Set by column indicates the following User The data must be set before executing the SP SOCCLOSE instruction System The CPU module stores the execution result of the SP SOCCLOSE instruction 2 Control data RR AR 90 Sytemara ICO Completion status is stored Completion 62 1 0000H Completed System status Other than 0000H Failed Error code 3 The Set by column indicates the following System The CPU module stores the execution result of the SP SOCCLOSE instruction 64 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 3 Function This instruction closes a connection specified in Disconnection of a connection The result of the SP SOCCLOSE instruction can be checked with the completion device 0 and 1 e Completion device D 0 Turns on in the END processing of a scan after completion of the SP SOCCLOSE instruction and turns off in the next END processing e Completion device D 1 Turns on or off according to the result of the SP SOCCLOSE instruction State Description When Remains off completed When failed Turns on in the END processing of a scan after completion of the SP SOCCLOSE instruction and turns off in the next END processing END processing END processing END processing Program PO instruction executed SP SOCCLOSE instruction Completion device D
86. ed data have not been read out for a long time Conditions for closing In TCP communications even if no close request is sent from the connected device the Open completion signal will turn off to close the connection in the following cases e Alive check is timed out e Forced close is received from the connected device Elements for TCP connection The following four elements control TCP connections and only one connection can be established with a unique setting for these elements To use multiple TCP connections at the same time at least one of the four elements must be different e IP address of the CPU module e Port number of the CPU module e IP address of the target device e Port number of the target device Reestablishment of the same connection Allow eight seconds or more before reestablishing a connection of the same target IP address the same host station port number and the same target port number after closing it If the reestablishment is time critical it is recommended to change the host station port number on the Active open side Precautions for file access during communication The CPU module will perform file access processing prior to Ethernet communication processing Because of this processing of the socket communication function may be delayed if a file is accessed by FTP or a programming tool during the processing When accessing a file while response time monitoring is performed on the connected devi
87. eeable or not compensation for accidents and compensation for damages to products other than Mitsubishi products replacement by the user maintenance of on site equipment start up test run and other tasks 5 Changes in product specifications The specifications given in the catalogs manuals or technical documents are subject to change without prior notice 141 Microsoft Windows Windows NT and Windows Vista are registered trademarks of Microsoft Corporation in the United States and other countries Pentium is a trademark of Intel Corporation in the United States and other countries SS DP Ethernet is a trademark of Xerox Corporation de The SD logo and SDHC logo are trademarks Mo TM All other company names and product names used in this manual are trademarks or registered ae FACE trademarks of their respective companies Cl SH NA 080891ENG E 142 MELSEC L CPU Module User s Manual Built In Ethernet Function LCPU U NE E 13 237 SH NA 080891ENG E 1109 MEE a MITSUBISHI ELECTRIC CORPORATION HEAD OFFICE TOKYO BUILDING 2 7 3 MARUNOUCHI CHIYODA KU TOKYO 100 8310 JAPAN NAGOYA WORKS 1 14 YADA MINAMI 5 CHOME HIGASHI KU NAGOYA JAPAN When exported from Japan this manual does not require application to the Ministry of Economy Trade and Industry for service transaction permission Specifications subject to change without notice MITSUBISHI ELECTRIC EUROPE B V German Branch Gothaer
88. efauk Changed Communication Data Code Binary Code C ASCII Code 2 Fable online change FTP MC Protocol Disable direct connection to MELSOFT Do not respond to search for CPU Built in Ethemet port on network MT he items indicated in green are set in MELSOFT Navigator Print Window Print Window Preview Acknowledge XY Assignment Default Set the IP address of the CPU module 2 Select Enable online change FTP MC Protocol when data need to be written even while the CPU module is in RUN state 3 Configure the FTP settings Built in Ethernet Port FTP Parameter Setting FTF Parameters FTP Used Login Hame IMELSEC Password Current New Command Input 1800 500mz Monitoring Timer i 1 32767 uoedlunwwop d LJ JO Bumes 18 Default Check Cancel Item Description FTP Select Used Login Name Set a login name for file transfer request log in from the connected device Default MELSEC Set an FTP password for file transfer request from the connected device To change the password enter both old and Password sd new passwords for confirmation Default MELSEC Set a time for monitoring command input performed by the CPU module When no command is input within the set Command Input Monitoring Timer period of time the FTP connection is disconnected Setting range 1 to 32767 x 500ms Set a time value larger than the time required for
89. en specifying a destination file path name FTP client side e Without a destination file path name the file is saved using a file name determined by the FTP application on the FTP client side e The transfer destination is on the current directory where FTP is started up and connected to the server mls mget Function Specification format Example Note emis Function Specification format Example Note Similar command mput Function Specification format Example Note open Function Specification format Example 1 Example 2 Note CHAPTER 8 FILE TRANSFER FUNCTION FTP Reads out a file from the CPU module To read out multiple files specify the file name and extension within the file path name using a wild card and or 7 When reading multiple files reception is checked for each file transfer mget file path name When reading all the files whose extensions are USR among the files stored in an SD memory card mget 2 USR The file read out is saved on the FTP client side under the same file name The storage destination is on the current directory where FTP is started up and connected to the server Stores the names of the files in the CPU module as log data into a file on the FTP client side mls source drive name destination file path name When storing the names of the files in an SD memory card into the S990901F LOG file m
90. ence of a hazardous condition Disposal Precautions N CAUTION O When disposing of this product treat it as industrial waste When disposing of batteries separate them from other wastes according to the local regulations For details on battery regulations in EU member states refer to the MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection Transportation Precautions N CAUTION O When transporting lithium batteries follow the transportation regulations For details on the regulated models refer to the MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection CONDITIONS OF USE FOR THE PRODUCTO 1 Mitsubishi programmable controller the PRODUCT shall be used in conditions i where any problem fault or failure occurring in the PRODUCT if any shall not lead to any major or serious accident and ii where the backup and fail safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem fault or failure occurring in the PRODUCT The PRODUCT has been designed and manufactured for the purpose of being used in general industries MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY INCLUDING BUT NOT LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT WARRANTY TORT PRODUCT LIABILITY FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE
91. ent Program Setting POU B Program 48 MAIN By Local Device Comment 3 Device Memory gt PLC Parameter Select Project from the view selection area to open the Project window In the Project window expand Parameter and select PLC Parameter Device Initial Value errr rr rr A View selection area Connection Destination Unlabeled 12 Pages describing instructions are organized as shown below The following page illustrations are for explanation purpose only and are different from the actual pages Instruction name Oshows the devices applicable to the instruction Descriptions of setting data and data type Descriptions Of control data if any Detailed descriptions of the instruction Conditions for the error and error codes For the errors not described in this manual refer to the following MELSEC Q L Programming Manual Common Instruction Simple program example s and descriptions of the devices used 6 4 2 Disconnecting a connection SP SOCCLOSE lt lt SP SOCCLOSE _ sesocociose uo amp 2 Setting data Description Dummy Connection number Setting range 1 to 16 Start number of the device from which control data are stored Start number of the device which turns on for one scan upon completion of the instruction D 1 also turns on when failed Completion status is stored 0000H Completed Other
92. er Floating point data Character string Character string data Device name Device name data TERMS Unless otherwise specified this manual uses the following terms CPU module Power supply module Branch module Extension module END cover Display unit SD memory card Extension cable LCPU Programming tool GX Works2 GX Developer CC Link MC protocol FTP SNTP Description The abbreviation for the MELSEC L series CPU module The abbreviation for the MELSEC L series power supply module The abbreviation for the MELSEC L series branch module The abbreviation for the MELSEC L series extension module A cover to be attached to the right side of the rightmost MELSEC L series module A liquid crystal display to be attached to the CPU module Secure Digital Memory Card which is a flash memory device The L1MEM 2GBSD and L1MEM 4GBSD are available The abbreviation for the MELSEC L series extension cable Another term for the MELSEC L series CPU module A generic term for GX Works2 and GX Developer The product name of the software package for the MELSEC programmable controllers The abbreviation for Control amp Communication Link A field network system where data processing for control and information can be simultaneously performed at high speed The abbreviation for the MELSEC communication protocol a protocol to access a CPU module from a target device in the Ethernet or serial communication The abbreviation for File Tra
93. ernet Explorer is not allowed If it is attempted an error will occur in Internet Explorer 2 CPU module side processing e Files only in the drives of the host station CPU module can be accessed e During file access do not power off the CPU module reset the CPU module or remove an SD memory card Doing so may corrupt the file Stop accessing to an SD memory card and then power off the CPU module reset the CPU module or remove an SD memory card All of SD memory card operations can be disabled by SM606 SD memory card forced disable instruction For the forced disablement of SD card refer to the following MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection During file access do not operate the file from a peripheral such as a programming tool Also do not perform online operations such as online change scam time measurement registration of the step number set for a monitoring condition If the file is operated during operation of the FTP function an error may occur in the peripheral Perform the processing suspended due to an error again after performing the FTP function If an access is attempted from an FTP client during backup or restoration for the CPU module change function using an SD memory card an error will occur Reexecute it after completion of the backup or restoration An error will also occur if backup or restoration is performed during access from an FTP client In that case reexecut
94. example refer to General Safety Requirements in the MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection 5 Outputs may remain on or off due to a failure of a component such as a transistor in an output circuit Configure an external circuit for monitoring output signals that could cause a serious accident O in an output circuit when a load current exceeding the rated current or an overcurrent caused by a load short circuit flows for a long time it may cause smoke and fire To prevent this configure an external safety circuit such as a fuse O Configure a circuit so that the programmable controller is turned on first and then the external power supply If the external power supply is turned on first an accident may occur due to an incorrect output or malfunction O Configure a circuit so that the external power supply is turned off first and then the programmable controller If the programmable controller is turned off first an accident may occur due to an incorrect output or malfunction O For the operating status of each station after a communication failure refer to relevant manuals for each network Incorrect output or malfunction due to a communication failure may result in an accident O When changing data from a peripheral device connected to the CPU module to the running programmable controller configure an interlock circuit in the program to ensure that the entire system will always operate safely F
95. exceed the general specifications of the PRODUCTs are required For details please contact the Mitsubishi representative in your region INTRODUCTION Thank you for purchasing the Mitsubishi MELSEC L series programmable controllers This manual describes the functions of the CPU module and programming necessary for Ethernet communication Before using the product please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance of the MELSEC L series programmable controller to handle the product correctly When applying the program examples introduced in this manual to the actual system ensure the applicability and confirm that it will not cause system control problems Please make sure that the end users read this manual MH Relevant CPU modules LO2CPU L26CPU BT LO2CPU P and L26CPU PBT This manual does not describe the CPU module functions other than those for Ethernet communication For other CPU module functions refer to the following MELSEC L CPU Module User s Manual Function Explanation Program Fundamentals _ MELSEC L CPU Module User s Manual Built In I O Function LI MELSEC L CPU Module User s Manual Data Logging Function RELEVANT MANUALS 1 CPU module user s manual Manual name Description lt manual number model code gt MELSEC L CPU Module User s Manual Specifications of the CPU modules power supply modules display unit Hardware Desig
96. figured in simple PLC communication setting simple PLC communication setting x x Remote Password 119 poyan Bues 101 4 Settings for destination devices for communications If following devices are used as the destination devices for communications the settings of these devices are also required Destination device for communications MELSEC Q L Built in Ethernet Function MELSEC Q Ethernet Module MELSEC QnA Ethernet Module MELSEC A Ethernet Module 4 2 3 4 gs 120 numbers of the devices in Open Setting e Protocol UDP e Open System MELSOFT Connection Set the following items from the Ethernet setting of Network Parameter e Send Frame Setting of Operation Setting Ethernet V2 0 e Station No lt gt IP Information System of Station No lt gt IP Information Automatic Response System Set the following items from the Ethernet setting of Network Parameter e Send Frame Setting of Operation Setting Ethernet V2 0 e Station No lt gt IP Information System of Station No lt gt IP Information Automatic Response System Necessary setting Set the following items for the e Create an initial processing program and turn off the bits 6 and 7 in the special function setting area address 4 44 of buffer memory e Turn on the bit 15 in the exchange instruction area during STOP address 103 67 of buffer memory
97. file transfer 91 2 Operation on the connected device FTP client side The following describes the procedure and processing on the connected device side which is required for using the FTP server function of the CPU module Various FTP commands and how to enter each of them are also shown lt ret gt indicates an input of the CR Enter or Return key Start the FTP client ftp lt ret gt Login to the CPU module f open CPU module s IP address lt ret gt s remote NO password enabled for FTP YES Unlock the remote quote password unlock password remote password lt ret gt Is file transfer YES completed NO Write files YES NO s remote to the FTP server a Gpe NO YES File reading File writing Lock the remote password quote password lock lt ret gt No file conversion is notified f binary lt ret gt No file conversion is notified binary lt ret gt r Disconnect from Wess the CPU module bye lt ret gt Check the file list dir lt ret gt Check the file list dir lt ret gt or or Is lt ret gt Is lt ret gt End NO Does the read NO Does the write target file exist target file exist YES YES Is File NO password 32 set for the Can it be overwritten target file YES YES 7 quote passwd rd Enter a file password fr Is File L read password lt ret gt password 32 set for the target file Read the file get file name lt ret gt quote passwd wr
98. gister File register Extended data register Extended data register Decimal Extended link register Extended link register Hexadecimal 4 Device code is the code that is specified in the MC protocol message When data are communicated using ASCII code use the device code of two characters For the device code of one character add ASCII code 2A or add space ASCII code 204 after the character 2 For the LO2CPU and LO2CPU P devices of DX DY400 or later number cannot be used To access the devices of X Y400 or later number use X or Y device For the L26CPU BT and L26CPU PBT devices of DX DY1000 or later number cannot be used To access the devices of X Y 1000 or later number use X or Y device 30 5 3 Precautions 36 1 Number of devices Only the external devices whose open system is set to MC Protocol can be connected concurrently using MC protocol O Project window gt gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting c gt Open Setting 2 Data communication frame The QnA compatible 3E frames only are applicable to CPU modules 3 Access range e Only the connected CPU module can be accessed Accessing another module will cause an error e Accessing another station on a network such as CC Link is not allowed via the connected CPU module 4 When UDP is selected for Protocol e If anew request message is sent to a UDP port after the previous request message is sent to the same
99. gt Page 94 Section 8 2 b Folder name file name and extension e Specify a folder name and a file name according to the rules described in the following manual MELSEC L CPU Module User s Manual Function Explanation Program Fundamentals e Set an extension predetermined by the CPU module 2 gt Page 94 Section 8 2 e For details of the file names and extensions refer to the following manual Operating manual of the programming tool used e Foran FTP command which can be used for multiple files specify the file name and extension using a wild card character or Wk Indicates all files having any characters including no character from the position where is used Indicates all files having any characters including no character at the position where is used Multiple can be used Some FTP clients have other restrictions on the characters that can be used for file names Point The part enclosed with brackets in the specification format can be omitted 98 CHAPTER 8 FILE TRANSFER FUNCTION FTP Details of FTP commands 8 4 3 Details of the FTP commands on the FTP client side which are supported by the CPU module and how to use each of them are described below Point Note that some FTP commands may not function as described in this manual depending on the FTP application used on the FTP client side Check the functions and operation methods referring to the manual s for the F
100. he data must be set before executing the SP SOCOPEN instruction System The CPU module stores the execution result of the SP SOCOPEN instruction SUOI JONIJSU uonouny UOI EDIUNWWOD JONDOS y 9 N3IdOJOS 4S Uonoauuos e Bulysijgejsy y 9 99 60 2 Control data 3 4 9 62 0 1 62 2 62 3 62 4 62 5 62 6 62 7 to 2 9 Execution completion type Completion status Application setting area Specify which settings are used to open a connection parameter settings configured by a programming tool or control data settings 62 2 to 62 9 OOOOH Connection is opened according to the settings set in Open settings of PLC parameter 8000H Connection is opened according to the values specified for control data 62 2 to 62 9 Completion status is stored 0000H Completed Other than 0000H Failed Error code b15b14b13 to b10 b9 b8 b7 to bO Qe ei o am o 1 Communication method protocol 0 TCP IP 1 UDP IP 2 Socket communication procedure 1 Nonprocedural fixed 3 Open system 00 Active open or UDP IP 10 Unpassive open 11 Fullpassive open Setting range 0000H 8000H Host station port rE i b osa 1H to 1387H ort number o e nost station namber itd aa i 1392H to FFFEH Target device IP address Target device port number 4 Specify the IP address of the target device Specify the port number of the target device Use prohi
101. her device when a device that executed remote STOP to the CPU module have a problem and cannot perform remote RUN With Normal RUN the CPU module state cannot be changed from STOP PAUSE to RUN if the previous state is set by a different device e Specify the clear mode at the start of an operation according to the system arrangement After completing the specified clear processing the CPU module runs in accordance with the PLC parameter settings Initial Device value setting on the PLC file tab Displays information of the CPU module operation This command is used to check the information on the CPU module operation before transferring a file to the CPU module quote status One of the following is displayed as an execution result upon completion e When the CPU module is in RUN state RUN e When the CPU module is in STOP state STOP e When the CPU module is in PAUSE state PAUSE CHAPTER 8 FILE TRANSFER FUNCTION FTP Ostop Function Changes the CPU module state to STOP remote STOP Specification format quote stop The following message is displayed as an execution result upon completion 200 Command successful Note Before writing data to the program memory set the CPU module into the STOP state using this command epm write Function Transfers program cache memory to the program memory Specification format quote pm write The following message is displayed as an execution result upon completion 200 Command succe
102. hub into the half duplex mode if the hub that does not have the auto negotiation function O The operation of commercial devices used for the following applications is not guaranteed Check the operation before using the module e Internet general public line Internet access service offerred by an Internet service provider or a telecommunications carrier e Firewall device s e Broadband router s e Wireless LAN O f Ethernet communication is performed with Specify service process execution counts selected for Service processing setting in the PLC system tab of PLC parameter a scan time increases by time for service processing approximately 500ms To reduce it to 500ms or less select an item other than Specify service process execution counts Example Select Specify service process time and then enter a time value O f broadcast storm occurs in the network scan time may be increased 18 CHAPTER 2 COMMUNICATION SPECIFICATIONS TCP and UDP are defined as follows e TCP Transmission Control Protocol In communications among programmable controllers and networked devices this protocol establishes a connection between port numbers of the two devices to perform reliable data communications e UDP User Datagram Protocol This is a connectionless protocol and thereby its speed is faster than that of TCP However the reliability in data communications is low Data may be lost or not be received in correct order Note that sym
103. ices srl Aleea Lacul Morii Nr 3 RO 060841 Bucuresti Sector 6 Phone 40 0 21 430 40 06 Fax 40 0 21 430 40 02 INEA RBT d o 0 Izletnicka 10 SER 113000 Smederevo Phone 381 0 26 615 401 Fax 381 0 26 615 401 SIMAP s r o Jana Derku 1671 SK 911 01 Trencin Phone 421 0 32 743 04 72 Fax 421 0 32 743 75 20 PROCONT spol s r o Pre ov K peln 1 A SK 080 01 Pre ov Phone 421 0 51 7580 611 Fax 421 0 51 7580 650 INEA RBT d 0 0 Stegne 11 SI 1000 Ljubljana Phone 386 0 1 513 8116 Fax 386 0 1 513 8170 Beijer Electronics AB Box 426 SE 20124 Malmo Phone 46 0 40 35 86 00 Fax 46 0 40 93 23 01 Omni Ray AG Im Sch rli 5 CH 8600 D bendorf Phone 41 0 44 802 28 80 Fax 41 0 44 802 28 28 GTS TURKEY Bayraktar Bulvari Nutuk Sok No 5 TR 34775 Yukar Dudullu Umraniye ISTANBUL Phone 90 0 216 526 39 90 Fax 90 0 216 526 3995 CSC Automation Ltd 4 B M Raskovoyi St UA 02660 Kiev Phone 380 0 44 494 33 55 Fax 380 0 44 494 33 66 Systemgroup 2 M Krivonosa St UA 03680 Kiev Phone 380 0 44 490 92 29 Fax 380 0 44 248 88 68 MALTA MOLDOVA NETHERLANDS NETHERLANDS NORWAY PORTUGAL ROMANIA SERBIA SLOVAKIA SLOVAKIA SLOVENIA SWEDEN SWITZERLAND UKRAINE UKRAINE TOO Kazpromavtomatika KAZAKHSTAN Ul Zhambyla 28 KAZ 100017 Karaganda Phone 7 7212 50 10 00 Fax 7 7212 501150 MIDDLE E
104. ices used Device number Application SD1282 Open completion signal SD1286 Receive state signal D5000 Receive data length and receive data storage location e Program M5000 SD1282 0 SD1286 0 Reading receive AAA LS Serer uo K1 D5000 data of Connection No 1 END Point O To avoid receiving large amounts of data the volume of received data can be limited by setting the receive data size using the SP SOCRMODE instruction O Data reception can be speeded up by placing a receive processing program at the beginning of multiple programs CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6 4 5 Sending data SP SOCSND Command SPSOCSND f Setting data 1 File registers set for each local device or program cannot be used 1 Setting data User 6 Connection number Setting range 1 to 16 BIN 16 bit 62 Start number of the device where control data are specified Device name 63 Start number of the device from which send data are stored Start number of the device which turns on for one scan upon completion of the instruction System Bit D 1 also turns on when failed 2 The Set by column indicates the following User The data must be set before executing the SP SOCSND instruction System The CPU module stores the execution result of the SP SOCSND instruction ANSIOS AS erep Buipues Ss y9 SUONJONIJSU UOIOUN y UOI EDIUNWWOD JONDOS y 9 13 2 Control data e ASA AAA MO Ei 38 O E E
105. ified size SD1286 turns on If data are received exceeding the specified receive data size the excess data are read out the next time Ex The receive data size is set to 300 bytes and 200 byte data are consecutively received Data cannot be read out because the receive data size is not reached IdONYHDOS AS uopovuuoI e zo apou 948991 y Buibueyo g y 9 l l SP SOCRCV or Reading receive data NS 5 i instruction l l Socket communication Data stored Data stored Data reading The remaining 100 receive data area 200 bytes 300 bytes ea oo l reception 200 bytes l ON SD1286 OFF A L l l Data reception Data reception 200 bytes 200 bytes Point O Effective use of devices Devices can be effectively used by setting the receive data size to less than 1024 words while the default size of the receive data storing devices for the SP SOCRCV and S SOCRCVS instructions is 1024 words SUON JONIJSU UOIOUN y UOI EDIUNWWOD ey490S y 9 O Prevention of receive data fragmentation Data from the connected device may be fragmented depending on the line type To prevent this the receive data size can be specified in the TCP fixed length receive mode Prevention of receive data binding Separately sent data may be combined depending on the interfacing device due to a delay in receive processing of the program To prevent this the receive data size can be specified in the TCP fixed length receive mode 83
106. il communications start after the CPU On Request is set module is powered off and on or reset including the waiting time of check if the hub is connected or not Waiting for the Only On Request When waiting for the communication request by Request Request is set Contact Fixed Interval is When device data communications at a specified execution set interval are possible 3H Communica ting When device data are communicated according to the states of On Request is set Request Contact 4 Communica tion Only Fixed Interval When the simple PLC communication function is stopped by J Stop is set the request to stop fixed interval communication Error Code No The corresponding error code is stored 4 Status Save Destination Device cannot be specified overlapped with the following devices e Status Save Destination Device e Execution Interval Current Value Save Destination Device e Source device when the host station is a transmission destination device e Status Save Destination Device that is used for other setting No e Execution Interval Current Value Save Destination Device that is used for other setting No e Source device when the host station is a transmission destination device which is used for other setting No Point For examples of how to use this device refer to gt Page 127 Section 10 2 124 CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 9 Execution Interval Current Value Save Destinati
107. ing END processing Program Y r JOA instruction executed SP SOCOPEN instruction OFF Completion device D 0 EN When failed _ OFF Completion device D 1 1 scan when normally completed q Connection i open e A connection with no parameters no protocol is specified can be opened In this case specify 8000H for 62 0 and configure open settings in 62 2 to 62 9 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when e The connection number specified for is other than 1 to 16 Error code 4101 e The device numbers specified for 62 and exceed the device point range suo 9n4su UOIOUN Y UOI EDIUNWWOD ey490S y 9 N3IdOJOS 4S uogo uuos e Bulysijge sy y 9 Error code 4101 e An invalid device is specified Error code 4004 61 62 5 Program examples a Opening a connection using parameter settings When M1000 is turned on connection No 1 is opened using the parameters set in Open settings of PLC parameter e Devices used Device number Application SD1282 Open completion signal SD1284 Open request signal SD1288 Connection state signal D100 SP SOCOPEN instruction control data M100 SP SOCOPEN instruction completion device e Program M1000 SD1282 0 SD1284 0 SD1288 A Y ME MOVP HO D100 Setting Execution completion type to OH SP SOCOPEN uo K1 D100 M100 Connect
108. ing the parameters to the CPU module power off and then on or reset the CPU module to enable the parameters 3 Unlocking or locking the remote password The remote password is unlocked or locked from an external device such as a personal computer as described below a When using MELSOFT connection Enter a remote password in the following dialog box that appears during communication When the remote password is entered the programming tool performs unlock processing and then accesses the CPU module Enter remote password Remote password incorrect Enter again oo Cancel Remote password b When using MC protocol Use commands dedicated to MC protocol lt gt Page 34 Section 5 2 1 c When using the FTP function Use the password lock and password unlock commands lt gt Page 96 Section 8 4 1 d When using the simple PLC communication function Unlock the remote password in the Destination Setting List dialog box of Simple PLC Communication Setting KO Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting gt Simple PLC Communication Setting gt Destination Setting List Destination Setting List IP Address Port No Input Format E pr rl A Module Type IP Address ono f No I MELSEC Q L Gut n Ethernet Function IO O A EE E q Sr o a a ee SS ASA SN Required Settings Unset Set Optional Settings
109. ion No 1 open M100 M101 pE e M150 Normal completion M101 2 SET M151 Error completion CHAPTER 6 SOCKET COMMUNICATION FUNCTION b Opening a connection using control data settings When M1000 is turned on connection No 1 is opened using control data e Devices used Device number Application D1282 Open completion signal SD1284 Open request signal SD1288 Connection state signal D100 SP SOCOPEN instruction control data M100 SP SOCOPEN instruction completion device e Program el a SD1282 0 SD1284 0 SD1288 A sous sada on Setting Execution H H completion type to 8000H Setting Application area MOVP H200 D102 to 2004 TCP IP Active open MOVP H1000 D103 Setting port No of host station to 4096 Setting target IP address DMOVP HOA614F0E D104 to 10 97 79 14 MOVP H1000 D106 Setting port No of target device to 4096 K1 D100 M100 Connection No 1 open M100 M101 SET M150 Normal completion M101 J Q A Q aaa SET M151 Error completion SUOIJONIJSU UOIOUN Y UOI EDIUNWWOD JONDOS y 9 N3IdOJOS 4S Uonoauuos e Bulysijgejsy y 9 63 6 4 2 Disconnecting a connection SP SOCCLOSE Command SPSOCCLOSE f P 4 eT NE 4 File registers set for each local device or program cannot be used 1 Setting data 6 Connection number Setting range 1 to 16 BIN 16 bit 62 Start number of the device from which control data are stored Device name Start number of the device which turns on for on
110. ion when a CPU module is connected to an external device in an one to one basis using a hub as shown below EST gt gt 2S Se A a ge er ne Or eae eee oo lt 22325 REZA AA e When two or more Ethernet ports are enabled in the network connections setting on the personal computer communication by direct connection is not possible In the setting leave only one Ethernet port enabled for direct connection and disable other Ethernet ports 3 Conditions that disallow direct connection When any of the following conditions is met communication by direct connection may not be available In that case check the setting of the CPU module and or personal computer e In the CPU module IP address bits the bits corresponding to 0 in the personal computer subnet mask are all ON or all OFF Ex CPU module IP address 64 64 255 255 Personal computer IP address 64 64 1 1 Personal computer subnet mask l 255 255 O 0 e In the CPU module IP address bits the bits corresponding to the host address of the class in the personal computer IP address are all ON or all OFF Ex CPU module IP address 64 64 255 255 Personal computer IP address 192 168 O 1 Personal computer subnet mask i 255 O O 0 O The IP address pattern for each class is as follows Class A 0 x x x to 127 X X X Class B 128 x x x to 191 x x x Class C 192 x x x to 223 x x x The host address for each class is the part shown with 0
111. is 2 S990901F LOG e Type immediately after the source drive name e Specify a source drive name when specifying a destination file path name FTP client side e Without a destination file path name the file is stored using a file name determined by the FTP application on the FTP client side e The transfer destination is on the current directory where FTP is started up and connected to the server mdir Writes a file to the CPU module To write multiple files specify the file name and extension within the file path name using a wild card or When writing multiple files transmission is checked for each file transfer mput source file path name When writing all the files whose extensions are USR mput USR The storage destination file name is the same as that on the FTP client side The transfer destination is the memory in which current parameter files are stored Connects to the FTP server by specifying the host name or IP address and port number of the FTP server open host name port number open IP address port number Host name Host name set in the Microsoft Windows hosts file P address CPU module IP address Port number Port number to be used When connecting to the FTP server by specifying a host name open HOST When connecting to the FTP server by specifying an IP address open 192 0 1 254 Connection is also possible by specifying an IP address at startup of FTP 101
112. it as a device to store the execution status The ON OFF status below indicate the execution status e ON Communicating the state of Status being 3H e OFF Communication Stop 4 Execution Status Flag Device cannot be specified overlapped with the following devices e Request Contact e Request Contact Device to Stop Fixed Interval Communication e Source device when the host station is a transmission destination device e Request Contact that is used for other setting No e Request Contact Device to Stop Fixed Interval Communication that is used for other setting No e Execution Status Flag Device that is used for other setting No e Source device when the host station is a destination device which is used for other setting No Point For examples of how to use this device refer to gt Page 127 Section 10 2 poyan Bumeas pOL 123 8 Status Save Destination Device Select the device from D D extended data register W W extended link register R ZR and specify it as a device to store the communication status The values listed below indicate the communication status Setting and description Item Communication Communication T Description Status Setting When waiting for the latency time to pass Fixed Interval is a sel Or during the time until communications start after the CPU l module is powered off and on or reset 1H Preparing When waiting for the latency time to pass Or during the time unt
113. l data D5000 Storage location of connection information e Program M5000 Reading connection RH SP SOCCINF U0 K1 D500 D5000 information of Connection No 1 END 19 4NIODOS dS YOHeWOJU uonoauuoo jno Bulpeay 9 y 9 SUON JONIJSU UOIOUN y UOI EDIUNWWOD JONDOS y 9 6 4 7 Changing the target of a connection UDP IP SP SOCCSET Command SP SOCCSET l SPSOCCSET uo amp Setting Internal device data oo e AA 1 Setting data Setting data Description Set by Data type UO Dummy Character string 6 Connection number Setting range 1 to 16 BIN 16 bit 62 Start number of the device from which control data are stored User System Device name 1 The Set by column indicates the following User The data must be set before executing the SP SOCCSET instruction System The CPU module stores the execution result of the SP SOCCSET instruction 2 Control data e AO RR AA E O ES E Completion status is stored Completion 62 1 0000H Completed System status Other than OOOOH Failed Error code 1H to FFFFFFFFH 62 2 Target device IP ae m FFFFFFFFH IP address of the target device is specified 62 3 address Simultaneous broadcast User 1H to FFFFH Target device e m FFFFH 62 4 Port number of the target device is specified port number Simultaneous broadcast 2 The Set by column indicates the following User The data must be set before executing the SP SOC
114. lag Normal completion Error completion Resetting SP SOCCLOSE executing flag CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6 4 3 Reading out received data in the END processing SP SOCRCV Command SP SOCRCV f Setting Internal device data 1 File registers set for each local device or program cannot be used 1 Setting data Start number of the device from which control data are specified Device name System Bit Start number of the device from which receive data are stored Start number of the device which turns on for one scan upon completion of the instruction 62 1 also turns on when failed 2 The Set by column indicates the following User The data must be set before executing the SP SOCRCV instruction System The CPU module stores the execution result of the SP SOCRCV instruction 2 Control data tir O EE oe A dt Conai Completion status is stored Qt ae 0000H Completed Other than OOOOH Failed Error code veda The length of the data which were read out from eceive data 09 0 length the Socket communication receive data area is 0 to 2046 System stored in bytes 0 1 The data which were read out from the Socket to Receive data communication receive data area are stored in n order 9 The Set by column indicates the following System The CPU module stores the execution result of the SP SOCRCV instruction SUON ONIJSU UOIOUN y UOI EDIU
115. led Setting a Connection Test Time Out Sec 30 Retry Times fo Network PLC Type Communication Route CC IE Cont Ethernet CC Link C24 NET ID NET 10 H System Image Co existence Netw ork Route CC IE Cont Ethernet CC Link C24 NET ID NET 10 H Cancel Accessing Host Station aaa ia Select Ethernet Board for PC side I F 2 Select PLC Module for PLC side I F In the PLC side IF Detailed Setting of PLC Module dialog box select the Ethernet Port Direct Connection checkbox as shown below PLC side I F Detailed Setting of PLC Module PLC Mode JLcPu x Connection via HUB Cancel poyan Bumes p r Please select Connection via HUB when you use hub HUB even if the equipments to be communicated is one ea anos 0 D 0 0 The load hangs to the line when Ethernet Port Direct AS Connection is selected with other equipment connected with IP Input Format DEC hub HUB and it communicates and there is thing that id influences the communication of other equipment C Host Name 3 Complete setting of Other Station Setting Select an item appropriate to the operating environment 29 4 2 Precautions 1 Connection to LAN line When connecting the CPU module to a LAN line do not set direct connection Doing so will apply a load to the LAN line and adversely affect communications with other external devices 2 Indirect connection e Do not set up direct connect
116. lfunction 1 Emergency stop circuits protection circuits and protective interlock circuits for conflicting operations such as forward reverse rotations or upper lower limit positioning must be configured external to the programmable controller Machine OPR Original Point Return of the positioning function is controlled by two kinds of data an OPR direction and an OPR speed Deceleration starts when the near point watchdog signal turns on If an incorrect OPR direction is set motion control may continue without deceleration To prevent machine damage caused by this configure an interlock circuit external to the programmable controller When the CPU module detects an error during control by the positioning function the motion slows down and stops Design Precautions N WARNING 4 When the programmable controller detects an abnormal condition it stops the operation and all outputs are e Turned off if the overcurrent or overvoltage protection of the power supply module is activated e Held or turned off according to the parameter setting if the self diagnostic function of the CPU module detects an error such as a watchdog timer error Also all outputs may be turned on if an error occurs in a part such as an I O control part where the CPU module cannot detect any error To ensure safety operation in such a case provide a safety mechanism or a fail safe circuit external to the programmable controller For a fail safe circuit
117. ll disable data transfer since the Open completion signal and Open request signal of the corresponding connection turn off for close processing To reopen a closed connection execute the SP SOCOPEN instruction For the SP SOCOPEN instruction refer to gt Page 59 Section 6 4 1 49 dol Buisn UOIJESIUNWILWWOD 9 6 2 Communication Using UDP UDP User Datagram Protocol is a simple protocol that does not perform data sequencing and retransmission To perform socket communication using UDP confirm the following in advance e IP address and port number of the target device e IP address and port number of the CPU module 1 Program example This section provides a program example for communication using UDP a Parameter setting The following parameters are set for the sample program O Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting gt Open Setting Built in Ethernet Port Open Setting Destination IP Address Port No 1000 Host station port No destination port No Please input in HE coc Item Setting Protocol UDP Open System Socket Communication TCP Connection Blank Host Station Port No 1000H Setting range 0001H to 1387H and 1392H to FFFEH Destination IP Address 192 168 3 40 Setting range 0 0 0 1 to 223 255 255 254 255 255 255 255 Destination Port No 1000H Setting range 0001H to FFFEH FFFFH 4 Since used by the system 1388H to 1391H cannot
118. monitor registration from multiple devices If executed the last monitor registration takes effect 5 Set the number of processed points so that the following condition is satisfied Number of word access points x 12 Number of double word access points x 14 lt 1920 For bit devices one point is regarded as 16 bits in word access and 32 bits in double word access For word devices one point is regarded as one word in word access and two words in double word access 34 CHAPTER 5 MC PROTOCOL COMMUNICATION 5 2 2 Available devices The following table lists the devices available in the commands used for MC protocol communication one i Device code Classification Device Device number range The number range of a device in a CPU module Hexadecimal Output which is accessed to can be specified Hexadecimal Link register Link register Hexadecimal exit fre E Timer E DUE E AE The number range of a device in a CPU module Decimal which is accessed to can be specified Contact ae Note that the access to a local device is not possible Retentive eee timer Link special register Internal system device Special register Decimal The number range of a device in a CPU module Index register Index register re a Decimal which is accessed to can be specified Decimal Decimal Hexadecimal Hexadecimal Decimal Hexadecimal Hexadecimal SOSIASP S GeIIEAY CCS spuewwog 090 OJd OW ZS Decimal File re
119. n Maintenance and Inspection branch module extension module SD memory cards and batteries information on how to establish a system maintenance and inspection lt SH 080890ENG 13JZ36 gt and troubleshooting MELSEC L CPU Module User s Manual Function Explanation Program Fundamentals Functions and devices of the CPU module and programming lt SH 080889ENG 13JZ35 gt MELSEC L CPU Module User s Manual Built In I O Function The general purpose I O function interrupt input function pulse catch function positioning function and high speed counter function of the lt SH 080892ENG 13JZ38 gt CPU module MELSEC L CPU Module User s Manual Data Logging Function lt SH 080893ENG 13JZ39 gt The data logging function of the CPU module 2 Programming manual Manual name fe Description lt manual number model code gt MELSEC Q L Programming Manual Common Instruction lt SH 080809ENG 13JW10 gt Detailed description and usage of instructions used in programs 3 Operating manual Manual name ane Description lt manual number model code gt GX Works2 Version1 Operating Manual Common System configuration parameter settings and online operations lt SH 080779ENG 13JU63 gt common to Simple project and Structured project of GX Works2 GX Developer Version 8 Operating Manual Operating methods of GX Developer such as programming printing lt SH 080373E 13JU41 gt monitoring and debugging 4 I O module a
120. n or reset of the CPU module Execution Interval 2 Select this when executing the time setting function at fixed time intervals Execution Time 2 increments of 30 minutes 2 Either of these two options must be selected 88 Specify a time zone in which the time is to be synchronized Japan Select whether to stop or continue the time setting when an error is Select this when executing the time setting function at a specified time in Setting range Used or Not used 0 0 0 1 to 223 255 255 254 GMT 12 00 to GMT 13 00 Continue or Stop 1 to 1440 min 00 00 to 23 30 CHAPTER 7 TIME SETTING FUNCTION SNTP CLIENT 1 2 Precautions 1 Communication timeout A communication timeout occurs when 20 seconds have elapsed without receiving any response after sending a time query At the time of a communication timeout the value in SD1270 is FFFFH 2 Delay resulted from the time required for communication A delay occurs and affects the set time as a result of the time spent for communication with the SNTP server computer For a high accuracy time setting specify an SNTP server computer that is networked as close to the CPU module as possible N N U ER D O 0 Cc O 5 7 89 CHAPTER 8 FILE TRANSFER FUNCTION FTP The CPU module supports the server function for FTP File Transfer Protocol which is a protocol designed for file transfer to or from the connected device The device with the FTP
121. n t to the slot e a 16 point module is connected the assignment Ex shows setting or hen 1000 cified in Start X Y to the slot where a 16 thi O pe rati ng exam ples range of an input module is changed to X1000 to X100F For details refer to the following shows reference DA MeLsec L CPU Module Users Manual Function Explanation Program Fundamentals manuals Point Set the type of the connected module in Type Setting a different type results in SP UNIT LAY ERR ethe intelligent function module the I O points must also be the same in addition to the I O assignment setting m P 3 shows gs a Point7 shows notes that reference pages requires attention When an intelligent module is connected I O assignment can be omitted by selecting connected modules from Intelligent Function Module in the Project window lt a CH shows useful information 1 The mouse operation example is provided below For GX Works2 ME MELSOFT Series GX Works2 Unset Project PRG MAIN Project Edit Find Replace Compile View Online Debug Diagno We PETEA OF ae a TBE a for Mi its eh Fe oo 47 te Tos Menu bar XZ Online 2 gt Write to PLC Select Online on the menu bar and then select Write to PLC Navigation Project l fanal A window selected in the view selection area is displayed a s 123 Intelligent Function Module O Project window o gt Parameter Global Device Comm
122. nal device 3 IP address xx xx xx ww Destination IP Address Destination Port No Sending is Sends data from the host Receives only the data sent from the specified IP Other than FF FF FF FFH Other than FFFFH address and port No among the entire data sent to the host station port No station port No to the specified IP address and port No Receives the data sent from all ports of the specified Other than FF FF FF FFH FFFFH IP address among the entire data sent to the host N A station port No Receives the data sent from the specified port No of Sends data to the port No FF FF FF FFH Other than FFFFH all the IP addresses among the entire data sent to the specified in the settings for host station port No simultaneous broadcast Receives all data that have sent to the host station FF FF FF FFH FFFFH tN N A port No dan Buisn uonesiunuiwoy z 9 53 04 3 Precautions a Use of UDP Data may be lost or may arrive out of order Consider the application of TCP if any problem is expected b Sending and receiving data Data sending process may be terminated even if the communication line between the CPU module and target device is not connected due to a reason such as cable disconnection To avoid this it is recommended to provide communication procedures at the user s discretion c Changing the target Use the SP SOCCSET instruction to change the target device For the SP SOCCSET inst
123. nd intelligent function module manua Manual name doves Description lt manual number model code gt MELSEC Q L MELSEC Communication Protocol Reference Manual Details of MELSEC communication protocol MC protocol that is used lt SH 080008 13JF89 gt for data communication between a target device and a CPU module CONTENTS SARE ICP REG AU MIONGi yz err aet ote Nr nies tele I a o aa ances DS 1 CONDITIONS OFUSE FORTHE PRODUCT a aa r e ere a ake ce aha nea O 7 O A E A E see es oe A apa ee eee 8 REEEVANTIFAMANUWALS a a O ci don Belarc A Ai 9 MANUAMPAGE ORGANIZATION A A nee 12 A A A A A A E aac E A a A S 15 CHAPTER 1 OVERVIEW 16 CHAPTER 2 COMMUNICATION SPECIFICATIONS 18 CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT 20 31 Setting Tor the CPU Modules ota abi a too aio as 21 3 2 Setting for the Programming To0l o o o oooo eee eee 23 3 3 Searching CPU Modules on the Network o o o o oo o ooo or 24 3 4 Communication via Routers o oo oooor ee ee ee eens 25 35 PRECAUIIONS ait oat eels tdi od Ah ee Ow ees eats Ba it 26 CHAPTER 4 DIRECT CONNECTION TO PROGRAMMING TOOL 10 SIMPLE CONNECTION 28 Ae Seting Methode e wre fas Oe aan Gr are Se a cases eh rca tees or ahve ators da ese 29 42 APEC ION Scar ES Ad EES REG ed oO a BERR BER 30 CHAPTER 5 MC PROTOCOL COMMUNICATION 31 Bill Oeming WEtNOG gt ss datada ae tus agama alae aa Bare ns ata Barmy Aube eens 32 52 MC Protocol Commands
124. ng gt Open Setting Built in Ethernet Port Open Setting Destination Protocol TCP Connection Pat No MELSOFT Connection w MC Protocol v Host station port No destination port No Please input in HEX mee Item Description Protocol Select TCP or UDP depending on the target device Open System Select MC Protocol Host Station Port No Set the port number of the host station Setting range 0401H to 1387H 1392H to FFFEH 4 Since used by the system 1388H to 1391H cannot be set Page 134 Appendix 2 Point When the Enable online change FTP MC protocol setting is disabled if the CPU module in the RUN state receives a data write request from the target device data will not be written and an NAK message will be returned poyjay Bumes L S 33 5 2 MC Protocol Commands 5 2 1 Command list The following commands are executable for MC protocol communication of the CPU module O Available x N A CPU module state Command i EE Number of Function Subcomm Description T and 1 processe PoMS STOP Write Write enabled disabled In units 0401 ASCII 3584 points R bit d ts of t Batch read 960 words O In units 0401 Reads bit devices in units of 16 points 15360 points of words 0000 Reads word devices in units of one point 960 points In units 1401 i ASCII 3584 ore Writes bit d ts of t Batch write er words x In units 1401 Writes bit de
125. ng manual MELSEC Q L MELSEC Communication Protocol Reference Manual Access through routers is also available When configuring the settings for it set the subnet mask pattern and default router IP address _ gt Page 25 Section 3 4 31 5 1 Setting Method Setting for communication using the MC protocol is described below W Project window Parameter 2 gt PLC Parameter gt Built in Ethernet Port Setting L Parameter Setting IP Address Setting _Open Setting Input Format Dec y IP Address 192 166 3 3 Subnet Mask Pattern Default RouterIPAddess J T setitis needed Defauk Changed FTP Setting Time Setting Communication Data Code 1 Binary Code n C ASCII Code 2 nable online change FTP MC Protocol Disable direct connection to MELSOFT l Do not respond to search for CPU Built in Ethernet port on network The items indicated in green are set in MELSOFT Navigator Acknowledge XY Assignment Default Check Cancel Print Window Print Window Preview 1 Select Binary or ASCII code as the communication data code used for MC protocol 2 Select the Enable online change FTP MC Protocol checkbox to enable data to be written to the CPU module even in the RUN state 32 CHAPTER 5 MC PROTOCOL COMMUNICATION 3 Set connections used for MC protocol communication TD Project window gt gt Parameter gt PLC Parameter gt Built in Ethernet Port Setti
126. nged the parameters Write to PLC window module were written to the CPU module from the Write to PLC window If an error related to the simple PLC The file register used for the simple PLC Correct the device number of 4901H communication communication function became out of the file register And power off function occurs at range due to the block number change of and on the CPU module or Other E corresponding setting the file register reset the module errors No If an error related to The communication was stopped the simple PLC because an error occurred at the other 4902H communication setting No for which the same Remove the error cause function occurs at the destination device of the corresponding other setting No setting No had been set The communication was stopped Power off and on the CPU because a stop error occurred in the CPU 4903H If a stop error occurs module Or reset the CPU 128 module where the simple PLC communication function had been set module CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 2 Errors caused by communication failure The errors are stored in the history of Ethernet diagnostics The error codes to be stored are the same as those of communication related errors For error descriptions and the corrective actions refer to the following MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection 3 Operations after the error After the occur
127. nsfer Protocol which is a standard network protocol used to exchange files The abbreviation for Simple Network Time Protocol which is a protocol for synchronizing the clocks of computer systems over a TCP IP based network 15 CHAPTER 1 OVERVIEW 16 The following describes the built in Ethernet function of the CPU module 1 2 3 4 5 6 7 8 Connection of programming tools and GOTs gt Page 20 CHAPTER 3 e By using a hub the CPU module can be connected to multiple programming tools and GOTs Up to 16 external devices can be connected to a single CPU module at the same time e When CPU modules and a programming tool are connected to the same hub these CPU modules can be searched from the programming tool Displayed search results include IP addresses so that any of them can be specified e MELSOFT connection allows access through routers in an environment such as a corporate LAN Direct connection to a programming tool simple connection lt Page 28 CHAPTER 4 The CPU module can be directly connected to a programming tool with a single Ethernet cable only without using a hub simple connection For direct connection the IP address and host name need not be specified in the transfer setup MC protocol communication gt gt Page 31 CHAPTER 5 From an external device such as a personal computer or HMI device data of the CPU module can be read or written and this allows CPU mo
128. o the data during sequence scan at the execution of the COM instruction are subjected to communications Therefore if you want to use exact data in the END processing for the program conduct following operations Transmission source For the program use a different device from the one specified for this function At the end of the program just before the END reflect the data of that device to the one specified for this function Transmission destination At the beginning of the program reflect the data of the device specified for this function to the other device and use that device for the program Incomplete data reception and timeout Because the load of Ethernet communication becomes heavy during the simple PLC communication if the other communication MELSOFT connection or MC protocol is simultaneously performed by using protocol UDP the data reception of UDP may not be completed resulting in a timeout error Therefore to perform other communications during the simple PLC communication the communication using TCP is recommended Also conduct following operations to reduce Ethernet communication load e Increase the execution interval of the simple PLC communication e Reduce the number of device points for communication Communication stop For a certain setting No if the device is waiting for the response of the destination device due to power off of the module cable disconnection or power off of the hub communications fo
129. oint Ifthe FTP communication port is specified as a remote password check target any other commands cannot be used until the remote password is unlocked UOIEDIUNWILWOD dli JO Bumes 18 c Entering file password 32 When file password 32 write or read password is set for the target file the password must be entered with the following command before accessing the file e Write password quote passwd wr write password lt ret gt e Read password quote passwd rd read password lt ret gt 93 8 2 94 Files Transferable Using FTP The following table lists the files that can be transferred using the file transfer function Program Standard Standard memory 2 53 ROM 4 File type Drive 3 Drive 4 Parameter Intelligent function module parameter Program Device comment Device initial value File register Local device Sampling trace file Programmable controller user data 1 Label programming invertible conversion information Drive heading Device data storage file Module error log file Data logging setting file Data logging file Menu definition file User set system area O Available x N A SD memory LJ 0 card 4 File name or extension PARAM QPA IPARAM QPA QPG QCD QDI QDR QDL QTD Arbitrary file name C32 QN DAT DEVSTORE QST IERRLOG QIE LOGCOM QLG LOGO1 QLG to LOG10 QLG CSV MENUDEF QDF 4 The SP FWRITE or SP FREAD instru
130. om the connected device to check if the device returns a response or not If no response is received the alive check message will be resent at intervals of five seconds When no response is received for 45 seconds the connected device is regarded as non existent and the connection is disconnected If the connected device does not support the TCP KeepAlive function the connection may be disconnected Connections exceeding the setting Do not exceed the number of connections set for the open settings parameters Establishing too many TCP connections from a personal computer may cause the following states depending on the application e Time before timeout error detection is increased e An unexpected timeout error occurs in any of the communicating devices Retransmission on TCP connection If no ACK response is returned from the other end of a TCP connection the ACK will be resent six times starting in 0 3 seconds after the first transmission and then 0 6 1 2 2 4 4 8 and 9 6 seconds When no TCP ACK response is returned within 19 2 seconds after the last retransmission the device is regarded as faulty and the connection is disconnected As a result the connection is disconnected in total of 38 1 seconds CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT 5 MELSOFT connection over UDP For UDP communications with multiple MELSOFT devices set the same number of connections as that of the connected MELSOFT devices on the screen displ
131. ommunications can be performed only with a Mitsubishi programmable controller The communications with the programmable controllers manufactured by other companies are not possible lt _ gt Page 119 Section 10 1 3 b O Access via routers is also possible For the access set the subnet mask pattern and the default router IP address gt Page 25 Section 3 4 Note10 1 Check the versions of the CPU module and GX Works2 when using the simple PLC communication function Page 134 Appendix 3 115 10 1 Setting Method To use this function configure the settings in Simple PLC Communication Setting Up to 64 devices can be set in Simple PLC Communication Setting KO Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting Base Setting x Simple PLC Communication Setting Lale la aleta lo i Ao ea l z E ES El ES xl xl El El EZ Ez El E El zl z zi 5 l E E z B E EZ 2 El El l El E 3 EZ Extended Setting Simple PLC Communication Setting KAKEKAKAKAKARI KAKEKAKAKEAKAKI KAKAKAKAKAKAKI 116 CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 1 Communication Pattern Select it from the following items Setting item Description Read Read the data of the specified destination device transmission source to the specified device of the host station transmission destination Write Write the data of the specified devic
132. on Device Select the device from D D extended data register W W extended link register R ZR and specify it as a device to store Execution Interval Current Value 1 Item Description If Fixed Interval is set for Communication Setting the actual execution interval of the Execution Interval Current Value communications is stored If the communications have never been performed properly 0 alue is stored 4 Execution Interval Current Value Save Destination Device cannot be specified overlapped with the following devices e Status Save Destination Device e Execution Interval Current Value Save Destination Device e Source device when the host station is a transmission destination device e Status Save Destination Device that is used for other setting No e Execution Interval Current Value Save Destination Device that is used for other setting No e Source device when the host station is a transmission destination device which is used for other setting No Point For examples of how to use this device refer to gt Page 127 Section 10 2 125 poyan Bues 101 10 Time out period and Retry count Set the time interval until an error is detected or the retry of communication is performed when the destination device for communications does not respond or communications fail Time out Period 10ms to 65535ms 1ms unit Set the number of communication retry to be performed Retry Count when the destinati
133. on device for communications does 0 to 255 2 not respond or communications fail 4 When the destination device for communications is MELSEC A Ethernet Module the value is fixed at 65535ms 2 When the destination device for communications is MELSEC A Ethernet Module the value is fixed at 0 Ex Error detection timing when 2 is set for Retry Count Interval Communication Communication Communication error at the error at the error at the previous time previous time previous time Retry of Retry of i l communication communication I I first time second time Error detection Communication YX 4 Communication MH time out period time out period time out period Point The error is detected if the destination device does not respond or communications fail by when the following time has passed Retry Count 1 x Time out Period a Precautions for retry of communication e Communications at a specified execution interval when Fixed Interval is set for Communication Setting or communications according to the ON status of Request Contact when On Request is set for Communication Setting are ignored during retry of communication because that period is regarded as Time out Period During retry of communication the data at the time of communication error is sent to the destination device for writing of device data and the data at the time of the retry of communication is receive
134. onal computers The functions do not have boundary concept Therefore if the sender sent data by calling the send function once the receiver needs to call the recv function once or more times to read out the data send does not correspond to recv on the one to one basis For this reason the processing shown above is always required on the program of the receiving device Note that if the recv function is used in blocking mode data may be read by calling the function once 3 9 4 Error Codes for MC Protocol Communication When an error occurs during MC protocol communication an errror code is sent from the CPU module to the external device The following table lists error codes error descriptions and corrective actions Error code Hexadecimal 4000H to 4FFFH 0055H CO50H C051H to C054H CO56H C058H CO59H CO5BH CO5CH CO5DH COSFH CO60H C061H CO6FH CO70H COB5H C200H C201H C204H 38 Description Corrective action Refer to the following manual J MELSEC L CPU Module User s Manual Hardware Design Maintenance and Inspection Errors detected by the CPU module Errors occurred in other than MC protocol communication Although online change is disabled the connected device e Before enabling online change write the data requested the RUN state CPU module for data writing e Change the CPU module state to STOP and write the data e Select Binary Code for
135. or Passive open 1 TCP connection There are two types of open operation for TCP connection Active open and Passive open Firstly the device waiting for a TCP connection performs a Passive open at the specified port The other device performs an Active open by specifying the port number of the device which is waiting in Passive open state Through the above process a TCP connection is established and communication is available a Active open Active open is a TCP connection method which actively opens a connection to the device that is passively waiting for a TCP connection b Passive open The following two types of Passive open methods are available for TCP connection e Unpassive Allows a connection regardless of the IP address and port number of the connected device The IP address and port number of the device connected can be acquired using the SP SOCCINF instruction e Fullpassive Allows a connection to the device only when the specified IP address and port number are met A connection made by another device that does not have the specified IP address and port number is automatically disconnected before communication The expressions of Active and Passive opens may vary according to the device e Active open TCP connection initiating device client connecting side etc e Passive open TCP connection waiting device server listening side etc 41 dol Buisp uonesiunwwoy 9 2 Program example for A
136. or other controls to a running programmable controller such as program modification or operating status change read relevant manuals carefully and ensure the safety before the operation Especially in the case of a control from an external device to a remote programmable controller immediate action cannot be taken for a problem on the programmable controller due to a communication failure To prevent this configure an interlock circuit in the program and determine corrective actions to be taken between the external device and CPU module in case of a communication failure O An absolute position restoration by the positioning function may turn off the servo on signal servo off for approximately 20ms and the motor may run unexpectedly If this causes a problem provide an electromagnetic brake to lock the motor during absolute position restoration Design Precautions N CAUTION O Do not install the control lines or communication cables together with the main circuit lines or power cables Keep a distance of 100mm or more between them Failure to do so may result in malfunction due to noise O During control of an inductive load such as a lamp heater or solenoid valve a large current approximately ten times greater than normal may flow when the output is turned from off to on Therefore use a module that has a sufficient current rating O After the CPU module is powered on or is reset the time taken to enter the RUN status varies
137. orrect the network number PC number request destination module I O number or request destination module station number e Correct the read write request data The request cannot be executed to the CPU module The request data is incorrect ex incorrect specification of data for f Correct the request data and resend it to the CPU module bit devices The request data length does not match the number of data in the Check and correct the text data or the request data length of the character area a part of text data header and resend the data to the CPU module The CPU module received a request message in ASCII format when Communication Data Code is set to Binary Code or received it in binary format when the setting is set to ASCII Code This error code is only registered to the error history and no abnormal response is returned e Send a request message that matches the Communication Data Code setting e Change the Communication Data Code setting so that it will match the request message The device memory extension cannot be specified for the target Read data from or write data to the device memory without station specifying the extension e Correct the request data The CPU module cannot handle the data specified e Stop the current request Correct the remote password and unlock and lock the remote The remote password is incorrect password function again The port used for communication is locke
138. other than 1 to 16 Error code 4101 The device numbers specified for 6 2AC and n1 exceed the device point range Error code 4101 e An invalid device is specified Error code 4004 5 Program example When M4000 is turned on the receive data length of connection No 1 is read out e Devices used Device number Application SD1282 Open completion signal SD1286 Receive state signal D400 S SOCRDATA instruction control data D4000 Storage location where data are read out K1 Number of read data one word e Program dl a a a S SOCRDATA U0 K1 D400 D4000 K1 engine Comecion o END 86 CHAPTER 7 TIME SETTING FUNCTION SNTP CLIENT CHAPTER 7 TIME SETTING FUNCTION SNTP CLIENT The CPU module collects time information from a time information server on LAN and automatically sets its own time With this time setting function the CPU module queries the server for time information at the specified timing and can set the time information sent from the server as its own clock data The time setting can performed at the following timing e When the programmable controller is powered off and then on or is reset e At the specified time intervals Execution interval e At the specified clock time Execution time e According to the special relay state 1 Time is set when SM1270 is turned on for one scan LAN Ethernet gt Personal computer Point O Confirm the connection of the
139. program 1 lt lt Fixed length mode setting gt gt SM402 t MOVP K1 D402 Setting TCP receive mode to 1 MOVP K6 D403 Setting receive data size to 6 SP SOCRMODE U0 K1 D400 Changing TCP receive mode of Connection 1 lt lt Target checking gt gt 2 SD1282 0 o YA SP SOCCINF UO K1 D6000 D6010 Obtaining information of connected device lt lt Data sending gt gt M3000 SD1282 0 1 K6 D300 Setting send data length H3412 D301 H7856 D302 Setting send data HOBC9A D303 SP SOCSND uo D300 M300 Sending data to Connection No 1 M300 M301 l SET M3002 Normal completion M301 _ _ SA M3003 Error completion lt lt Data receiving gt gt SD1282 0 SD1286 0 M500 E k 4 SP SOCRCV UO K1 D5000 D500 M500 Receiving data M500 M501 SET M5002 Normal completion M501 l s SET M5003 Error completion 1 There are two kinds of TCP receive modes TCP standard receive mode and TCP fixed length receive mode For fixing the data size run the program enclosed by a dotted line It can be omitted when the data size is not fixed For the TCP receive mode refer to the section for the SP SOCRMODE instruction gt Page 82 Section 6 4 8 2 For acquiring information of the device connected on TCP run the program enclosed by a dotted line It can be omitted when the information acquisition is not needed CHAPTER 6 SOCKET COMMUNICATION FUNCTION d Precaution for Passive open communication Configu
140. r the other setting No might be stopped for 1000ms CHAPTER 10 SIMPLE PLC COMMUNICATION FUNCTION 6 Errors at the destination device If an error related to this function occurs following errors might be detected at the destination device e When the destination device is L Q series Remote password mismatch error e When the destination device is A series Device number specification error Also an error might be detected depending on the settings of the destination device or the conditions of Ethernet communication suonnesald SO 131 Memo 132 APPENDICES Appendix 1 Operation Processing Time for Each Instruction APPENDICES The table below indicates the operation processing times required for the instructions introduced in this manual For the concept of the LCPU operation processing time refer to the following manual MELSEC Q L Programming Manual Common instructions Processing time s Type Condition E E P L26CPU BT L26CPU BT Active SP SOCOPEN 27 20 58 90 23 50 a E the host From the SP SOCCLOSE 18 90 56 60 16 60 connected byte 2046 bytes 16 90 50 70 15 40 1 byte 2046 2046 bytes 1 Ei BN 16 30 46 30 16 00 communication 2046 bytes 504 30 532 60 394 20 l S SOCRCVS function 1 byte 16 30 46 30 16 00 2046 bytes 504 30 532 60 394 20 1 byte 45 70 61 30 36 60 2046 bytes 379 70 395 30 267 60 SP SOCSND 1 byte 45 70 61 30 36 60 2046 bytes 379 70 395 30 267 60 SP SOCCINF o 17 10 43 70
141. rd device can be set for the same setting No Set the total points of setting No 1 to No 64 up to 4096 words 1 for the device points 4 The maximum number that can be set for each setting No is 512 words Maximum points of a word device 256 points Maximum points of a bit device 4096 points Destination device for eee Type Available device communications Bit device X Y M L B SB SM MELSEC Q Ethernet Module E 3 A MELSEC Q L Built in Ethernet Function Word device D D extended data register W W extended link register Y R ZR SW SD Bit device X Y M L B SB SM MELSEC QnA Ethernet Module Word device D W R ZR SW SD Bit device X Y M4 B Word device D W R MELSEC A Ethernet Module 2 The size of a bit device and a word device can be specified in units of 16 points and one point respectively Use 0 or multiples of 16 to specify the device number of a bit device 3 The devices are compatible with the following modules e Universal model QCPU whose serial number first five digits is 09042 or later except the QOODUJCPU e LCPU 4 Use M9000 multiples of 16 when specifying the device of M9000 or later Point Do not write any data to the special relay and the special register that are set on the system side Doing so may cause a system failure or communication failure O For I O processing when X and Y are specified as transmission destination refer to the following MELSE
142. re an interlock circuit using the Open completion signal SD1282 and Open request signal SD1284 in the program The following chart shows on off timings of the Open completion signal and Open request signal TCP disconnection completed by the external device Open completion signal ON SD1282 OFF Open request signal ON SD1284 OFF TCP connection completed by the external device e When a device establishes a connection by Passive open the IP address and port number of the connected device can be acquired using the SP SOCCINF instruction For the SP SOCCINF instruction refer to 2 gt Page 77 Section 6 4 6 On TCP one connection is established with one target device To communicate with multiple devices from one port number prepare the same number of connections as that of the target devices A connection that exceeds the preset number of connections will be disconnected immediately Do not accept a connection from a device until the CPU module is placed in the wait for open state If a TCP connection request is received before entering the wait for open state after completion of CPU startup the request will be recognized as an error and a forced close message for the connection will be returned to the interfacing device In this case wait until the CPU state is changed to the wait for open state and then retry the connection from the device Do not execute the SP SOCCLOSE instruction in a program Doing so wi
143. reaches 256 bytes the Receive state signal is turned on e Device used Device number Application D400 SP SOCRMODE instruction control data e Program M4000 MOVP Ki D402 Setting TCP receive mode to 1 MOVP K256 D403 Setting receive data size to 256 Changing receive mode of SP SOCRMODE U0 K1 D400 Connection No 1 84 CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6 4 9 Socket communication receive data read S P SOCRDATA Command S SOCRDATA JL Command SP SOCRDATA _f Setting data 1 Setting data 6 Connection number Setting range 1 to 16 BIN 16 bit 62 Start number of the device from which control data are stored number of the device from which control data are stored User Device name n number of the device where read data Start number of the device where read data are stored stored Number of read data 1 to 1024 words of read data Number of read data 1 to 1024 words to 1024 words BIN 16 bit 1 The Set by column indicates the following User The data must be set before executing the S P SOCRDATA instruction 2 Control data e O A E C ACI E Completion status is stored SUOI JONIJSU uonouny UOI EDIUNWWOD JONDOS y 9 Completion 62 1 d 0000H Completed System status Other than OOOOH Failed Error code 2 The Set by column indicates the following System The CPU module stores the execution result of the S P SOCRDATA instr
144. rence of the error if the conditions are restored for proper communications data communications are re started at the following timing e When Fixed Interval is set for Communication Setting At the timing of the execution interval e When On Request is set for Communication Setting At the rising OFF to ON of Request Contact uoI9un UO EOIUNWIWWOD 7d ajduis ay 0 pajejal SION Y O 129 1 0 5 Precautions 130 This section provides precautions for the simple PLC communication function 1 2 3 4 5 The timing when the settings are enabled The settings for this function are enabled at the following timing e When powering off and on the CPU module e When resetting the CPU module Even if the values of the settings are changed and the CPU module state is changed from STOP to RUN during execution of this function the CPU module keeps operating with the previous settings If the device setting of PLC parameter is changed and the parameters are written from the Write to PLC window though an error error code 4900p is detected while the parameters are being written Communications with other CPU modules The communications are possible only between the CPU modules connected with Ethernet cable Communications with the other CPU modules cannot be performed through the CPU module connected with Ethernet cable Device data If the COM instruction is used not only the data in the END processing but als
145. responsible for any re commissioning maintenance or testing on site that involves replacement of the failed module Gratis Warranty Term The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place Note that after manufacture and shipment from Mitsubishi the maximum distribution period shall be six 6 months and the longest gratis warranty term after manufacturing shall be eighteen 18 months The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs Gratis Warranty Range 1 The range shall be limited to normal use within the usage state usage methods and usage environment etc which follow the conditions and precautions etc given in the instruction manual user s manual and caution labels on the product 2 Even within the gratis warranty term repairs shall be charged for in the following cases 1 Failure occurring from inappropriate storage or handling carelessness or negligence by the user Failure caused by the user s hardware or software design 2 Failure caused by unapproved modifications etc to the product by the user 3 When the Mitsubishi product is assembled into a user s device Failure that could have been avoided if functions or structures judged as necessary in the legal safety measures the user s device is subject to or as necessary by industry standards had been provided 4 Failure that could hav
146. rogramming tool is also connected and display a list of them PLC side I F Detailed Setting of PLC Module PLC Mode LCPU y oK C Ethernet Port Direct Connection Connection via HUB Please select Connection via HUB when you use hub HUB even if the equipments to be communicated is one G 0 0 0 0 The load hangs to the line when Ethernet Port Direct IP Address Connection is selected with other equipment connected with IP Input Format hub HUB and it communicates and there is thing that DEC si influences the communication of other equipment C Host Name IP address CPU Type Label Comment L26CPU BT CPU 02 2 10 97 79 32 Error monitoring Cl icki ng the Selection IP Address Input button will automatically enter a the IP address of the CPU Response Wait Time 2 sec J view Only PLC Type of Project Selection IP Address qe Find CPU Built in Ethernet port on Network Finds CPU Built in Ethernet port on the same network This cannot be performed when the following happens No response within a specific time period Connected via a router or subnet mask is different Do not respond to search for CPU Built in Ethernet port is checked in PLC parameter CPU modules connected to cascaded hubs are also searched and a list of them is displayed CPU modules connected via a router cannot be searched Some CPU modules connected via wirele
147. ruction refer to 277 Page 80 Section 6 4 7 d Open completion signal and Open request signal Once UDP is selected for a connection the Open completion signal and Open request signal of the connection are always on e SP SOCCLOSE instruction Do not execute the SP SOCCLOSE instruction in the program Doing so will disable data transfer since the Open completion signal and Open request signal of the corresponding connection turn off for close processing To reopen the closed connection execute the SP SOCOPEN instruction For the SP SOCOPEN instruction refer to 2 gt Page 59 Section 6 4 1 f Simultaneous broadcast targets With simultaneous broadcast data can be sent to the devices which are connected to the same hub of the CPU module and to those connected to the cascaded hub s Data cannot be received from the devices connected through routers g Receiving data using simultaneous broadcast When data are received through a connection of simultaneous broadcast the IP address and port number of the sender can be acquired by the SP SOCCINF instruction For the SP SOCCINF instruction refer to 2 gt Page 77 Section 6 4 6 h Connection of simultaneous broadcast Data cannot be sent when FFFFH is specified for the port number of the transmission target To send data specify a value other than FFFFH CHAPTER 6 SOCKET COMMUNICATION FUNCTION i Destination IP address of the message transferred by simult
148. s Displays the current directory of the CPU module current directory of the CPU module Displays the current directory ofthe CPU module o o o o x Disconnects the line to the FTP server and terimnates the connection O Inputs the user name and password of the CPU module CI EIN T O binary bye close delete dir get Is mdelete mdir mget mis mput open put pwd quit quote rename user 96 2 3 4 5 Whether the online change settings is enabled or not is indicated in the Built in Ethernet Port tab in the PLC Parameter dialog box These indicate whether the remote password can be used or not when the FTP communication port is specified as a remote password check target in the remote password setting For remote passwords refer to gt Page 109 CHAPTER 9 On the next page subcommands available with the quote command are shown Each of these commands can include a folder name in the file specification This command is set automatically in the CPU module Therefore a file transfer is coded in binary regardless of the Communication Data Code of the Built in Ethernet Port Setting in PLC Parameter CHAPTER 8 FILE TRANSFER FUNCTION FTP The following table lists the subcommands available with the command quote Subcommand change password lock password unlock status run stop pm write passwd rd passwd wr 4 2 O Available x N A ee module state
149. s from the programmable controller Failure to do so may cause malfunction Shut off the external power supply for the system in all phases before mounting or removing a module Failure to do so may cause the module to fail or malfunction Tighten the terminal block screw within the specified torque range Undertightening can cause drop of the component or wire short circuit or malfunction Overtightening can damage the screw and or module resulting in drop short circuit or malfunction After the first use of the product module display unit and terminal block the number of connections disconnections is limited to 50 times in accordance with IEC 61131 2 Exceeding the limit may cause malfunction After the first use of the SD memory card the number of insertions removals is limited to 500 times Exceeding the limit may cause malfunction Do not drop or apply shock to the battery to be installed in the module Doing so may damage the battery causing the battery fluid to leak inside the battery If the battery is dropped or any shock is applied to it dispose of it without using Before handling the module touch a conducting object such as a grounded metal to discharge the static electricity from the human body Failure to do so may cause the module to fail or malfunction Before testing the operation by the positioning function set a low speed value for the speed limit parameter so that the operation can be stopped immediately upon occurr
150. sas 23 SD memory Card occ 15 ROSSI tai 23 Searching CPU Modules 54 24 A A E E ETE 18 SIMPLE CONNECTION 0 0005 28 Simultaneous broadcast o 53 A E a a a eee cates 15 K SNTP CLIENT ooo ooo 87 KeepAli 26 Socket Communication Function Instructions 58 i i ee E E a eee E SEALS os aia etc E EESE ee oe es T EEE E 104 SOD ha ai A we ae isa aa eS 105 L Subcommand mur a Sore ee awn 97 E A A ar whos ae etal e aA 15 l k processing 2 rata rad 110 ns e dt att 100 137 TOP sia dai ac ita aus sirio 19 TCP fixed length receive mode 83 TCP socket functions 4 4 oh 24s a as 37 TCP standard receive mode 83 TIME SETTING FUNCTION 87 U UDE s pana aa da ara daa 19 unlock processing nanaonan aaa 110 Unpassive nanana aio de dir dada 41 A A te tern cath ent ads ee 102 W WIG Cid aeara da ia a a 98 138 INSTRUCTION INDEX S P SOCRDATA ooon eder cr binesed 85 A edit ea eee E 70 SP SOGCCINE lt 2 teehee cea eb oe eet A 77 SP SOCCLOSE ooo 64 SP SOCCSET esicomiod cried ea 80 SPSOCOPEN cantados 59 SP SOCRCV mum a acta 67 SP SOCRMODE ooo 82 SP SOCSND 000 aaan annaua 73 139 REVISIONS The manual number is given on the bottom left of the back cover Print date January 2010 SH NA 080891ENG A First edition April 201 0 SH NA 080891 ENG B Partial correction Section 8 5 SH NA 080891ENG C Partial corre
151. sn pajejeq og ued yeu Sally 8 The user should back up files using the pm write command as required 2 Page 96 Section 8 4 1 4 The following number of files which can be written using FTP can be stored Maximum number of files storable on the drive 1 Point When the online change settings is disabled in the Built in Ethernet Port Setting tab of PLC Parameter deleting a file in RUN state will cause an error 95 8 4 8 4 1 FTP Commands List of FTP commands O Available x N A CPUmodulestate module state Remote password command STOP Write Write Locked enabled ide E 4 Notifies the FTP server of file transfer without conversion the FTP server of file transfer without conversion nm sto a la gt x Disconnects the line to the FTP server and terminates the session O Disconnects the line to the FTP server the line to the FTP server Disconnects the line to the FTP server O po Lo o O Deletesafieintnecrumode o o gt Displays fleinformaton ofthe CPU moe O o o o gt Readsatetommecpumoae O o o o gt Displays fle names ofthe fles stored nthe CPU mode o o o o Deletes tiets stored nme cpumoaue Jof o o Stores fle information ofthe CPU module inoate o o o o Readsfl s from the CPU mode O o o o Stores CPU modules flenamesinoaie J O o o o IO EY O O E ce OS ls pe CC Tel 6 1 1 gt Display
152. ss LAN may not be found since Ethernet communication may not be stable due to packet loss If multiple CPU modules with the same IP address are found in the list check the IP address parameters for the CPU modules Starting communication with the IP address duplicated will cause a communication error Appropriate CPU modules may not be found if a heavy load for service processing is applied Increase the response waiting time value in the Find CPU Built in Ethernet port dialog box or the service processing time value in the Service processing setting tab of PLC parameter By selecting the option shown below in the Built in Ethernet port tab of PLC parameter the Find CPU function can be disabled and the system does not respond to a search request on the network Enable online change FTP MC Protocol Disable direct connection to MELSOFT secovosotoneseonevesenecssstescsronssonssereeserenesenoteuessstoveseneseossseense esssesausoneserecsdsuosesnstesesestneessnteueosstonessstecessnecesersseesennten e not respond to search for CPU Built in Ethernet port on network CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT 3 4 Communication via Routers From the built in Ethernet port access is available via routers on a network such as a corporate LAN Router SN 4 The following functions do not support the communication via routers e Searching CPU modules on the network e Simultaneous broadcast in socket communication
153. ssful Note Before writing data set the CPU module to STOP passwd rd Function Sets displays and clears the read password file password 32 that is registered to the file transfer target With this command the CPU module checks the read password when access is made to the transfer target file Specification format quote passwd rd read password Any of the following is displayed as an execution result upon completion e When setting a read password 200 Command successful e When displaying a read password 200 Read password is read password e When clearing a read password 200 Command successful e When attempting to display a read password with no read password set 200 Read password is not set 2905 Example 1 When setting a read password ABCD1234 efgh E quote passwd rd ABCD1234 efgh U Y Example 2 When displaying a read password that is currently set to FTP quote passwd rd al mM Example 3 When clearing a read password that is currently set to FTP ae quote passwd rd c or quote passwd rd C Q Note e One read password can be set to FTP of the CPU module When the transfer target file is changed if a read password is preset for the new target 3 n file set the read password of the target file again e When the CPU module is logged in the read password is cleared 105 106 passwd wr Function Specification format Example 1 Example 2 Example 3 Note Sets displays
154. ssion processing l ON i Open completion off FPF signal SD1282 n END END END processing processing processing Sequence program SP SOCSND instruction execution SP SOCSND instruction ON Completion D OFF device OM E Te E E Completion D 1 OFF device ae transmission processing 1 Data transmission may continue even though the completion device turns on ACK TCP only geq UOISSIUWSUEJ 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when e The connection number specified for is other than 1 to 16 Error code 4101 e The device numbers specified for 62 63 and exceed the device point range Error code 4101 e An invalid device is specified Error code 4004 5 Program example When M3000 is turned on data 1234 5678 and 8901 are sent to the target device using the socket communication function ANSIOS AS erep Buipues s y9 SUONONIJSU UONOUN UONCOIUNWIWOY Jey90S 9 e Devices used Device number Application D1282 Open completion signal D3000 SP SOCSND instruction control data D300 Send data length and send data storage location M300 SP SOCSND instruction completion device e Program 19 76 M3000 D1282 0 MA MOV MOV MOV MOV SP SOCSND U0 K1 D3000 M300 M301 M301 K6 K1234 K5678 K8901 D300 SET _ SS HoHfTJH _ WTs sf SET D3
155. tion format Example Locks the remote password set in the CPU module quote password lock The following is displayed as an execution result upon completion 200 Command Okey When locking the remote password quote password lock 3 Use this command only when FTP communication port is specified as a remote password check target run Function Specification format Example 1 Example 2 Example 3 Note estatus Function Specification format 104 Changes the CPU module state to RUN Remote RUN At this time device memory clear can be specified quote run mode clear mode e Mode Specify whether to force remote RUN or not 0 Normal RUN default 1 Forced RUN e Clear mode Specify the CPU module device memory clear initialization processing performed when the operation starts by executing remote RUN 0 Do not clear device default 1 Clear other than the latch range 2 Clear all including the latch range The following message is displayed as an execution result upon completion 200 Command successful When executing remote RUN with Normal RUN and Do not clear device specified quote run When executing remote RUN with Forced RUN and Do not clear device specified quote run 1 When executing remote RUN with Forced RUN and Clear other than the latch range specified quote run 1 1 e Forced RUN should be used only to force remote RUN to the CPU module from anot
156. tion function instructions The following is a list of the instructions area SP SOCOPEN Page 59 Section 6 4 1 SP SOCCLOSE Page 64 Section 6 4 2 SP SOCRCV Reads out received data in END processing Page 67 Section 6 4 3 S SOCRCVS Reads out received data upon instruction execution Page 70 Section 6 4 4 SP SOCSND Page 73 Section 6 4 5 SP SOCCINF Page 77 Section 6 4 6 communication SP SOCRMODE Page 82 Section 6 4 8 S P SOCRDATA Page 85 Section 6 4 9 Point For configuration of data communication using the socket communication function refer to gt Page 41 Section 6 1 Page 50 Section 6 2 If the instruction has a completion device do not change any data such as control data and request data that are specified for the instruction until the execution of the instruction is completed Do not execute any socket communication function instruction in an interrupt program For error codes refer to the following MELSEC Q L Programming Manual Common Instructions CHAPTER 6 SOCKET COMMUNICATION FUNCTION 6 4 1 Establishing a connection SP SOCOPEN Command SPSOCOPEN f Setting Internal device data e File registers set for each local device or program cannot be used 1 Setting data Start number of the device which turns on for one scan upon completion of the instruction System Bit D 1 also turns on when failed 2 The Set by column indicates the following User T
157. tribute of the file stored in the standard RAM quote change 3 MAINSEQ1 QDR Example 2 When changing the attribute of the file stored in the standard RAM quote change 3 MAINSEQ1 QDR r password unlock Function Specify the remote password set in the CPU module to unlock the password Specification format quote password unlock remote password e Remote password Specify the remote password set with a parameter for the CPU module The following is displayed as an execution result upon completion 200 Command Okey The following is displayed if the entered remote password does not match the setting 556 Password Error The following is displayed if another command is requested before unlock processing of the remote password 555 Password Locked SPUBEWUIWOD d1i3 V8 Example When specifying a remote password 1234 quote password unlock 1234 SpueWWOD dl4 jo S8990 p 8 Note e The remote password is locked when you log in if the remote password check is enabled for the FTP communication port e By executing this command before various FTP operations the password is unlocked allowing file operations of the CPU module e Unlock processing will be completed if the remote password is unlocked when the remote password check is disabled for the FTP communication port 2 Use this command only when the FTP communication port is specified as a remote password check target 103 password lock Function Specifica
158. uction VLVGHOOS d S pea eyep SsaledeJ UOH eEdIUNWWOD JayDos 6 y 9 3 Function This instruction reads out the data of the amount specified for n from the Socket communication receive data area of which connection is specified in 6 and stores them in the device specified in or higher No processing is performed when the number of read data n is 0 85 Point O Data of the receive data length can be read out by setting the number of read data to one word This allows change of the device storing receive data upon execution of the SP SOCRCV or S SOCRCVS instruction O In the following order based on the data currently received the size of the data received the next time can be specified 1 Check the data currently received using the S P SOCRDATA instruction 2 Specify the size of the data to be received the next time using the SP SOCRMODE instruction 3 Read out the data currently received using the SP SOCRCV or S SOCRCVS instruction O Even if the S P SOCRDATA instruction is executed the next receive data will not be stored in the Socket communication receive data area because the area is not cleared and the Receive state signal does not change O To update the receive data read out the data using the SP SOCRCV or S SOCRCVS instruction 4 Error A detection of an operation error turns on the Error flag SMO and a corresponding error code is stored in SDO when e The connection number specified for 6 is
159. ultaneous broadcast is available Select an appropriate protocol considering the specifications of the external device and the characteristics of the above protocols 19 CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT This chapter explains how to connect the CPU module to a programming tool or GOT Programming Programming GOT tool tool To start Ethernet communication perform the following steps Start L gt Page 21 Section 3 1 Setting parameters Configure PLC parameters by the programming tool Writing to the CPU module Write the configured parameters to the CPU module Power it on again or reset it for the parameters to take effect gt Page 21 Section 3 1 Connecting cables and external devices Connect cables and devices required for Ethernet communication Setting the connection target Seta connection target by the programming tool gt Page 23 Section 3 2 For the GOT setting refer to the following manual GOT1000 Series Connection Manual Mitsubishi Products 20 CHAPTER 3 CONNECTION OF PROGRAMMING TOOLS AND GOT 3 1 Setting for the CPU Module 1 PLC parameter setting Select the Built in Ethernet Port Setting tab and set the parameters O Project window gt Parameter gt PLC Parameter gt Built in Ethernet Port Setting L Parameter Setting PLC Name PLC System PLC File PLCRAS Boot File Program 5FC IP Address Setting 3 Open Setting l
160. vices in units of 16 points 15360 points of words 0000 Writes word devices in units of one point 960 points Reads bit devices in units of 16 or 32 points by Random In units 0403 randomly specifying the target f 192 points O Device read 2 of words 0000 Reads word devices in units of one or two points E dl memory E dl specifying the target ko units ul Sets or resets bit devices in units of one point by CS ainis ko bits ul randomly specifying the target CS Test Sets or resets bit devices in units of 16 or 32 e Random In units 1402 e randomly specifying the target write of words 29 0000 Writes word devices in units of one or two points by randomly specifying the target l Registers bit devices to be monitored in units of 16 Monitor n units 0801 or 32 points registration 192 points O 209 3 4 of words 0000 ee word devices to be monitored in units of one or two ee In units a as of Monit Monitors the d istered EM Specifies a remote password to unlock the locked Unlock O Remote 0000 state password 1631 Specifies a remote password to lock the unlocked 0000 state O These commands are for QnA compatible 3E frames Devices TS TC SS SC CS and CC cannot be specified in units of words Specifying any of these for monitor registration will cause an error 40324 at the time of monitoring execution ge For monitor registration monitoring conditions cannot be set 4 Do not execute
161. ware version of the CPU module and GX Works 2 that support the function i Serial No first 5 digits Added function GX Works2 version Reference of CPU module Simple PLC icati ee Pa sense et 13042 or later 1 62Q or later Page 115 CHAPTER 10 unction 134 APPENDICES Appendix 4 Performance List of Simple PLC Communication Function This section shows the performance of the execution interval simple PLC communication function The execution interval varies depending on the number of settings the number of communication points the scan time of the CPU module The interval is also affected by the execution conditions of other functions or Ethernet communication condition 1 Condition 1 e Communication Setting Fixed Interval e Destination device MELSEC Q L Built in Ethernet Function L26CPU BT e Sequence scan time host station 1ms the period before the execution of simple PLC communication function e Sequence scan time destination device 1ms The destination device means both the transmission source and transmission destination for data transfer e Device data Bit device M Word device D e Number of settings The number of destination devices Double the number for data transfer e The retry of communication is not performed Processing time by the number of Communica Number of communication points for one CPU module faa Ss a unit ms tion Pattern setting Z ae a e A We i LO2CPU P

Download Pdf Manuals

image

Related Search

Related Contents

新サンダポリッシャ 新サンダポリッシャ      Manual  IMPRESORAS Y CONSUMIBLES CON PRECIOS  ESB 2008 Laydown User Manual  Aiwa AV-D30 Stereo System User Manual  27ページ~29ページ  Xerox Benutzerhandbuch  Moteur - DB Moteurs  

Copyright © All rights reserved.
Failed to retrieve file