Download  Print this page

Toshiba V Series User Manual

Integrated controller ethernet module, en311
Hide thumbs

Advertisement

6F8C0904
Integrated Controller V Series
Ethernet module (EN311) User's
Manual
Sep 30, 2004

Advertisement

Table of Contents
loading

  Also See for Toshiba V Series

  Related Manuals for Toshiba V Series

  Summary of Contents for Toshiba V Series

  • Page 1 6F8C0904 Integrated Controller V Series Ethernet module (EN311) User’s Manual Sep 30, 2004...
  • Page 2 Important Information No patent liability is assumed by TOSHIBA Corporation with respect to use of information, illustrations, circuits, equipment or examples of application in this publication. TOSHIBA Corporation reserves the right to make changes and improvements to this publication and/or related products at any time without notice.
  • Page 3 Safety Precautions This manual contains important information for the operator to operate this product safely and correctly and avoid bodily injury and property damage. Grasp the meanings of the following marks and their descriptions before reading this manual. Hazard Classifications Indicates a potentially hazardous situation which, if not avoided, WARNING could result in serious injury or death.
  • Page 4 1. Checking the Warning Labels on the Main Unit Make sure warning markings are attached on the main unit. If any of them are missing or the wording is illegible, contact Toshiba's Service Department. 2. Precautions on Installation WARNING Mandatory Be sure to ground the equipment.
  • Page 5 Mandatory Mandatory 1. In configuring a system using 10BASE5, 1. Before applying voltages to the MAU power make sure not to exceed the maximum terminal board, be sure to correctly connect cable length of 500 m per segment and the the 12-VDC cable with attention to the maximum number of MAUs(100) positive and negative polarities.
  • Page 6 Forbidden Forbidden 1. Before mounting or removing the EN311, be 1. The EN311 cannot be simultaneously sure to switch power off (S controller power connected to 10BASE5 and 10BASE2 and network power). Failure to do so can systems. cause electric shock or fire. 2.
  • Page 7 CAUTION Mandatory Forbidden Touch a grounded metal part to discharge the Be careful not to hit or fall off the equipment by static electricity on your body before touching accident. the equipment. Excess shock can cause failure. Otherwise, charged static electricity on your body can cause malfunction or failure.
  • Page 8 User's manual. in the equipment. Otherwise, it can cause malfunction, machine Contact Toshiba for repairing. damage or fire due to overheat. Operation under such situation can cause fire or electrical shock.
  • Page 9 6. Safety Precautions on Disposal WARNING CAUTION Forbidden Mandatory Do not throw lithium batteries into fire. In disposing of the lithium battery or Ni-Cd Otherwise, they can explode. battery, observe the rules and regulations of the local administration. Mandatory Observe local regulations for disposal of the lithium batteries or the product (Base unit and modules).
  • Page 10 CAUTION Mandatory Forbidden 1. Ensure adequate safety in changing a 1. The EN311 cannot be simultaneously program or delivering a forced output during connected to 10BASE5 and 10BASE2 operation, or in performing RUN, HALT, or systems. other operations. Do not connect unused network cables to Operation errors could cause mechanical the EN311.
  • Page 11 Toshiba is not liable for any incidental loss caused by the use or non-use of this product, such as loss of business profits, suspension of business, or loss or change of data on memory.
  • Page 13 Preface This manual describes the specifications of the Ethernet Module (referred to as the EN311) for PROSEC-T3H, handling of it when used by the Integrated Controller V Series model 3000 Controller, and presents sample programs. When using this product, use the product correctly based on a thorough reading of this manual.
  • Page 14 If the ambient temperature of the internal temperature of the equipment has arisen too high, or if the equipment has developed a fault, stop using it, switch power off, and contact the nearest Toshiba service station. Do not open the case of the equipment while it is in operation except when setting the switches.
  • Page 15 Describes how to install the V Series Engineering Tools onto your PC. "Engineering Tools - Basic" (6F8C0875) Describes how to write, debug, print out, and save the programs using the V Series Engineering Tools. "T Series Computer Link Operation Manual" (UM-TS03***-E008) Describes the specifications and handling of the computer link protocol transmission functions built into the V Series Controller.
  • Page 17: Table Of Contents

    CONTENTS 1 Ethernet Module (EN311) Overview ..1 1.1 Introduction ....... . . 1 1.2 Standards and Terminology .
  • Page 18 CONTENTS 5 Computer Link Protocol and the PC Link Protocol Transmission . . . 63 5.1 Computer Link Protocol Transmission ... . 64 5.2 Sample Computer Link Protocol Program ..65 5.3 PC Link Protocol Transmission (Data write) .
  • Page 19 CONTENTS 7 RAS Information ....161 7.1 Station Status Information ....162 7.2 Down Information .
  • Page 20 CONTENTS G Change/correction function in a firmware ......231 G.1 Revision J ....... . 231 G.2 Revision K .
  • Page 21: Ethernet Module (En311) Overview

    PROSEC T3H, when it is used in the Sequence Control Module S3 of the Integrated Controller V series model 3000. Hereafter, the Sequence Control Module S3 of the V series model 3000 is called the S controller and the Ethernet Module for PROSEC T3H is called the EN311.
  • Page 22: Standards And Terminology

    Chapter 1 Ethernet Module (EN311) Overview 1.2 Standards and Terminology Generally, both the Ethernet Version 2.0 (DIX standard) established by the three companies (DEC, Intel, and Xerox) and the ISO8802-3(IEEE802.3) which has been internationally standardized based on the DIX standard are called the "Ethernet". Because ISO8802-3 standard includes the DIX standard, the network devices developed according to each standard are basically compatible.
  • Page 23: Firmware Revisions Of En311 Supported By

    1.3 Firmware Revisions of EN311 Supported by S Controller 1.3 Firmware Revisions of EN311 Supported by S Controller The S controller supports only the modules having firmware revisions with I (i) or later. The revisions are made in descending alphabetic order. The firmware revisions can be identified by the EN311 serial numbers.
  • Page 24: Basic Functionality

    Chapter 1 Ethernet Module (EN311) Overview 1.4 Basic Functionality The EN311 has the following main features. (1) T series computer link protocol transmission (slave station) The host machine can upload or download user programs, execute control commands, and read or write register data to an S controller on the 10BASE5/2 LAN using the T series computer link protocol.
  • Page 25 1.4 Basic Functionality (2) T series/PC link protocol transmission The S controller can use the T series/PC link protocol to read or write register data on another S controller on the 10BASE5/2 LAN or to the PROSEC-T3H/T2N. The S controller user programs for reading and writing are necessary to use the host functions.
  • Page 26 Chapter 1 Ethernet Module (EN311) Overview (3) Socket interface support This is a standard communications technique used on engineering workstations (EWS) and similar computers. Transmission between user programs on the S controller and host machines is possible using the socket interface. There are eight sockets on an EN311 and the transmission protocol (TCP/IP or UDP/ IP) can be specified for each socket.
  • Page 27 1.4 Basic Functionality (4) Routing feature support In order to exchange data between an EN311 on Network A which supports routing feature and a PC on Network B, the EN311 should pass the transmission data to the router. This is called an indirect routing and is supported by EN311. S controller Workstation EN311...
  • Page 28 Chapter 1 Ethernet Module (EN311) Overview (5) Other features The EN311 can connect to either a 10BASE5 or a 10BASE2 network. A 10BASE5 or a 10BASE2 can be simply selected by a switch on the front panel, although simultaneous connection to both networks is not possible. (a) 10BASE5 Transmission method: Baseband Data transmission rate: 10 Mbps...
  • Page 29 1.4 Basic Functionality (b) 10BASE2 (The MAU is built into the EN311) Transmission method: Baseband Data transmission rate: 10 Mbps Maximum segment length: 185 meters Number of nodes per segment (Number of MAUs): 30 Minimum distance between MAUs: 0.5 meters This network uses 50W coaxial cable as the transmission cable.
  • Page 30: En311 Specifications

    Chapter 1 Ethernet Module (EN311) Overview 1.5 EN311 Specifications Table 1-2 lists the EN311 specifications. The general specifications of the EN311 conform to those of the S controller. Table 1-2 Functional Specifications Item Specification Module type EN311 Transmission specifications 10BASE5(Ethernet) 10BASE2(Cheapernet) Media access method CSMA/CD...
  • Page 31 1.5 EN311 Specifications Table 1-2 Functional Specifications Item Specification Mounting method In the Integrated Controller V Series, parallel I/O bus on model 3000 (G3 bus) Number of modules mountable 4 modules per unit USEND_T/URCV_T function block (module control and transmission functions)
  • Page 32: Software Configuration

    Chapter 1 Ethernet Module (EN311) Overview 1.6 Software Configuration The EN311 transmission functions (computer link protocol transmission, PC link protocol transmission, and socket interface transmission) are implemented with the software configuration shown in the following figure. S controller user program USEND_T /...
  • Page 33 1.6 Software Configuration When EN311 receives data, EN311 notifies data reception to S controller regard- less of a status of the PSH bit. • Reset packet (packet which the RST bit is set to ON) If the firmware of EN311 is after Revision I, transmission/reception of a reset packet is possible for EN311.
  • Page 35: En311 Parts And Functions

    Chapter 2 EN311 Parts and Functions This chapter describes the sections of the EN311 and their functions. 6F8C0904...
  • Page 36: Outline Drawing

    Chapter 2 EN311 Parts and Functions 2.1 Outline Drawing Figure 2-1 EN311 Outline Drawing Ethernet module User’s Manual...
  • Page 37: Dimensions And Components

    2.2 Dimensions and Components 2.2 Dimensions and Components LED displays Reset switch Test connector (9-pin D-SUB connector) 10BASE2 connector 10BASE2/10BASE5 selection switch 10BASE5 connector LED display MAU power supply terminal block Figure 2-2 EN311 Dimensions (Front and Side) Unit (mm) 6F8C0904...
  • Page 38: Component Functions

    Chapter 2 EN311 Parts and Functions 2.3 Component Functions (1) LED display Indicators that display the EN311 operating state. See section 2.4, "LED Display", for detailed information. (2) Reset switch Used to reset the EN311 module as a unit. Usage Recommendations To press the reset switch, use a pointed object, such as a ballpoint pen, to press •...
  • Page 39: Led Display

    2.4 LED Display 2.4 LED Display The LEDs on the EN311 front panel indicate the status of the system. These LEDs show the operating state of the EN311. Table 2-1 LED Descriptions Description RUN (Run) Indicates whether or not the module is operating normally. Green On .
  • Page 41: Preparing For Operation (Hardware)

    Chapter 3 Preparing for Operation (Hardware) 3.1 EN311 Setup Flowchart (Hardware) Warning • Build emergency stop, interlock, and similar circuits outside the PC that includes the EN311. If a breakdown or malfunction occurs in the PC or the EN311, there is the danger that some- one could be hurt or fatally injured.
  • Page 42: Switch Settings

    Chapter 3 Preparing for Operation (Hardware) 3.2 Switch Settings The EN311 provides two connected switches that are used to switch between 10BASE5 and 10BASE2 networks, i.e., to select the connected network type. Caution • The EN311 cannot be connected to both a 10BASE5 and a 10BASE2 network concurrently. Do not connect a network cable of the unused type to the EN311.
  • Page 43: Mounting The En311 In The Base Unit

    Caution • The EN311 is designed specially for the V Series model 3000 and should only be mounted and used in a V Series model 3000 base unit. Do not use this module independently or mounted in any other equipment. Such usage could result in electric shocks, personal injury, or damage to the EN311 and other equipment.
  • Page 44: Connecting To The Network

    Chapter 3 Preparing for Operation (Hardware) 3.4 Connecting to the Network Since the EN311 supports both 10BASE5 and 10BASE2 networks, select either a 10BASE5 or 10BASE2 network according to your system needs. Caution • The EN311 cannot be connected to both a 10BASE5 and a 10BASE2 network at the same time.
  • Page 45 3.4 Connecting to the Network Caution • When installing a 10BASE5 or 10BASE2 network, the cabling must be handled with ade- quate safety precautions and in accordance with all applicable standards. A qualified profes- sional should perform installation and wiring. See the "ISO/IEC 8802-3"...
  • Page 46 Chapter 3 Preparing for Operation (Hardware) (a) Align the groove in the T connector with the protrusion on the 10BASE2 connector and insert the connector in the plug. (b) With the connector inserted in the plug, rotate the ring on the plug 1/4 turn in the clockwise direction to lock the BNC connector in place.
  • Page 47: Mau Power Supply

    3.5 MAU Power Supply 3.5 MAU Power Supply Since the EN311 supplies 12-V DC power to the 10BASE5 MAU and the 10BASE2 MAU (the latter of which is build into the EN311), an external 12-V DC power supply must be connected to the MAU power supply terminal block.
  • Page 48 Chapter 3 Preparing for Operation (Hardware) (2) Procedure for Applying External Power External power should be turned on and off at the same time as the S controller power as near as one can do. If simultaneous power supply on/off operations are not possible, turn these power supplies on and off in the following sequences.
  • Page 49: Network Wiring Equipment

    3.6 Network Wiring Equipment 3.6 Network Wiring Equipment This section describes the wiring and related equipment that makes up the network to which the EN311 is connected. Since the EN311 conforms to the ISO 8802-3 (IEEE 802.3) standard, you should select equipment to be used in the network that also conforms to this standard.
  • Page 50 Chapter 3 Preparing for Operation (Hardware) (2) 10BASE2 • Coaxial cable Catalog no. RG-58A/U Standard outer diameter 5.0 mm diameter, with BNC plugs at both ends Manufacturer Showa Electric Wire & Cable Co., Ltd. • BNC plugs Catalog no. EPL-1067 Manufacturer Showa Electric Wire &...
  • Page 51: Preparing For Operation (Software)

    Chapter 4 Preparing for Operation (Software) This section describes how to set up the EN311 software for operation. Caution • Make sure you understand the content of chapter 4 thoroughly before writing programs. The sample programs present basic examples of EN311 usage, and should be reviewed care- fully before using them in an actual system.
  • Page 52: Module Setup Flowchart (Software)

    4.1 Module Setup Flowchart (Software) The following figure shows the flowchart for EN311 setup. Start Register the EN311 with the S controller using the V Series Engineering Tool. Register the EN311 with the controller For details, see section 4.2, "Registering the EN311."...
  • Page 53: Registering The En311

    4.2 Registering the EN311 4.2 Registering the EN311 This section describes how to register the EN311 when it is connected to and used with the S controller. Supplemental Remarks • Before registering the EN311, you should register the system, station, and controller folders of the target with the engineering tool.
  • Page 54 Chapter 4 Preparing for Operation (Software) (2) Connecting the module - Example 1 Connect the EN311 to Slot 6 on the main unit. Select "Main Unit" and select "Connections in module". Double-click an empty slot to display the Module List Menu. Double-click here Ethernet module User’s Manual...
  • Page 55 4.2 Registering the EN311 (3) Connecting the module - Example 2 Choose and highlight "EN311" from the Module List Menu, and click the "Connect(C)" button. "EN311" appears on Slot 6 of "Hardware Configuration" as shown in the following page. "EN311" appears in red at that time, because the registration data has not been saved yet.
  • Page 56 Chapter 4 Preparing for Operation (Software) (4) Saving the registration data Choose the "File" menu and then the "Save As" command from the configuration editor menu to save the EN311 registration data. The registration data is saved and the module name becomes black. If this is in red, it has not been registered yet.
  • Page 57: En311 Operation Modes And Station Statuses

    4.3 EN311 Operation Modes and Station Statuses 4.3 EN311 Operation Modes and Station Statuses The EN311 operation modes and its station statuses are described here. The method for controlling the operation modes is described in section 4.8, "Operating Mode Control Requests".
  • Page 58 Chapter 4 Preparing for Operation (Software) Power down Self-check completed normally Initialize Standby Reset request Initialization Turning on the power Run request Standby request completed again/reset switch abnormally Unrecoverable error occurred Down Unrecoverable error occurred Figure 4-2 EN311 Mode Transition The EN311's operation statuses (station statuses) are allocated to the special registers of the S controller I/F memory.
  • Page 59: Function Block Specifications For En311 Control

    EN311 module control and transmission control (PC link protocol transmission and socket interface transmission) are performed solely using above function. Refer to "The V Series LD/FBD/SFC Instructions Manual" for MREAD instruction. See the individual items described in the section 4.5, "EN311 Reset (Reset Request)" or after for details on the actual requests sent to the EN311.
  • Page 60 Chapter 4 Preparing for Operation (Software) (2) Functions • For the EN311, this is the function block to request module control, TCP/IP protocol, and/or UDP/IP protocol communication. • When an execution request(REQ) becomes TRUE(ON) from FALSE(OFF), the N number of transmit data words will be routed from transmission data P with the contents of the specified transmission command (CMD).
  • Page 61: Urcv_T Function Block

    4.4 Function Block Specifications for EN311 Control 4.4.2 URCV_T function block Communication FB Socket Communication - Send Diagram URCV_T DONE Completion output Execution request ERROR Transmit com mand Error STATUS Transmit data Socket number or error status Number of data words transm itted Modification EN input...
  • Page 62: Socket Service Commands List

    Chapter 4 Preparing for Operation (Software) • When the reception ends with an error, the error(ERROR) becomes TRUE(ON) for one scanning time and the error status(error description) is displayed on the STATUS. The completion output (DONE) does not turn ON if an error occurs. Socket Service Commands used by URCV_T Description Command...
  • Page 63 4.4 Function Block Specifications for EN311 Control Considerations (1) Types (1) - (3) are command classes. Class 1 is module control, Class 2 is PC link protocol transmission, and Class 3 is socket interface transmission. (2) For a single EN311 module, it is not possible to request another Class 1 command by entering a start up signal to execution request (REQ) while the EN311 is executing a Class 1 command.
  • Page 64: Error Status List

    Chapter 4 Preparing for Operation (Software) 4.4.4 Error Status List The status right after the completion of the USEND_T or URCV_T execution is displayed at STATUS. If the error status is 16#EC**(-50**), it means that the error was detected on the CPU module side.
  • Page 65 4.4 Function Block Specifications for EN311 Control Table 4-3 Detailed Information Error Code Description Normal complete Local station fault The local station is in down mode Local station standby In standby mode, data transmission was requested. Timeout Timeout occurred during TCP open/receive processing, or during UDP receive processing.
  • Page 66 Chapter 4 Preparing for Operation (Software) Table 4-3 Detailed Information Error Code Description LAN controller driver Occurs if the setting of the local station IP address/port error number in the area reserved for transmission fails. • Error in the TCP or UDP protocol (such as a transmission phase error) •...
  • Page 67: En311 Reset (Reset Request)

    4.5 EN311 Reset (Reset Request) 4.5 EN311 Reset (Reset Request) This section describes the EN311 reset procedures. There are three ways to reset an EN311 as follows: (1) S controller power on (2) Reset switch (3) Reset by a user program running on the S controller In EN311 reset processing, when one of the above resets occurs, the module first performs the self-check described below.
  • Page 68 Chapter 4 Preparing for Operation (Software) (3) Reset request from the S controller It is possible to initiate reset processing from user programs on the S controller. This section describes the format of the reset processing instruction. Reset request (using the USEND_T instruction) The user program requests an initialization to the EN311.
  • Page 69: Parameter Setup Request

    4.6 Parameter Setup Request 4.6 Parameter Setup Request This section describes the procedure for EN311 parameter setup in the EN311 from an S controller user program. The EN311 parameters consist of the following: (1) Local station IP address (2) UDP port number for computer link/PC link transmission Here we first describe the IP address, subnet mask, and port number, which are the parameters required for TCP/IP and UDP/IP transmission.
  • Page 70 Chapter 4 Preparing for Operation (Software) (b) IP address acquisition Taking future uses into account, we strongly recommend acquiring an official IP address. (c) Notes on IP addresses The following IP addresses cannot be used with the EN311, both for the local station and for remote station addresses.
  • Page 71 4.6 Parameter Setup Request Usage Recommendations • The EN311 does not allow the user to set the subnet mask. Therefore the EN311 cannot be used in systems that operate a subnetwork. (3) Port number An IP address identifies a particular node (station) on a network. However, since, on any given node, there will be multiple applications using TCP/IP or UDP/IP to communicate with applications on other nodes, the question of to which application the data should be passed arises.
  • Page 72 Chapter 4 Preparing for Operation (Software) (b) IP address setup procedure For the address 133. 113. 90. 10 85H. 71H. 5AH. 0AH CMD+2 CMD+3 (c) UDP port number for message transmission As described in Chapter 1, UDP/IP is used for both computer link and PC link protocol transmission, which are collectively referred to as message transmission.
  • Page 73: Router Ip Address Setup Requests

    4.7 Router IP Address Setup Requests 4.7 Router IP Address Setup Requests This section describes how to setup the router IP address from the S controller user program. The following is the format of the router IP address setup request. Router IP address setup request (using the USEND_T instruction) The router IP address is setup for the EN311 in standby mode from the user program.
  • Page 74 Chapter 4 Preparing for Operation (Software) (3) Considerations • The EN311 can be set in a run mode with "operation mode control request" with- out setting the router IP address. In this case, no routing will be done. • If this request is issued when EN311 is in run mode or down mode, an error will occur.
  • Page 75: Operating Mode Control Requests

    4.8 Operating Mode Control Requests 4.8 Operating Mode Control Requests This section describes the procedures for controlling the EN311 operating mode from user programs on the S controller. This section describes the operating mode control request instruction format. Operating mode control request (using the USEND_T instruction) This is a request from a user program that controls the EN311 operating mode.
  • Page 76 Chapter 4 Preparing for Operation (Software) Examples: Standby request - 2000H Run request - 1030H (Allows both message transmission and socket interface transmission) 1010H (Allows socket interface transmission only) 1020H (Allows message transmission only) (3) Considerations • Values other than 1010H, 1020H, 1030H, and 2000H may not be specified for the specified information.
  • Page 77: Initialization Sample Program

    4.9 Initialization Sample Program 4.9 Initialization Sample Program This section describes the sample program that puts the EN311 into a run mode. After the EN311 enters the run mode, it becomes possible to use the slave station functions of the computer link/PC link. Sample program specification: EN311 is installed into Slot 6 on the base.
  • Page 78 Chapter 4 Preparing for Operation (Software) (1) Defining the variables (*======================================== EN311 UDP SOCKET TEST PROGRAM (SEND) ========================================*) SLOTW: WORD; (* Slot specification *) OPEN_READ: BOOL; MREAD_CMP: BOOL; MREAD_CMPX: BOOL; STN_STS: WORD; (* Station status *) STBY_REQ: BOOL; PARA_REQ: BOOL; CMP_MODE: BOOL;...
  • Page 79 4.9 Initialization Sample Program (2) Program (*STATION STATUS CHECK* SLOTW MOVE_WORD OPEN_READ MREAD_CMP MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP STBY_REQ PARA_REQ MREAD_CMPX MREAD_CMPX STN_STS STN_STS AND_WORD 16#1000 STN_STS STBY_REQ EQ_WORD 16#1000 STN_STS PARA_REQ NE_WORD 16#1000 6F8C0904...
  • Page 80 Chapter 4 Preparing for Operation (Software) (*OPERATION MODE CONTROL REQUEST "STANDBY"*) %MW3.310 MOVE_WORD %MW3.311 16#0313 MOVE_WORD %MW3.312 16#2000 MOVE_WORD USEND_T_1 STBY_REQ CMP_MODE USEND_T DONE %MW3.310 ERR_MODE ERROR STS_MODE %MW3.290 STATUS %MW3.290 (*RESET REQUEST*) %MW3.300 MOVE_WORD %MW3.301 16#0311 MOVE_WORD USEND_T_2 CMP_MODE CMP_RESET USEND_T DONE...
  • Page 81 4.9 Initialization Sample Program (*PARAMETER SETTING REQUEST*) %MW3.320 MOVE_WORD %MW3.321 16#0312 MOVE_WORD %MD3.322 16#85715A0A MOVE_DWORD %WM3.324 2000 MOVE_WORD USEND_T_3 CMP_RESET CMP_PARA USEND_T DONE PARA_REQ %MW3.320 ERR_PARA ERROR STS_PARA %MW3.290 STATUS %MW3.290 (*OPERATION MODE CONTROL REQUEST "RUN"*) %MW3.310 %MW3.310 MOVE_WORD MOVE_WORD %MW3.311 %MW3.311 16#0313...
  • Page 82 Chapter 4 Preparing for Operation (Software) (*STATION STATUS CHECK*) SLOTW MOVE_WORD CMP_MODE2 MREAD_CMP2 MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP2 STN_STS STN_STS AND_WORD 16#1000 STN_STS NOT_RUN NE_WORD 16#1000 STN_STS RUN1 EQ_WORD 16#1000 Ethernet module User’s Manual...
  • Page 83: Computer Link Protocol And The Pc Link Protocol Transmission

    Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission This chapter describes the computer link protocol transmission from the host machine and PC link protocol transmission with the S controllers(including S controller and T2N). Caution • Be sure to understand the contents of Chapter 5 thoroughly before writing programs. The sample programs present basic examples of EN311 usage, and should be reviewed care- fully before use in an actual system.
  • Page 84: Computer Link Protocol Transmission

    Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission 5.1 Computer Link Protocol Transmission Toshiba developed the T series computer link protocol transmission for use in controlling the PROSEC-T Series programmable controllers. A host computer is able to used the...
  • Page 85: Sample Computer Link Protocol Program

    This program issues a read/write request for 32 words from the start of the S controller D registers. Operating environment • Hardware: Toshiba J-3100PV, PC/AT compatible 3Com Etherlink III (3C509/B) • Software: PC-NFS Pro 1.1.1.0 Microsoft VisualC++ 1.0 Transfer parameters •...
  • Page 86 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission /**************************************************************************************************************/ /* SAMPLE.H /* Write/Read requests can be issued to other T3H units by modifying this definition file. /* (C) Copyright TOSHIBA Corporation 1995 All Rights Reserved /**************************************************************************************************************/ /*------------------------------*/...
  • Page 87 /* link function. /* This program issues read/write requests to the specified T3H registers. /* Also note that registers in other stations can be accessed by modifying the SAMPLE.H definition file. /* (C) Copyright TOSHIBA Corporation 1995 All Rights Reserved /**************************************************************************************************************/ /*---------------------------*/...
  • Page 88 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission /*---------------------------------*/ /* Prototype declarations */ /*---------------------------------*/ int cl_send( int ); /* Register read/write processing void main() int ists; /* Return status int isdp ; /* Socket identifier int i /* Loop counter struct sockaddr_in Soc;...
  • Page 89 5.2 Sample Computer Link Protocol Program /* SLW */ /**************************************************************************************************************/ cl_send - Register read/write processing /**************************************************************************************************************/ Calling sequence cl_send(); /* Arguments: Isdp : int I : socket identifier ists : int O : return status /**************************************************************************************************************/ int cl_send( int Isdp ) int j, k /* Loop counter int ists = 0 ;...
  • Page 90 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission icunt = icunt + 4 ; sprintf( &csnd[ (strlen( csnd )) - 1], ")\r" ) ; isndsiz = strlen( csnd ); /* Set the send data length Snd.sin_family = AF_INET; Snd.sin_addr.s_addr = inet_addr( DST_IP );...
  • Page 91 5.2 Sample Computer Link Protocol Program /* Register read response reception ists = recvfrom( Isdp, crcv, sizeof( crcv ), 0 ,(struct sockaddr *)&Rcv, &ircvsiz) ; if ( ists > 5 ){ if( crcv[ 6 ] == ’C’ && crcv[ 7 ] == ’E’ ){ iret = -1 ;...
  • Page 92: Pc Link Protocol Transmission (Data Write)

    Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission 5.3 PC Link Protocol Transmission (Data write) The T series PC link protocol allows a local S controller to write register data to another S controller/T3H/T2N on a network. As is the case with the computer link protocol, the PC link protocol uses UDP/IP as its transmission protocol.
  • Page 93 5.3 PC Link Protocol Transmission (Data write) Register write request (using the USEND_T instruction) The register data specified by the local station is written to the specified register on the remote station. (1) Request command structure and error status <Request command> Destination EN311 module slot number CMD+1 Command (16#0321)
  • Page 94 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission (2) Request command contents • DRID(Remote station register type code) ... The remote station specifies the type of register to which transmission data is written. The specifiable codes are listed in the following table. If the remote station is an S controller, only the "D register: Type code 0004H"...
  • Page 95 5.3 PC Link Protocol Transmission (Data write) (3) Considerations • The write operation is not synchronized with the remote station controller scan operation. If synchronization is necessary, applications must perform synchroni- zation, such as transferring the data to separate registers at the start of the con- troller scan.
  • Page 96: Pc Link Protocol Transmission (Data Read)

    Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission 5.4 PC Link Protocol Transmission (Data read) The T series PC link protocol allows an S controller to read register data from another S controller/T3H/T2N on the network into its own registers. As is the case with the computer link protocol, the PC link protocol uses UDP/IP as its transmission protocol.
  • Page 97 5.4 PC Link Protocol Transmission (Data read) <Error status> =0: Normal completion, ≠ 0: Error status STATUS Error status examples Error status number Description -5001(16#EC77) Command type error -5002(16#EC76) Timeout (detected by the S controller) 2848(16#B20) Timeout (detected by the EN311) Supplemental Remarks When the PC link is used and the EN311 detects an error, it means that the error occurred in the local station if the highest bit of the error status shows 0 or it means that error occurred in the...
  • Page 98 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission • DRegNo(Remote station register number) The remote station specifies the start register to which the transmission data is written. • TimeCnt(Timeout value) It is specified in 0.1-second unit to monitor the response time form the remote station. CMD+4 0: User specified value is used (0.1 - 3276.7 seconds) 1: Default value (30 seconds)
  • Page 99: Sample Pc Link Protocol Transmission Program

    5.5 Sample PC Link Protocol Transmission Program 5.5 Sample PC Link Protocol Transmission Program Sample program specification: Two EN311 modules, one in Slot 6 and another in Slot 7 on the base, are installed. Slot 6 Local IP address: 133.113.93.10 Local message transfer UDP port number: 4002 Slot 7 Local IP address: 133.113.93.154...
  • Page 100 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission (1) Defining the variables (*======================================== EN311 PC-LINK TEST PROGRAM ========================================*) RST_START: BOOL; RST_CMP: BOOL; RST_ERR: BOOL; RST_STS: INT; (* Slot 6 Reset request error status *) RST_CMP2: BOOL; RST_ERR2: BOOL;...
  • Page 101 5.5 Sample PC Link Protocol Transmission Program (2) Program (*RESET REQUEST*) %MW3.300 MOVE_UINT %MW3.301 16#0311 MOVE_WORD %MW3.302 MOVE_UINT %MW3.303 16#0311 MOVE_WORD (*SLOT6 RESET*) USEND_T_1 RST_START RST_CMP RST_CMP USEND_T DONE %MW3.300 RST_ERR ERROR RST_STS %MW3.300 STATUS TX_CONT (*SLOT7 RESET*) USEND_T_2 RST_CMP2 RST_CMP RST_CMP2 USEND_T...
  • Page 102 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission (*PARAMETER SETTING REQUEST SLOT6*) %MW3.310 MOVE_UINT %MW3.311 16#0312 MOVE_WORD %MD3.312 16#8571_5D0A MOVE_DWORD %MW3.314 4002 MOVE_UINT USEND_T_3 RST_CMP2 CL_CMP CL_CMP USEND_T DONE %MW3.310 CL_ERR ERROR CL_STS %MW3.310 STATUS TX_CONT (*MODE CONTROL REQUEST "RUN" SLOT6*) %MW3.320 MOVE_UINT %MW3.321...
  • Page 103 5.5 Sample PC Link Protocol Transmission Program (*PARAMETER SETTING REQUEST SLOT7*) %MW3.330 MOVE_UINT %MW3.331 16#0312 MOVE_WORD %MD3.332 16#8571_5D9A MOVE_DWORD %MW3.334 4012 MOVE_UINT USEND_T_5 CL_CMP2 CL_CMP3 CL_CMP3 USEND_T DONE %MW3.330 CL_ERR3 ERROR CL_STS3 %MW3.330 STATUS TX_CONT (*MODE CONTROL REQUEST "RUN" SLOT7*) %MW3.340 MOVE-UINT %MW3.341...
  • Page 104 Chapter 5 Computer Link Protocol and the PC Link Protocol Transmission (*REGISTER WRITE REQUEST SLOT6 Æ SLO7*) %MW3.350 %MW3.500 16#0201 MOVE_UNIT MOVE_WORD %MW3.351 %MW3.501 16#0321 16#0403 MOVE_WORD MOVE_WORD %MW3.352 %MW3.502 16#0605 MOVE_UNIT MOVE_WORD %MW3.353 %MW3.503 1000 16#0807 MOVE_UINT MOVE_WORD %MW3.354 %MW3.596 16#F9F8 MOVE_UINT...
  • Page 105 5.5 Sample PC Link Protocol Transmission Program (*REGISTER READ REQUEST SLOT6 ¨ SLOT7*) %MW3.360 MOVE_UINT %MW3.361 16#0321 MOVE_WORD %MW3.362 MOVE_UINT %MW3.363 1000 MOVE_UINT %MW3.364 MOVE_UINT %MD3.365 16#8571_5D9A MOVE_DWORD %MW3.367 4012 MOVE_UINT %MW3.368 MOVE_UINT TX_COMPLETE1 RX_REQ1 URCV_T_1 RX_REQ1 RX-COMPLETE1 URCV_T DONE %MW3.360 RX_ERROR1 ERROR...
  • Page 107: Socket Interface Communication

    Chapter 6 Socket Interface Communication This chapter describes the functions and positioning of the socket interface, and the differences between the UDP socket interface and the TCP socket interface. Next t, this chapter presents notes on using the EN311 socket interface and describes the procedures for using this functionality.
  • Page 108: Overview

    Chapter 6 Socket Interface Communication 6.1 Overview This section describes the functions and positioning of the socket interface, and the differences between the UDP socket interface and the TCP socket interface. (1) Positioning and functionality The socket interface is a programming interface that allows user programs to use the TCP/IP and UDP/IP functions.
  • Page 109 6.1 Overview Source node Destination node UDP socket UDP socket Data transmission Reception verification (only if implemented by the user program) Figure 6-2 UDP Sockets (b) TCP socket interface (See Figure 6-3 and Figure 6-4.) • In TCP communication, a pipe-like virtual communications line (connection) is established between sockets on two nodes that are communicating (send- ing and receiving), and since the protocol handles control of reception verifi- cation and retransmission processing, it provides a highly reliable...
  • Page 110 Chapter 6 Socket Interface Communication Client side Server side (Active open) (Passive open) Closed state Closed state Passive open Connection establishment request Active open ACK (acknowledge) response Connection established Connection established Data transmission Data transmission ACK (acknowledge) response Data reception Data transmission Data reception ACK (acknowledge) response...
  • Page 111: En311 Socket Interface Usage Notes

    6.2 EN311 Socket Interface Usage Notes 6.2 EN311 Socket Interface Usage Notes This section presents the points that require attention when using the socket interface on the EN311. 6.2.1 Transmission/Reception Data Handling in UDP Socket Interface (1) In UDP socket interface transmission, data sent in a single transmission is handled by the receiving EN311 as a single data unit, and that data is transmitted to the S controller in a batch operation by a receive request.
  • Page 112: Data Handling And Data Segmentation In Tcp Socket Interface Transmission And Reception

    Chapter 6 Socket Interface Communication (7) If the size of the data transmitted in a single operation is larger than the size specified for the received data in the receive request program, the receive request will end with an error. The received data is stored in the reception data storage area of the S controller, but from the beginning of the received data up to the reception data size only.
  • Page 113 6.2 EN311 Socket Interface Usage Notes EN311 TCP socket S controller Consecutive data (up to 5840 bytes) Receive request Data received so far Max. 2000 bytes Data received by the S controller Transmitted data Receive response Transferred data Figure 6-6 Handling of Transmitted/Received Data in the TCP Socket (8) When the TCP socket interface is used, transmitted data is divided (fragmented) into units of a size determined when the connection between the two sockets was established.
  • Page 114 Chapter 6 Socket Interface Communication Sending EN311 Transmission line EN311 Receiving S controller S controller (1) Send request (4) First receive request 2000 bytes 1460 bytes 1460 bytes 2000 bytes 1460 bytes 540 bytes 540 bytes (5) Second receive request 2000 bytes 540 bytes Figure 6-7 Transmission Data Fragmentation in the TPC socket...
  • Page 115 6.2 EN311 Socket Interface Usage Notes Preamble (7 bytes) Signal used to synchronize reception SFD (Start Frame Delimiter) (1 byte) Remote station address (6 bytes) Local station address (6 bytes) Ethernet type (2 bytes) 0800H:IP 、 0 806H:ARP IP header (20 bytes) UDP header (8 bytes) Packets...
  • Page 116: Socket Port Numbers

    Chapter 6 Socket Interface Communication 6.2.3 Socket port numbers (1) Set the port numbers for local TCP and UDP sockets to values in the range 1024 to 65535. The EN311 will issue an error if any other values are used. This is because the port numbers from 1 to 1023 are allocated for UNIX workstation standard services.
  • Page 117: Udp Socket Interface Notes

    6.2 EN311 Socket Interface Usage Notes If the timeout time expires, the "transmission complete timeout (no instruction response)" error occurs. Since this error has the same code as module failure errors, first check whether or not the module has failed before attempting to recover from the error.
  • Page 118 Chapter 6 Socket Interface Communication (5) When ending the connection from the EN311, the open request should be issued after waiting at least 20 seconds to open again with the same port number even the TCP close request had been completed normally. If the open request is issued within 20 seconds using the same port number, an error will occur.
  • Page 119 6.2 EN311 Socket Interface Usage Notes (12)With a connection established, if the no response state from the remote node continues when data is sent and the EN311 internal resend processing times out (the timeout time is about 1 minute), the NOACK bit in the socket status (see section 6.3, "Socket Interface Information") will be set to 1.
  • Page 120: Socket Interface Information

    Chapter 6 Socket Interface Communication 6.3 Socket Interface Information The information for the eight socket interface sockets held by the EN311 can be read out with the MREAD instruction. The EN311 holds five words of socket status information for each socket. User programs should access this information as necessary when using socket transmission.
  • Page 121 6.3 Socket Interface Information Important note This area is a read-only area. Do not attempt to write data to it using the MWRITE instruction. If you do, data may no longer be read correctly. TCP connection established Table 6-2 Condition of Socket status bits Condition under which the bit is set Condition under which the bit is Bit no.
  • Page 122: Using The En311 Socket Interface

    Chapter 6 Socket Interface Communication 6.4 Using the EN311 Socket Interface This section describes the requests used by user programs to use UDP and TCP sockets. There are eight types of request as listed below. • UDP socket (open request, send request, receive request, close request) •...
  • Page 123: Udp Open Request

    6.4 Using the EN311 Socket Interface 6.4.1 UDP open request (using the USEND_T instruction) (1) Function This request opens any of the eight sockets. Transmission protocol:UDP/IP (2) Request command structure and error status <Request command> Destination EN311 module slot number CMD+1 Command (16#0331) CMD+2...
  • Page 124: Instruction)

    Chapter 6 Socket Interface Communication 6.4.2 UDP send request/broadcast send request (using the USEND_T instruction) (1) Function This request sends local node register data using an open UDP socket. (2) Request command structure and error status <Request command> Request destination EN311 module slot number CMD+1 Command (16#0332)
  • Page 125 6.4 Using the EN311 Socket Interface • Values in the range 1024 to 65535 can be specified as the object socket UDP port number for the transmission destination. An error will be returned if a value outside that range is specified. Error status: Port number error •••...
  • Page 126: Udp Receive Request

    Chapter 6 Socket Interface Communication 6.4.3 UDP receive request (using the URECV_T instruction) (1) Function If an opened UDP socket receives data, read the received data into registers on the local node. If no data has been received, wait until data arrives (the wait time can be set) and then read the received data into the local node registers.
  • Page 127 6.4 Using the EN311 Socket Interface (4) Methods for storing receive data • The value specified as "number of received data words N" is the size of the transmitted data in a single operation to the socket (number of words) + 1 word. The S controller checks for register area with the value of N and returns error status: Boundary error •••...
  • Page 128 Chapter 6 Socket Interface Communication Since the send/receive processing for each socket requires about 50 ms, applications that issue send or receive requests to a given socket should leave an interval of at least 50 ms times the number of sockets used between each request. Interval between send (receive)requests to the same socket >= Number of sockets used ¥...
  • Page 129: Udp Close Request

    6.4 Using the EN311 Socket Interface 6.4.4 UDP close request (using the USEND_T instruction) (1) Function Close the open UDP socket. Release the (unlimited wait state) receive request and terminate the UDP socket. (2) Request command structure and error status <Request command>...
  • Page 130: Tcp Open Request

    Chapter 6 Socket Interface Communication 6.4.5 TCP open request (using the USEND_T instruction) (1) Function This request opens (active/passive) any of the eight sockets. Transmission protocol:TCP/IP (2) Request command structure and error status <Request command> Request destination EN311 module slot number CMD+1 Command (16#0334) CMD+2...
  • Page 131 6.4 Using the EN311 Socket Interface • Not only must the specified socket TCP port number on the local station not overlap with any TCP port number already in use in a local station socket, but it also must not overlap with any UDP port numbers or UDP port numbers used for message transmission.
  • Page 132: Tcp Send Request

    Chapter 6 Socket Interface Communication 6.4.6 TCP send request (using the USEND_T instruction) (1) Function This request sends local node register data using an open TCP socket. (2) Request command structure and error status <Request command> Destination EN311 module slot number CMD+1 Command (16#0337) CMD+2...
  • Page 133 6.4 Using the EN311 Socket Interface • With a connection established, if a no response state from the remote node continues when data is sent and the EN311 internal resend processing times out (the timeout time is about 1 minute), the NOACK bit in the socket status will be set to 1. User programs should close such sockets.
  • Page 134: Tcp Receive Request

    Chapter 6 Socket Interface Communication 6.4.7 TCP receive request (using the URCV_T instruction) (1) Function If an opened TCP socket receives data, read the received data into registers on the local S controller. If no data has been received, wait until data arrives (the wait time can be set) and then, after reception, read the received data into the local S controller registers.
  • Page 135 6.4 Using the EN311 Socket Interface • Allocate a reception data storage register area with a size equal to "the size of the data that you want to transfer from the socket" + 1 word. The received data size (bytes) and the data received by the target socket when the receive request is issued are transferred to this area as shown below.
  • Page 136 Chapter 6 Socket Interface Communication • The remote node may have gone down. • Power may have been lost. • The remote and local nodes may have become disconnected from the network. • ACK transmission timing in the EN311 TCP socket When reception data in the EN311 is read out by a receive request from the S controller, the EN311 sends an ACK (acknowledge response) to the node that sent the data.
  • Page 137: Tcp Close Request

    6.4 Using the EN311 Socket Interface 6.4.8 TCP close request (using the USEND_T instruction) (1) Function Close the open TCP socket. Release the (unlimited wait state) receive request and terminate the TCP socket. (2) Request command structure and error status <Request command>...
  • Page 138 Chapter 6 Socket Interface Communication • Every bit of the socket becomes "0" when the TCP close request is completed. • The internal completion wait time limit of the S controller for this request is 15 seconds. If the EN311 was not able to reply the completion within this time limit, the following error is returned.
  • Page 139: Sample Programs

    6.5 Sample Programs 6.5 Sample Programs This section presents sample programs using UDP and TCP sockets. 6.5.1 UDP socket sample programs Two EN311 modules are mounted, one to Slot 6 and another to Slot 7 on the base. The program for each module is to be registered as separate program. •...
  • Page 140 Chapter 6 Socket Interface Communication Start 7EFFH on DPRAM Read the station status (word address) Is the result of ANDing 1000H Run mode ? is 1000H ? Issue the operating mode control request (Standby) Issue the reset request Issue the parameter setting request Issue the operating mode control request (Run) Read the station status...
  • Page 141 6.5 Sample Programs (2) UDP transmission Start (Sending side) Read the socket status Are bits C and D Stop "0" ? Issue the UDP open request Stop Normal completion ? Issue the UDP send request Normal completion ? Stop Issue the UDP close request Normal completion ? Stop End (Sending side)
  • Page 142 Chapter 6 Socket Interface Communication (a) Defining the variables (*======================================== EN311 UDP SOCKET TEST PROGRAM (SEND) ========================================*) SLOTW: WORD; (* Slot specification *) OPEN_READ: BOOL; MREAD_CMP: BOOL; MREAD_CMPX: BOOL; STN_STS: WORD; (* Station status *) SOCKSTS: WORD; (* Socket status *) STBY_REQ: BOOL;...
  • Page 143 6.5 Sample Programs USEND_T_1: USEND_T; USEND_T_2: USEND_T; USEND_T_3: USEND_T; USEND_T_4: USEND_T; USEND_T_5: USEND_T; USEND_T_6: USEND_T; USEND_T_7: USEND_T; END_VAR (b) Program (*STATION STATUS CHECK*) SLOTW MOVE_WORD OPEN_READ MREAD_CMP MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP STBY_REQ PARA_REQ MREAD_CMPX MREAD_CMPX STN_STS STN_STS AND_WORD 16#1000 STN_STS STBY_REQ...
  • Page 144 Chapter 6 Socket Interface Communication (*OPERATION MODE CONTROL REQUEST "STANDBY"*) %MW3.310 MOVE_WORD %MW3.311 16#0313 MOVE_WORD %MW3.312 16#2000 MOVE_WORD USEND_T_1 STBY_REQ CMP_MODE USEND_T DONE %MW3.310 ERR_MODE ERROR STS_MODE %MW3.290 STATUS %MW3.290 (*RESET REQUEST*) %MW3.300 MOVE_WORD %MW3.301 16#0311 MOVE_WORD USEND_T_2 CMP_MODE CMP_RESET USEND_T DONE %MW3.300...
  • Page 145 6.5 Sample Programs (*PARAMETER SETTING REQUEST*) %MW3.320 MOVE_WORD %MW3.321 16#0312 MOVE_WORD %MD3.322 16#85715A0A MOVE_DWORD %WM3.324 2000 MOVE_WORD USEND_T_3 CMP_RESET CMP_PARA USEND_T DONE PARA_REQ %MW3.320 ERR_PARA ERROR STS_PARA %MW3.290 STATUS %MW3.290 (*OPERATION MODE CONTROL REQUEST "RUN"*) %MW3.310 %MW3.310 MOVE_WORD MOVE_WORD %MW3.311 %MW3.311 16#0313 16#0313...
  • Page 146 Chapter 6 Socket Interface Communication (*STATION STATUS CHECK*) SLOTW MOVE_WORD CMP_MODE2 MREAD_CMP2 MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP2 STN_STS STN_STS AND_WORD 16#1000 STN_STS NOT_RUN NE_WORD 16#1000 STN_STS RUN1 EQ_WORD 16#1000 Ethernet module User’s Manual...
  • Page 147 6.5 Sample Programs (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD RUN1 MREAD_CMP3 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP3 SOCKSTS SOCKSTS AND_WORD 16#3000 SOCKSTS OK_STS EQ_WORD (*UDP OPEN REQUEST*) %MW3.330 MOVE_UINT %MW3.331 16#0331 MOVE_WORD %MW3.332 MOVE_WORD %MW3.333 3000 MOVE_UINT USEND_T_5 OK_STS OPNE_CMP USEND_T DONE...
  • Page 148 Chapter 6 Socket Interface Communication (*UDP SEND REQUEST*) %MW3.340 %MW3.1000 %MW3.1094 16#2211 16#AAAA MOVE_UNIT MOVE_WORD MOVE_WORD %MW3.341 %MW3.1001 %MW3.1095 16#0332 16#4433 16#BBBB MOVE_WORD MOVE_WORD MOVE_WORD %MW3.342 %MW3.1002 %MW3.1096 16#6655 16#CCCC MOVE_WORD MOVE_WORD MOVE_WORD %MW3.1003 %MW3.1097 %MD3.343 16#8877 16#DDDD 16#8571_5A14 MOVE_WORD MOVE_WORD MOVE_DWORD %MW3.345...
  • Page 149 6.5 Sample Programs (3) UDP reception Start (Receiving side) Read the socket status Are bits C and D Stop "0" ? Issue the UDP open request Stop Normal completion ? Read the socket status Is bit A "1" ? Issue the UDP receive request Normal completion ? Stop Issue the UDP close request...
  • Page 150 Chapter 6 Socket Interface Communication (a) Defining the variables (*============================================= EN311 UDP SOCKET TEST PROGRAM (RECEIVE) =============================================*) SLOTW: WORD; (* Slot specification *) OPEN_READ: BOOL; MREAD_CMP: BOOL; MREAD_CMPX: BOOL; STN_STS: WORD; (* Station status *) SOCKSTS: WORD; (* Socket status *) STBY_REQ: BOOL;...
  • Page 151 6.5 Sample Programs USEND_T_1: USEND_T; USEND_T_2: USEND_T; USEND_T_3: USEND_T; USEND_T_4: USEND_T; USEND_T_5: USEND_T; URCV_T_1: URCV_T; USEND_T_6: USEND_T; END_VAR (b) Program (*STATION STATUS CHECK*) SLOTW MOVE_WORD OPEN_READ MREAD_CMP MREAD SLOTW 16#7EFF TADDR STN_STS 6F8C0904...
  • Page 152 Chapter 6 Socket Interface Communication MREAD_CMP STBY-REQ PARA_REQ MREAD_CMPX MREAD_CMPX STN_STS STN_STS AND_WORD 16#1000 STN_STS STBY_REQ EQ_WORD 16#1000 STN_STS PARA_REQ NE_WORD 16#1000 (*MODE CONTROL REQUEST "STANDBY"*) %MW3.410 MOVE_WORD %MW3.411 16#0313 MOVE_WORD %MD3.412 16#2000 MOVE_WORD USENT_T_1 STBY_REQ CMP_MODE USEND_T DONE %MW3.410 ERR_MODE ERROR STS_MODE...
  • Page 153 6.5 Sample Programs (*RESET REQUEST*) %MW3.400 MOVE_WORD %MW3.401 16#0311 MOVE_WORD USEND_T_2 CMP_MODE CMP_RESET USEND_T DONE %MW3.400 ERR_RESET ERROR STS_RESET %MW3.290 STATUS %MW3.290 (*PARAMETER SETTING REQUEST*) %MW3.420 MOVE_WORD %MW3.421 16#0312 MOVE_WORD %MD3.422 16#8571_5A14 MOVE_DWORD %MW3.424 2001 MOVE_UINT USEND_T_3 CMP_RESET CMP_PAPA USEND_T DONE PAPA_REQ %MW3.420...
  • Page 154 Chapter 6 Socket Interface Communication (*MODE CONTROL REQUEST "RUN"*) %MW3.410 MOVE_WORD %MW3.411 16#0313 MOVE_WORD %MW3.412 16#1010 MOVE_WORD USEND_T_4 CMP_PAPA NOT_RUN CMP_MODE2 USEND_T DONE %MW3.410 ERR_MODE2 ERROR STS_MODE2 %MW3.290 STATUS %MW3.290 (*STATION STATUS CHECK*) SLOTW MOVE_WORD CMP_MODE2 MREAD_CMP2 MREAD ( S ) SLOTW 16#7EFF TADDR...
  • Page 155 6.5 Sample Programs (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD RUN1 MREAD_CMP3 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP3 SOCKSTS SOCKSTS AND_WORD 16#3000 SOCKSTS OK_STS EQ_WORD (*UDP OPEN REQUEST*) %MW3.430 MOVE_UNIT %MW3.431 16#0331 MOVE_WORD %MW3.432 MOVE_WORD %MW3.433 3001 MOVE_UNIT USEND_T_5 OK_STS OPEN_CMP USEND_T DONE...
  • Page 156 Chapter 6 Socket Interface Communication (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD OPEN_CMP MREAD_CMP4 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP4 SOCKSTS SOCKSTS AND_WORD 16#0400 SOCKSTS OK_OPEN EQ_WORD 16#0400 SOCKSTS NOT_OPEN NE_WORD 16#0400 (*UDP RECEIVE REQUEST*) %MW3.450 MOVE_UINT %MW3.451 16#0333 MOVE_WORD %MW3.452 MOVE_WORD %MW3.453...
  • Page 157 6.5 Sample Programs OK_OPEN RX_REQ URCV_T_1 RX_REQ RX_CMP URCV_T DONE %MW3.450 RX_ERR ERROR RX_STS %MW3.3000 STATUS %MW3.2999 (*UDP CLOSE REQUEST*) %MW3.460 MOVE_UINT %MW3.461 16#0334 MOVE_WORD %MW3.462 MOVE_UINT USEND_T_6 RX_CMP CLOSE_CMP USEND_T DONE %MW3.460 CLOSE_ERR ERROR CLOSE_STS %MW3.290 STATUS %MW3.290 6F8C0904...
  • Page 158: Tcp Socket Sample Programs

    Chapter 6 Socket Interface Communication 6.5.2 TCP socket sample programs Two EN311 modules are mounted, one to Slot 6 and another to Slot 7 on the base. The program for each module is to be registered as separate program. • Transmission is performed via Slot 6, Socket 1 (Port number = 4000) ••• Active open (timeout is 30 seconds) Æ...
  • Page 159 6.5 Sample Programs Start 7EFFH on DPRAM Read the station status (word address) Run mode ? Is the result of ANDing 1000H is 1000H ? Issue the operating mode control request (Standby) Issue the reset request Issue the parameter setting request Issue the operating mode control request (Run) Read the station status...
  • Page 160 Chapter 6 Socket Interface Communication (2) TCP transmission Start (Sending side) Read the socket status Are bits C and D Stop "0" ? Issue the TCP open request: Active N Timeout ? Normal completion ? Issue the TCP send request Stop Normal completion ? Stop...
  • Page 161 6.5 Sample Programs (a) Defining the variables (*================================================= EN311 TCP SOCKET TEST PROGRAM (SEND) =================================================*) SLOTW: WORD; (* Slot specification *) OPEN_READ: BOOL; MREAD_CMP: BOOL; MREAD_CMPX: BOOL; STN_STS: WORD; (* Station status *) SOCKSTS: WORD; (* Socket status *) STBY_REQ: BOOL;...
  • Page 162 Chapter 6 Socket Interface Communication USEND_T_1: USEND_T; USEND_T_2: USEND_T; USEND_T_3: USEND_T; USEND_T_4: USEND_T; USEND_T_5: USEND_T; USEND_T_6: USEND_T; USEND_T_7: USEND_T; END_VAR (b) Program (*STATION STATUS CHECK*) SLOTW MOVE_WORD OPEN_READ MREAD_CMP MREAD SLOTW 16#7EFF TADDR STN_STS Ethernet module User’s Manual...
  • Page 163 6.5 Sample Programs MREAD_CMP STBY_REQ PARA_REQ MREAD_CMPX MREAD_CMPX STN_STS STN_STS AND_WORD 16#1000 STN_STS STBY_REQ EQ_WORD 16#1000 STN_STS PARA_REQ NE_WORD 16#1000 (*MODE CONTROL REQUEST "STANDBY"*) %MW3.310 MOVE_WORD %MW3.311 16#0313 MOVE_WORD %MW3.312 16#2000 MOVE_WORD USEND_T_1 STBY_REQ CMP_MODE USEND_T DONE %MW3.310 ERR_MODE ERROR M ODE _...
  • Page 164 Chapter 6 Socket Interface Communication (*RESET REQUEST*) %MW3.300 MOVE_WORD %MW3.301 16#0311 MOVE_WORD CMP_MODE ERR_MODE USEND_T_2 CMP_RESET USEND_T DONE %MW3.300 ERR_RESET ERROR %MW3.290 STS_RESET STATUS %MW3.290 (*PARAMETER SETTING REQUEST*) %MW3.320 MOVE_WORD %MW3.321 16#0312 MOVE_WORD %MW3.322 16#85715ADA MOVE_DWORD %MW3.324 2000 MOVE_WORD USEND_T_3 CMP_RESET CMP_PARA USEND_T...
  • Page 165 6.5 Sample Programs (*MODE CONTROL REQUEST "RUN"*) %MW3.310 MOVE_WORD %MW3.311 16#0313 MOVE_WORD %MW3.312 16#1010 MOVE_WORD CMP_PARA NOT_RUN USEND_T_4 CMP_MODE2 USEND_T DONE %MW3.310 ERR_MODE2 ERROR %MW3.290 STS_MODE2 STATUS %MW3.290 (*STATION STATUS CHECK*) SLOTW MOVE_WORD CMP_MODE2 MREAD_CMP2 MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP2 STN_STS STN_STS...
  • Page 166 Chapter 6 Socket Interface Communication (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD RUN1 MREAD_CMP3 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP3 SOCKSTS SOCKSTS AND_WORD 16#3000 SOCKSTS OK_STS EQ_WORD Ethernet module User’s Manual...
  • Page 167 6.5 Sample Programs (*TCP OPEN REQUSET "ACTIVE"*) %MW3.630 MOVE_UINT %MW3.631 16#0335 MOVE_WORD %MW3.632 MOVE_WORD %MW3.633 MOVE_WORD %MW3.634 16#8571_5A14 MOVE_DWORD %MW3.636 4001 MOVE_UINT %MW3.637 4000 MOVE_UINT %MW3.638 MOVE_UINT OK_STS OPEN_REQ OPEN_REQ2 USEND_T_5 OPEN_REQ2 OPNE_CMP USEND_T DONE OPEN_ERR %MW3.630 ERROR OPEN_STS %MW3.290 STATUS %MW3.290 OPEN_ERR...
  • Page 168 Chapter 6 Socket Interface Communication (*TCP SEND REQUEST*) %MW3.640 %MW3.1000 %MW3.1095 16#1111 16#BBBB MOVE_UINT MOVE_WORD MOVE_WORD %MW3.641 %MW3.1001 %MW3.1096 16#0337 16#2222 16#CCCC MOVE_WORD MOVE_WORD MOVE_WORD %MW3.642 %MW3.1002 %MW3.1097 16#3333 16#DDDD MOVE_WORD MOVE_WORD MOVE_WORD %MW3.1003 %MW3.1098 %MD3.999 16#4444 16#EEEE MOVE_WORD MOVE_WORD MOVE_WORD %MW3.1004 %MW3.1099...
  • Page 169 6.5 Sample Programs (3) TCP reception Start (Receiving side) Read the socket status Are bits C and D Stop "0" ? Y Issue the TCP open request: Passive Timeout ? Normal completion ? Stop Read the socket status Is bit A "1" ? Issue the TCP receive request Normal completion ? Stop...
  • Page 170 Chapter 6 Socket Interface Communication (a) Defining the variables (*============================================= EN311 TCP SOCKET TEST PROGRAM (RECEIVE) =============================================*) SLOTW: WORD; (* Slot specification *) OPEN_READ: BOOL; MREAD_CMP: BOOL; MREAD_CMPX: BOOL; STN_STS: WORD; (* Station status *) SOCKSTS: WORD; (* Socket status *) STBY_REQ: BOOL;...
  • Page 171 6.5 Sample Programs CLOSE_ERR: BOOL; CLOSE_STS: INT; (* TCP close request error status *) USEND_T_1: USEND_T; USEND_T_2: USEND_T; USEND_T_3: USEND_T; USEND_T_4: USEND_T; USEND_T_5: USEND_T; USEND_T_6: USEND_T; URCV_T_1: URCV_T; END_VAR 6F8C0904...
  • Page 172 Chapter 6 Socket Interface Communication (b) Program (*STATION STATUS CHECK*) SLOTW MOVE_WORD OPEN_READ MREAD_CMP MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP STBY_REQ PARA_REQ MREAD_CMPX MREAD_CMPX STN_STS STN_STS AND_WORD 16#1000 STN_STS STBY_REQ EQ_WORD 16#1000 STN_STS PARA_REQ NE_WORD 16#1000 Ethernet module User’s Manual...
  • Page 173 6.5 Sample Programs (*MODE CONTROL REQUEST "STANDBY"*) %MW3.410 MOVE_WORD %MW3.411 16#0313 MOVE_WORD %MW3.412 16#2000 MOVE_WORD USEND_T_1 STBY_REQ CMP_MODE USEND_T DONE %MW3.410 ERR_MODE ERROR STS_MODE %MW3.290 STATUS %MW3.290 (*RESET REQUEST*) %MW3.400 MOVE_WORD %MW3.401 16#0311 MOVE_WORD USEND_T_2 CMP_MODE CMP_RESET USEND_T DONE %MW3.400 ERR_RESET ERROR STS_RESET...
  • Page 174 Chapter 6 Socket Interface Communication (*PARAMETER SETTING REQUEST*) %MW3.420 MOVE_WORD %MW3.421 16#0312 MOVE_WORD %MD3.422 16#8571_5A14 MOVE_DWORD %WM3.424 2001 MOVE_WORD USEND_T_3 CMP_RESET CMP_PARA USEND_T DONE PARA_REQ %MW3.420 ERR_PARA ERROR STS_PARA %MW3.290 STATUS %MW3.290 (*MODE CONTROL REQUEST "RUN"*) %MW3.410 MOVE_WORD %MW3.411 16#0313 MOVE_WORD %MW3.412 16#1010...
  • Page 175 6.5 Sample Programs (*STATION STATUS CHECK*) SLOTW MOVE_WORD CMP_MODE2 MREAD_CMP2 MREAD SLOTW 16#7EFF TADDR STN_STS MREAD_CMP2 STN_STS STN_STS AND_WORD 16#1000 STN_STS NOT_RUN NE_WORD 16#1000 STN_STS RUN1 EQ_WORD 16#1000 6F8C0904...
  • Page 176 Chapter 6 Socket Interface Communication (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD RUN1 MREAD_CMP3 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP3 SOCKSTS SOCKSTS AND_WORD 16#3000 SOCKSTS OK_STS EQ_WORD Ethernet module User’s Manual...
  • Page 177 6.5 Sample Programs (*TCP OPEN REQUEST "PASSIVE"*) %MW3.730 MOVE_UINT %MW3.731 16#0335 MOVE_WORD %MW3.732 MOVE_WORD %MW3.733 MOVE_WORD %MW3.734 16#8571_5A0A MOVE_DWORD %MW3.736 4000 MOVE_UINT %MW3.737 4001 MOVE_UINT %MW3.738 MOVE_UINT OK_STS OPEN_REQ OPEN_REQ2 USEND_T_5 OPEN_REQ2 OPEN_CMP USEND_T DONE %MW3.730 OPEN_ERR ERROR OPEN_STS %MW3.290 STATUS %MW3.290 OPEN_ERR...
  • Page 178 Chapter 6 Socket Interface Communication (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD OPEN_CMP MREAD_CMP4 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP4 SOCKSTS SOCKSTS AND_WORD 16#0400 SOCKSTS ERR_STS NE_WORD 16#0400 SOCKSTS OK_STS2 EQ_WORD 16#0400 (*TCP RECEIVE REQUEST*) %MW3.740 MOVE_UINT %MW3.741 16#0330 MOVE_WORD %MW3.742 MOVE_WORD %MW3.2999...
  • Page 179 6.5 Sample Programs (*SOCKET STATUS CHECK "SOCKET 1"*) SLOTW MOVE_WORD RX_CMP ERR_STS2 MREAD_CMP5 MREAD SLOTW 16#7E47 TADDR SOCKSTS MREAD_CMP5 SOCKSTS SOCKSTS AND_WORD 16#0A00 SOCKSTS ERR_STS2 NE_WORD 16#0200 SOCKSTS OK_STS3 EQ_WORD 16#0200 (*TCP CLOSE REQUEST*) %MW3.760 MOVE_UINT %MW3.761 16#0339 MOVE_WORD %MW3.762 MOVE_UINT USEND_T_6 OK_STS3...
  • Page 181: Ras Information

    Chapter 7 RAS Information This chapter describes the following RAS functions provided by the EN311: (1) EN311 status information • Station status (S controller interface memory) • Down information (S controller interface memory) (2) Test functions from user programs • Remote station verification request (corresponds to the UNIX ping command) (3) Time setting function (4) Information provided by RAS information readout •...
  • Page 182: Station Status Information

    Chapter 7 RAS Information 7.1 Station Status Information The EN311 status information is displayed on the S controller interface memory and should be read out to the S controller side using the MREAD instruction. Each bit of the station status has the following meaning. Note that a register value is should be used when determining the Initialization mode, Run mode or Standby mode.
  • Page 183 7.1 Station Status Information Important note This area is a read-only area. Do not attempt to write data to it using the MWRITE instruction. If you do, data may no longer be read correctly. 6F8C0904...
  • Page 184: Down Information

    Chapter 7 RAS Information 7.2 Down Information When an EN311 goes down, the factor that caused that transition is stored in the S controller interface memory as one word of data. This data can be read by the S controller with the MREAD instruction. Table 7-1 lists the down information error codes and the factors that caused the transition to down mode.
  • Page 185: Remote Station Verification Request

    7.3 Remote Station Verification Request 7.3 Remote Station Verification Request This request verifies the existence of the specified remote station, and corresponds to the UNIX ping command. This request can be issued when the EN311 operating mode is either run or standby mode. The EN311 will respond to this request if its operating mode is either run or standby mode.
  • Page 186 Chapter 7 RAS Information (3) Sample program (a) Defining the variables PING_REQ1: BOOL; PING_CMP1: BOOL; PING_ERR1: BOOL; PING_STS1: INT; (* Remote station verification request error status *) USEND_T_11: USEND_T; END_VAR (b) Program %MW3.380 MOVE_UINT %MW3.381 16#0314 MOVE_WORD %MW3.382 16#85715D9A MOVE_DWORD USEND_T_11 PING_REQ1 PING_CMP1...
  • Page 187: Time Setting

    7.4 Time Setting 7.4 Time Setting The EN311 internal time is set from the S controller. This information is used as the time information in the EN311 event trace. Time set request (using the USEND_T instruction) This request sets the EN311 internal time from a user program. This information is used as the time information in the EN311 event trace(read out using the RAS information readout request).
  • Page 188 Chapter 7 RAS Information (3) Important notes • This request can be executed in run or standby mode. • The time set here is updated by the EN311 internal timer, and thus may get out of synchronization with the S controller time. We recommend setting the EN311 time once a day.
  • Page 189 7.4 Time Setting (b) Program %MW3.560 MOVE_UNIT %MW3.561 16#0318 MOVE_WORD %MW2.17 STACK STACK STACK SHL_WORD OR_WORD %MW2.16 %MW3.562 STACK MOVE_WORD %MW2.19 STACK STACK STACK SHL_WORD OR_WORD %MW2.18 %MW3.563 STACK MOVE_WORD %MW2.21 STACK STACK STACK SHL_WORD OR_WORD %MW2.20 %MW3.564 STACK MOVE_WORD USEND_T12 TIME_REQ1 TIME_CMP1...
  • Page 190: Ras Information Readout

    Chapter 7 RAS Information 7.5 RAS Information Readout This request reads out the EN311 RAS information (internal error information and event history) from a user program. RAS information readout request (using the URCV_T instruction) (1) Request command structure and error status <Request command>...
  • Page 191 7.5 RAS Information Readout (3) Important notes • This request can be used in run and standby modes. • The read out RAS information is stored in the specified register area as shown below. ← Specified register start address RAS information word count RAS information ←...
  • Page 192 Chapter 7 RAS Information (b) Program %MW3.350 MOVE_UINT %MW3.351 16#0315 MOVE_WORD %MW3.352 MOVE_WORD %MW3.353 MOVE_UINT %MW3.354 MOVE_UINT URCV_T_11 RAS REQ1 RAS_COMPLETE1 URCV_T DONE %MW3.350 RAS ERROR1 ERROR RCV_STATUS1 %MW3.3967 STATUS %MW3.350 Ethernet module User’s Manual...
  • Page 193 7.5 RAS Information Readout (5) RAS information details (a) RAS counters and LAN controller (line) information Reads out 128 words of data using RAS information readout. Table 7-2 RAS Counters Symbol Description RAS_CNT [0] Normal reception count RAS_CNT [1] Bus read error (reception buffer read failure) count RAS_CNT [2] Remote reset packet reception count (Packets whose Ethernet header type was set to 0900H.)
  • Page 194 Chapter 7 RAS Information (c) MIB information: IP protocol information Reads out 17 words of data using RAS information readout. Table 7-4 MIB_IP Symbol Description MIB_IP [0] This flag indicates whether the IP gateway is operating or not. MIB_IP [1] Default TTL (Time to Live) of the IP packet.
  • Page 195 7.5 RAS Information Readout (d) MIB_TCP ••• TCP protocol information Reads out 10 words of data using RAS information readout. Table 7-5 MIB_TCP Symbol Description MIB_TCP [0] Maximum retransmission timeout time (in milli-seconds) MIB_TCP [1] Number of active open connections MIB_TCP [2] Number of passive open connections MIB_TCP [3]...
  • Page 196 Chapter 7 RAS Information (g) Event trace information • Record size: 16 bytes (8 words) • Number of records: 160 • Operation on overflow: Old information is updated. This means that it is always possible to verify the 160 most recent event trace records.
  • Page 197 7.5 RAS Information Readout Table 7-8 Event Trace Items Event Detail Detail Detail Detail Content code information 1 (H) information 2 (H) information 3 (H) information 4 (H) 0001H ROM error (0160) Initialization error RAM error (0260) DPRAM error (0360) 0002H Program address Error code...
  • Page 198 Chapter 7 RAS Information Preamble (7 bytes) Signal used to synchronize reception SFD (Start Frame Delimiter) (1 byte) Remote station address (6 bytes) Local station address (6 bytes) Ethernet type (2 bytes) 0800H:IP, 0806H:ARP IP header (20 bytes) UDP header (8 bytes) Packet TCP header...
  • Page 199 7.5 RAS Information Readout Figure 7-1 Packet Format/IP Datagram 6F8C0904...
  • Page 200 Chapter 7 RAS Information Ethernet module User’s Manual...
  • Page 201: Error Handling

    Chapter 8 Error Handling This chapter describes the error analysis and recovery procedures for errors that occur while using the EN311. Also refer to the S controller user's manual when recovering from EN311-related errors. 6F8C0904...
  • Page 202: Led Display

    Chapter 8 Error Handling 8.1 LED Display The EN311 indicates its module status in the RUN, STBY, ACC, and EXT.POWER LEDs. Table 8-1 lists the states indicated by the RUN and STBY LEDs. Note that the EN311 operating mode can be determined by the combination of the RUN and STBY LED display states as listed in Table 8-2.
  • Page 203 8.1 LED Display Table 8-2 Module Down States Indicated by RUN/STBY LED Combinations LED combination Description displayed RUN On, STBY On Module operating normally in standby mode (parameter setup waiting state) The module goes to this state after power is first applied and after a reset.
  • Page 204 Chapter 8 Error Handling The ACC LED indicates when the S controller is accessing the EN311 and the EXT.POWER LED indicates when 12-VDC power is supplied to the MAU power supply terminals. Table 8-3 States Indicated by the ACC and EXT.POWER LEDs LED display Description ACC(Access)
  • Page 205: Error Status

    8.2 Error Status 8.2 Error Status The error status indicates the status after USEND_T/URCV_T instruction execution completes. If a USEND_T/URCV_T instruction does not complete normally, refer to the error status and review the instruction word format at the S controller as well as the EN311 states (operating modes).
  • Page 206: Station Status

    Chapter 8 Error Handling 8.3 Station Status The statuses of the EN311 (station statuses) are indicated by the S controller interface memory. The station statuses can be read out to the S controller side using the MREAD instruction. For more information, refer to section 7.1, "Station Status Information". Ethernet module User’s Manual...
  • Page 207: Socket Interface Information

    8.4 Socket Interface Information 8.4 Socket Interface Information The information for the eight socket interface sockets held by the EN311 can be read out with the S controller MREAD instruction (see section 6.3, "Socket Interface Information"). The EN311 holds five words of socket status information for each socket(see Table 6-1). 6F8C0904...
  • Page 208: Troubleshooting

    Replace the module. Can the EN311 be brought Read out the down information and up normally when used in combination with other S send it to Toshiba together with the controller ? module. One of the possible causes is the following: Replace the S controller.
  • Page 209 8.5 Troubleshooting (3) When the EN311 fails to enter run mode This section assumes that the module has started normally up to this point. Note that the parameters must be set up with a parameter setup request before issuing the operating mode control request used to switch the module from standby mode to run mode.
  • Page 210 Chapter 8 Error Handling (b) Operating mode control request Start Set up the correct information as Is the operating mode specified and issue an operating control request executed ? mode control request. Confirm the status when the Is the USEND_T instruction USEND_T or URCV_T is not completed ? completed.
  • Page 211 8.5 Troubleshooting (4) When computer link protocol transmission fails (a) Host computer side (main station) Start Is the transmission Check the slave station EN311 IP destination IP address set address. to that of the slave station EN311 ? Check the slave station message transmission UDP port number.
  • Page 212 Chapter 8 Error Handling (b) EN311 side (slave station) Start Is the station status Set the station to run + message such that run + message transmission enabled using an transmission is operating mode control request. enabled ? 1) Check the host computer IP address.
  • Page 213 8.5 Troubleshooting (5) When PC link protocol transmission fails (a) Main station EN311 Start Is the USEND_T or Confirm the status when the USEND_T URCV_T instruction or URCV_T is not completed. completed ? Is the station status A response timeout such that run + occurred ? message transmission...
  • Page 214 Chapter 8 Error Handling (b) EN311 side (slave station) Start Is the station status Set the station to run + message such that run + transmission enabled using an message transmission operating mode control request. is enabled ? 1) Check the main station IP address. 2) Configure the router if there is a router on the transmission line.
  • Page 215 8.5 Troubleshooting (6) When transmission using UDP sockets fails (a) Open and close requests Start Confirm the status when the Is the USEND_T instruction USEND_T or URCV_T is not completed ? completed. s the station status such Set the station to run + socket that run + socket transmission enabled using an transmission is...
  • Page 216 Chapter 8 Error Handling (b) Send request Start Confirm the status when the Is the USEND_T instruction USEND_T or URCV_T is not completed ? completed. Set the station to run + socket Is the station status such that transmission enabled using an run + socket transmission is operating mode control request.
  • Page 217 8.5 Troubleshooting (c) Receive request Start Is the URCV_T Confirm the status when the Is the waiting time set instruction completed ? to unlimited ? USEND_T or URCV_T is not completed. ① Set the station to run + socket Is the station status A timeout occurred ? such that run + socket transmission enabled using an...
  • Page 218 Chapter 8 Error Handling (7) When Transmission Using TCP Sockets Fails When troubleshooting TCP sockets, also refer to the "TCP Socket Notes" section. (a) Open request Start Confirm the status when the Is the URCV_T Is the waiting time set USEND_T or URCV_T is not instruction completed ? to unlimited ?
  • Page 219 8.5 Troubleshooting (b) Close request Start Confirm the status when the Is the USEND_T USEND_T or URCV_T is not instruction completed ? completed. Is the station status Set the station to run + socket such that run + socket transmission enabled using an operating mode control request.
  • Page 220 Chapter 8 Error Handling (c) Send request Start Confirm the status when the Is the USEND_T USEND_T or URCV_T is not instruction completed ? completed. Set the station to run + socket Is the station status such transmission enabled using an that run + socket transmission operating mode control request.
  • Page 221 8.5 Troubleshooting (d) Receive request Start Confirm the status when the Is the USEND_T Is the waiting time set USEND_T or URCV_T is not instruction completed ? to unlimited ? completed. ① Set the station to run + socket Is the station status A timeout occurred ? transmission enabled using an such that run + socket...
  • Page 222 Chapter 8 Error Handling (8) Network verification items (EN311) Verification items Resolution EN311 external 1) Is the 10BASE5/10BASE2 switch 1) Set the 10BASE5/10BASE2 switch power supply set to the position corresponding to to the correct position. the transmission medium actually used? 2) Does the EXT.POWER LED turn on 2) Check whether or not the 12-VDC...
  • Page 223 8.5 Troubleshooting Verification items Resolution Network cable 1) Is the coaxial cable (10BASE5 or 1) Coaxial cables must be grounded to check 10BASE2) grounded to a single a single point with a resistance to ground of 100 Ω or less. point with a resistance to ground of 100 Ω...
  • Page 225: Installation And Wiring

    Chapter 9 Installation and Wiring 9.1 Installation Environment and Base Unit Mounting The EN311 must be used in the installation environment described in "Installation Environment" section of the S3 User's Manual - Hardware. Also, the EN311 panel must be installed according to the guideline included in "Installation Environment" section. The S controller base unit must also be mounted according to the guideline included in section 4.2, "Registering the EN311"...
  • Page 226: Mounting And Removing Modules

    Chapter 9 Installation and Wiring 9.2 Mounting and Removing Modules Be sure to follow the guideline included in "Mounting Modules" section in the S3 User's Manual - Hardware. Caution • The EN311 is designed specially for the S controller and should only be mounted and used in an S controller base unit.
  • Page 227: Power Supply Wiring And Grounding

    9.3 Power Supply Wiring and Grounding 9.3 Power Supply Wiring and Grounding (1) Power supply wiring (a) S controller power supply wiring Wire the S controller power according to the items presented in "Wiring of the Power Supply" section in the S3 User's Manual - Hardware. Use shielded transformers and noise filters if the power supply has a high noise level.
  • Page 228: Network Wiring

    Chapter 9 Installation and Wiring 9.4 Network Wiring See section 3.6, "Network Wiring Equipment" for details on the equipment that makes up the network. This section presents an outline of the wiring laid inside the control panel and outside the control panel. This section also presents individual notes on the coaxial cables used, the AUI cables, and the MAUs.
  • Page 229 9.4 Network Wiring (b) Overview of wiring without protective pipes 1) To protect the cables, cables should be passed through flooring ducts or wire protecting cable covers should be used. Note that these cables should not be laid adjacent to cables carrying high currents.
  • Page 230 Chapter 9 Installation and Wiring Table 9-3 Recommended Minimum Separation Distance (Covered metal ducts and metal pipe) (Units: mm) Cable installation method Covered metal ducts or metal pipe Up to 10 Up to 25 Up to 100 Up to 200 Up to 500 Parallel separation meters or...
  • Page 231 9.4 Network Wiring (e) Wiring routes The desirable routes for laying the transmission cable can be ordered as follows. • Using a dedicated route • Using a route dedicated to computer system related lines • Using a route dedicated to general measurement equipment •...
  • Page 232 Chapter 9 Installation and Wiring (5) Notes on MAU (10BASE5) installation (a) Attach MAUs at the 2.5-meter separated marks on the coaxial cable. (b) Since the procedure for attaching MAUs to coaxial cable differs between manufacturer, refer to the MAU user's manual. (c) Since the coaxial cable is grounded, the MAU main unit should be mounted insulated from ground.
  • Page 233: A Maintenance And Inspection

    Appendix A Maintenance and Inspection Periodic Inspection Check the following items periodically, once every six months. Also, check these points if any surrounding conditions or any environmental aspect changes. Table A-1 Periodic Inspection Items Inspection item Inspection Criterion Resolution procedure Power supply Measure the power- Voltages must be within...
  • Page 234 Using the module in an abnormal state can lead to malfunctions, breakdowns, and electrical shock. In such cases, immediately turn of all power and contact your local Toshiba dealer or service representative. Customers should never attempt repairs or modifications to this equipment themselves: repair and modification operations are extremely dangerous.
  • Page 235: B Socket Service Command Table

    Appendix B Socket Service Command Table The following table lists the socket service commands used with USEND_T/URCV_T instructions sent to the EN311. Refer to the section/item indicated in the reference column in the table for detailed explanations of the request codes. Table B-1 Request Codes to the EN311 Command/Code Function...
  • Page 236 Appendix B Socket Service Command Table • The socket service code (CMD) classes (1) to (3) have the following meanings. Class (1) is module control, (2) is PC link protocol transmission, and (3) is socket interface transmission. • For a single EN311 module, it is not possible to request another class (1) command while a class (1) command is executing.
  • Page 237: C Error Status Table

    Appendix C Error Status Table Tables C.1 and C.2 list the contents of the error status generated from STATUS at the completion of USEND_T/URCV_T function block. Table C-1 Contents of Completion Statuses STATUS Name Explanation Normal completion -5001 Parameter error •...
  • Page 238 Appendix C Error Status Table Table C-1 Contents of Completion Statuses STATUS Name Explanation 0BxxH Transmission error • Occurs if the EN311 detects an error and responds. For more information, see Table C.2 below. Table C-2 Detailed Information Error Code Description Normal completion...
  • Page 239 Table C-2 Detailed Information Error Code Description LAN controller • Occurs if the setting of the local station IP address and port driver error number in the area reserved for transmission fails. • Error in the TCP or UDP protocol (such as a transmission phase error) •...
  • Page 241 Appendix D USEND_T and URCV_T Execution Times Since execution of the USEND_T and URCV_T instructions involves instruction processing that extends across multiple scans, the execution times differ in each of the states at instruction activation time, response wait time, and instruction completion time. (1) For PC link transmission The following operations are performed for PC link transmission: Scan during instruction activation: Transmission request or reception request to the...
  • Page 242: Times

    Appendix D USEND_T and URCV_T Execution Times Table D-2 Module Control Request Instruction Execution Times Execution time ( µ s) Command/Code Function block Operating mode USEND_T At instruction control request/ activation 16#0313 During response wait At completion Remote station USEND_T At instruction confirm request/ activation...
  • Page 243 Table D-3 Socket Transmission Instruction Execution Times N: Number of words transmitted (1-1000) Execution time ( µ s) Command/Code Function block 330 + 0.4 × N TCP send request/ USEND_T At instruction 16#0337 activation During response wait At completion TCP receive request/ URCV_T At instruction 16#0338...
  • Page 245: E Computer Link/Pc Link Protocol Minimum Transmission Delay Times

    Appendix E Computer Link/PC Link Protocol Minimum Transmission Delay Times (1) Minimum delay time for computer link protocol transmission The minimum delay time from the point the host computer issues a request to the S controller to the point a response is received for computer link protocol transmission (Computer link protocol transmission minimum delay time) = (Host computer transmission processing time) + ("S controller response time) The S controller response time depends on the following three instructions:...
  • Page 246 Appendix E Computer Link/PC Link Protocol Minimum Transmission Delay Times Below we present the technique for calculating the response time at the S controller main unit for computer link protocol transmission. (a) For fixed scan If a fixed scan period is used, the following condition must be fulfilled: (S controller main task scan time) >...
  • Page 247 (2) Minimum delay time for PC link protocol transmission For PC link protocol transmission instructions, the time from the point the instruction is invoked to the point that instruction completes, that is the transmission delay time from the point a transmission or reception request is initiated to the point the response is received from the remote station will be as follows, assuming no collisions occur on the network.
  • Page 249: F Socket Interface Transmission Processing Time

    Appendix F Socket Interface Transmission Processing Time The send/receive processing times (for the S controller and the EN311) in socket transmission can be determined from the following formulas. Conditions: (1) Only one socket is used in the EN311. (2) The user program execution time itself is not included. (3) The processing times are given for data size ranges for which no packet division occurs.
  • Page 251: G Change/Correction Function In A Firmware

    Appendix G Change/correction function in a firmware G.1 Revision J Here, the item changed / corrected by the firmware revision J is explained. The firmware revision J is introduced from the product after the serial number "01800001" of EN311. Also in EN311 to which the serial number before "01800001" is attached, when the seal of "J"...
  • Page 252 Appendix G Change/correction function in a firmware Table G-1 Comparison of a firmware (before Revision J and Revision J) Reset request Revision J If EN311 operation mode is "RUN", "STANDBY" or, "DOWN", a reset request can be required from S-controller user program to EN311. Before If EN311 operation mode is "RUN"...
  • Page 253: Revision K

    G.2 Revision K Here, the item corrected by the firmware revision K is explained. The firmware revision K is introduced from the product after the serial number "02Z00001" of EN311. Also in EN311 to which the serial number before "02Z00001" is attached, when the seal of "K"...
  • Page 254: Revision L

    Appendix G Change/correction function in a firmware G.3 Revision L Here, the item corrected by the firmware revision L is explained. The firmware revision L is introduced from the product after the serial number "04400001" of EN311. Also in EN311 to which the serial number before "04400001" is attached, when the seal of "L"...
  • Page 255 INDEX Index NUMBER 10BASE2 socket interface socket interface information DIX Standard T Series/Computer link protocol transmission T Series/PC link protocol transmis- sion Event trace information TCP (Transmission Control Proto- col) IP (Internet Protocol) ISO8802-3(IEEE802.3) UDP (User Datagram Protocol) URCV_T function block USEND_T function block MIB_ICMP MIB_IF...
  • Page 257 3000 Ethernet Module (EN311) Operation Manual 2nd edition 30th Sep, 2004 0904.2.0409 INDUSTRIAL AND POWER SYSTEMS & SERVICES ELECTRICAL APPARATUS & MEASUREMENT DIVISION 1-1, Shibaura 1-chome, Minato-ku, Tokyo 105-8001, Japan Tel.:+81-3-3457-4900 Fax.:+81-3-5444-9268 TOSHIBA Corporation 2000-2004  All Right Reserved.