Schneider Optics Modicon Quantum Ethernet manual Exists the loop

Page 83

Ethernet Developers Guide

If the remote node is an IP address, or if it’s a name that has been resolved, then CSample_View tcpip_connect_rq function is called to initiate a connect request to the remote node. The listen port for the connect request is five hundred and two, and is defined by the constant MBAP_LISTEN_PORT in modbus.h. If tcpip_connect_rq succeeded in initiating a connect request, then tcpip_connect_rq changes the transmit state to CONNECTING, otherwise it changes the transmit state to IDLE.

The window sockets DLL generates a FD_CONNECT event which indicates if the connect request succeeded or failed. CSample_View OnTcpIpConnect function processes the FD_CONNECT event. If the connect request succeeded, OnTcpIpConnect changes the transmit state to CONNECTED, otherwise it changes the state to IDLE.

Recall that MFC architectural framework calls CSample_View OnPollInterval member function to processes WM_POLL_INTERVAL message sent as result of CMainFrame class processing a WM_TIMER message. OnPollInterval examines the transmit state. If the transmit state is CONNECTED, and the user has selected a transaction type, then OnPollInterval calls CSample_View TransmitUserRequest function.

TransmitUserRequest encodes a request based on the transaction type, saves the current time, and calls CSample_View TransmitMessage function. OnPollInterval uses the saved time to determine when to transmit the next request.

TransmitMessage attempts to send a message to the remote side. To send the message, TransmitMessage enters a loop. In the body of the loop transmit message calls the window socket DLL send function. The following lists the outcomes of the send function and the actions taken.

The message was sent successfully. TransmitMessage changes the transmit state to TX_DONE and exits the loop.

Only part of the message was sent. TransmitMessage reenters the loop.

Send function returns an error indicating there is no buffer space within the transport system. TransmitMessage changes the transmit state to BLOCKED

zand exists the loop.

Send function returns some other error. TransmitMessage closes the connection, changes the transmit state to IDLE, and exits the loop.

When buffer space within the transport system becomes available to transmit messages, the window socket DLL generates a FD_WRITE event. CSample_View OnTcpWrite function processes the FD_WRITE function by calling TransmitMessage.

840 USE 115 00 Version 1.0

73

Image 83
Contents USE 115 00 Version Modicon Quantum EthernetTraining October Modicon Quantum EthernetUSE 115 00 Vesion Document Set Preface USE 115 00 Version Contents Retrieving Data via the World Wide Web Using the Network Options Ethernet TesterChapter Maintenance Mstr InstructionAppendix D Suppliers Glossary Index Appendix a SpecificationsContents Viii About This Book Document Scope Related Documentation Validity NoteBenefits of Quantum Design Introduction Ethernet Web Embedded Server ModulesType of Cable Network Part Number Models for Fiber Optic and Twisted Pair Cable SystemsRemovable Door Front Panel Components140 NOE 251 LED Display Color Indication When OnInternet Protocol IP Network Address Label Address LabelsEthernet Address Label0 B 7 2 a Example Calculating the Derived IP Network AddressLocate the global address label on Front panel of the moduleTransmit Data Twisted Pair ConnectorFiber Optic Connectors Errlog Utility DisketteNetwork Options Ethernet Tester Meeting the Demands of Your Application Ethernet and Your ApplicationGuidelines for Designing Your Network CompatibilityTraffic DelaysUsing Switches SegregatingVerifying the Default Configuration Installing and Configuring Module Before You BeginImproper Network Topologies Verifying that the Network Has Been Constructed ProperlyMounting the Module on the Backplane Installing the ModuleAre You Really Ready to Install? Check Snap into place Connecting the CableWith connectors 990 XCA 656 Twisted PairAttaching the Cable Configuring the Module with Modsoft Changing the Default ConfigurationAssigning a Slot Number Selecting the Ethernet Framing TypeAssigning the IP Network Address Assigning the Default Gateway Address and Subnet MaskResetting the Module Configuring More Than One Ethernet Module Parameter Dialog for an Ethernet Web Embedded Server Module Configuring the Module with ConceptMstr Operation Code TCP/IP Ethernet Support Mstr Instruction IntroductionMstr Description Opcode BF hex CharacteristicsSize CompatibilityOutputs ContentRepresentation InputsBottom Node Mstr Function Error CodesError Codes Middle NodeSs Hex value Meaning Hex Error Code MeaningHex Error Code Meaning 5016 An argument is valid Information as described in the following table Read and Write Mstr OperationsControl Block UtilizationStatistics information as described in the following table Get Local Statistics Mstr OperationGet Remote Statistics Mstr Operation Clear Local Statistics Mstr OperationClear Remote Statistics Mstr Operation Health Status Peer Cop Health Mstr OperationPeer Cop CommunicationsStatus Index Type WordModule information as described in the following table Reset Option Module Mstr OperationRead CTE Config Extension Table Mstr Operation Registers. The registers display the following CTE data Parameter Register ContentCTE Display ImplementationWrite CTE Config Extension Table Mstr Operation Word Meaning 13 TCP/IP Ethernet StatisticsRetrieving Data via the World Wide Web Introduction Web Utility Home Accessing the Web Utility HomeQuantum Web Utility Web Utility for QuantumRetrieving Data via the World Wide Web Using the Network Options Ethernet Tester Introduction Establishing a Connection with an Ethernet Module Installing the Network Options Ethernet TesterMain Menu Get Statistics Box Getting and Clearing StatisticsSample Statistics MAC AddressUsing the Network Options Ethernet Tester Read Register Box Reading and Writing RegistersWrite Register Box Detecting Errors Maintenance Responding to ErrorsReady LED Active LEDKernel LED Fault LEDLink LED LED Display for Improperly Connected Twisted Pair Cable Collision LEDApplication LED Reading and Clearing the Error LogEBX, EBP, ESI, EDI, ESP, EFLAGS, EIP Default is Example Errlog 49To restart the controller, type Y Example Sample Error LogHot Swapping An Ethernet Module From the Device to Download menu, select Local Head Downloading a New Software ImageUSE 115 00 Version Storage Conditions SpecificationsPower Dissipation Bus Current Required Operating Conditions Communication PortsSpecifications References Ethernet Developers Guide IntroductionDevelopment Environment OverviewClass Descriptions CSampledoc Class Event Description Accessing TCP/IPCSampleView Class Network Event Member Function Application Message FormatTransaction Processing TimersTransmit State Machine Exists the loop Receive State Machine Ethernet Developers Guide Displaying on the Screen Quantum Ethernet TCP/IP Modbus Application Protocol Counts and data offsets Modbus Application Protocol PDUIncludes the dstid and data fields Is defined belowModbus Application Protocol Service Classes Modbus Application Protocol PDU Analysis Quantum Ethernet TCP/IP Modbus Application Protocol TCP Port Number TCP/IP Specific IssuesBroadcast/Multicast Reference Documents Quantum Ethernet TCP/IP Modbus Application Protocol Suppliers Suppliers Bridge GlossaryAddress BpsFraming types Default gatewayField FrameIO Map HubInternet IP AddressProtocol OSI modelPacket PortSubnet SwitchSocket StackGlossary Index Index Network Options Ethernet Tester World Wide Web server Mstr