Schneider Optics Modicon Quantum Ethernet manual Receive State Machine

Page 84

Ethernet Developers Guide

The receive state machine (which is described below) processes the response to a request. When the receive state machine has completed receiving the response, it changes the transmit state machine from the TX_DONE state to the WAIT_TO_TX state.

Recall that the TransmitUserRequest saves the time. CSample_View OnPollInterval uses this saved time to determine if a new request needs to be transmitted. OnPollInterval is called by MFC architectural framework to process the WM_POLL_INTERVAL sent when CMainFram class processes the window timer message, WM_TIMER. OnPollInterval examines the transmit state. If the transmit state is WAIT_TO_TX, and the elapsed time from the previous transmit request exceeds the poll interval, then OnPollInterval calls TransmitUserRequest to start another transaction.

B.11 Receive State Machine

The receive state machine receives a response to a transaction by first reading the header, determining the size of the rest of the message, and then reading the body of the message. The different states of the receive state machine are as follows.

RX_HEADER. In the RX_HEADER state, the receive machine is receiving the message header.

RX_BODY. In the RX_HEADER state, the receive machine is receiving the

zresponse message associated to the requested transaction.

DUMP_BODY. In the DUMP_BODY state, the receive message is receiving a message, but there is no associated transaction with respect to this message.

The window socket DLL generates the FD_READ event whenever there is data to be read. If only part of the data is read, it generates another event. CSample_View OnTcpIpRead function processes the FD_READ event, and drives the receive state machine.

When a FD_READ event is generated it is possible that the complete message is not present. The remote node may have attempted to send a 100 byte response, but the transport system may have only had buffer space to transmit three bytes. The receiver will get a FD_READ for the three bytes. OnTcpIpRead calls CSample_View rx_msg to read the receive data into the buffer. There are three parameters to rx_msg. The first parameter is a pointer to a receive buffer. The second input parameter is the receive size. The third parameter is both an input and output parameter. On both input and output the third parameter is the number of bytes read. These parameters allow the processing of a partially received message.

74

840 USE 115 00 Version 1.0

Image 84
Contents Modicon Quantum Ethernet USE 115 00 VersionTraining Modicon Quantum Ethernet USE 115 00 VesionOctober Document Set Preface USE 115 00 Version Contents Using the Network Options Ethernet Tester Chapter MaintenanceMstr Instruction Retrieving Data via the World Wide WebAppendix a Specifications Appendix D Suppliers Glossary IndexContents Viii About This Book Document Scope Validity Note Related DocumentationIntroduction Ethernet Web Embedded Server Modules Benefits of Quantum DesignModels for Fiber Optic and Twisted Pair Cable Systems Type of Cable Network Part NumberFront Panel Components Removable Door140 NOE 251 Color Indication When On LED DisplayAddress Labels EthernetAddress Label Internet Protocol IP Network Address LabelExample Calculating the Derived IP Network Address Locate the global address label onFront panel of the module 0 B 7 2 aTwisted Pair Connector Fiber Optic ConnectorsTransmit Data Utility Diskette Network Options Ethernet TesterErrlog Ethernet and Your Application Meeting the Demands of Your ApplicationCompatibility Guidelines for Designing Your NetworkDelays Using SwitchesSegregating TrafficInstalling and Configuring Module Before You Begin Verifying the Default ConfigurationVerifying that the Network Has Been Constructed Properly Improper Network TopologiesInstalling the Module Are You Really Ready to Install? CheckMounting the Module on the Backplane Connecting the Cable With connectors 990 XCA 656Twisted Pair Snap into placeAttaching the Cable Changing the Default Configuration Configuring the Module with ModsoftSelecting the Ethernet Framing Type Assigning a Slot NumberAssigning the Default Gateway Address and Subnet Mask Resetting the ModuleAssigning the IP Network Address Configuring More Than One Ethernet Module Configuring the Module with Concept Parameter Dialog for an Ethernet Web Embedded Server ModuleMstr Instruction Introduction Mstr DescriptionMstr Operation Code TCP/IP Ethernet Support Characteristics SizeCompatibility Opcode BF hexContent RepresentationInputs OutputsMstr Function Error Codes Error CodesMiddle Node Bottom NodeHex Error Code Meaning Ss Hex value MeaningHex Error Code Meaning 5016 An argument is valid Read and Write Mstr Operations Control BlockUtilization Information as described in the following tableGet Local Statistics Mstr Operation Statistics information as described in the following tableClear Local Statistics Mstr Operation Get Remote Statistics Mstr OperationClear Remote Statistics Mstr Operation Peer Cop Health Mstr Operation Peer CopCommunications Health StatusType Word Status IndexReset Option Module Mstr Operation Read CTE Config Extension Table Mstr OperationModule information as described in the following table Parameter Register Content CTE DisplayImplementation Registers. The registers display the following CTE dataWrite CTE Config Extension Table Mstr Operation 13 TCP/IP Ethernet Statistics Word MeaningRetrieving Data via the World Wide Web Introduction Accessing the Web Utility Home Web Utility HomeWeb Utility for Quantum Quantum Web UtilityRetrieving Data via the World Wide Web Using the Network Options Ethernet Tester Introduction Installing the Network Options Ethernet Tester Establishing a Connection with an Ethernet ModuleMain Menu Getting and Clearing Statistics Get Statistics BoxMAC Address Sample StatisticsUsing the Network Options Ethernet Tester Reading and Writing Registers Read Register BoxWrite Register Box Maintenance Responding to Errors Detecting ErrorsActive LED Ready LEDFault LED Link LEDKernel LED Collision LED LED Display for Improperly Connected Twisted Pair CableReading and Clearing the Error Log Application LEDDefault is Example Errlog 49 EBX, EBP, ESI, EDI, ESP, EFLAGS, EIPExample Sample Error Log To restart the controller, type YHot Swapping An Ethernet Module Downloading a New Software Image From the Device to Download menu, select Local HeadUSE 115 00 Version Specifications Power Dissipation Bus Current Required Operating ConditionsCommunication Ports Storage ConditionsSpecifications Ethernet Developers Guide Introduction ReferencesOverview Development EnvironmentClass Descriptions CSampledoc Class Accessing TCP/IP CSampleView ClassEvent Description Application Message Format Network Event Member FunctionTimers Transaction ProcessingTransmit State Machine Exists the loop Receive State Machine Ethernet Developers Guide Displaying on the Screen Quantum Ethernet TCP/IP Modbus Application Protocol Modbus Application Protocol PDU Includes the dstid and data fieldsIs defined below Counts and data offsetsModbus Application Protocol Service Classes Modbus Application Protocol PDU Analysis Quantum Ethernet TCP/IP Modbus Application Protocol TCP/IP Specific Issues Broadcast/MulticastTCP Port Number Reference Documents Quantum Ethernet TCP/IP Modbus Application Protocol Suppliers Suppliers Glossary AddressBps BridgeDefault gateway FieldFrame Framing typesHub InternetIP Address IO MapOSI model PacketPort ProtocolSwitch SocketStack SubnetGlossary Index Index Mstr Network Options Ethernet Tester World Wide Web server