Schneider Optics Modicon Quantum Ethernet CSampleView Class, Accessing TCP/IP, Event Description

Page 79

Ethernet Developers Guide

B.7 The CSample_View Class

The CSample_View class manages the TCP/IP connection, sends requests to remote nodes, and displays either connection state, or the results of a transaction. In addition it sets the states of the tool bar buttons and menu items.

B.7.1 Accessing TCP/IP

The CSample_View interfaces with window sockets via its application programming interface, and via messages sent by the window sockets DLL to the CSample_View window. The reference for the window socket API is given above. The first call made to the window sockets DLL must be WSAStartup. This call is made by InitInstance member function of the CSample_app class. The last call to the window socket DLL must be WSACleanup. This call is made by the ExitInstance member function of the Csample_app class.

The CSample_View allocates and sets the socket attributes. The attributes it sets are given in the following table.

Set Linger to cause a hard close

zReceive out of band data in the normal data stream

Disable Nagel algorithm for send coalescing

When Nagel algorithm is disabled, if the stack receives an application message, it will immediately pass the message to the application and will send a TCP/IP acknowledgment message. Although this can generate more traffic, the application receives the message sooner then if Nagel algorithm is enabled. The member function tcpip_setsocket_options sets the socket attributes.

The window socket interface provides the WSAAsyncSelect function which notifies the window of network events. The member function tcpip_setsocket_options calls WSAAsyncSelect function. The different events are given by the following table.

Event

Description

 

 

FD_READ

A socket can read data

 

 

FD_WRITE

A socket can write data

 

 

FD_OOB

A socket can read out of band data

 

 

FD_CONNECT

A connect response has been received

 

 

FD_CLOSE

The connection has been closed

 

 

840 USE 115 00 Version 1.0

69

Image 79
Contents USE 115 00 Version Modicon Quantum EthernetTraining USE 115 00 Vesion Modicon Quantum EthernetOctober 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 moduleFiber Optic Connectors Twisted Pair ConnectorTransmit Data Network Options Ethernet Tester Utility DisketteErrlog 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 ProperlyAre You Really Ready to Install? Check Installing the ModuleMounting the Module on the Backplane 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 TypeResetting the Module Assigning the Default Gateway Address and Subnet MaskAssigning the IP Network Address Configuring More Than One Ethernet Module Parameter Dialog for an Ethernet Web Embedded Server Module Configuring the Module with ConceptMstr Description Mstr Instruction IntroductionMstr Operation Code TCP/IP Ethernet Support 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 WordRead CTE Config Extension Table Mstr Operation Reset Option Module Mstr OperationModule information as described in the following table 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 LEDLink LED Fault LEDKernel 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 CSampleView Class Accessing TCP/IPEvent Description 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 Broadcast/Multicast TCP/IP Specific IssuesTCP Port Number 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