Schneider Optics Modicon Quantum Ethernet manual Application Message Format

Page 80

Ethernet Developers Guide

One of the parameters to the WSAAsyncSelect is a user defined message the window socket DLL sends to the window. The sample application user message is WM_TCPIP_EVENT and is defined in the file wn_msh.h. MFC architectural framework calls the CSample_View tcpip_event member function to process this message. Like all functions which process messages, tcpip_event parameters are a word and a long word. The word parameter is the socket, and the long word parameter contains the network event , and an error code. Tcpip_event examines the network event and calls the member function indicated in the following table.

Network Event

Member Function

 

 

FD_READ

OnTcpIpRead()

 

 

FD_WRITE

OnTcpIpWrite()

 

 

FD_OOB

OnTcpIpOob()

 

 

FD_CONNECT

OnTcpIpConnect

 

 

FD_CLOSE

OnTcpIpClose()

 

 

B.7.2 Application Message Format

TCP/IP transmits a message as a stream. There is no indication of the start of a message nor the end of the message. The NOE option module adds a header to determine the message boundaries. The message is a Modbus message. The header contains the following fields.

Invoke Identifier. This two byte field associates a request with the response. The client application picks the invoke identifier, and server returns the same invoke identifier in the response.

Protocol Type. This two byte field identifies the protocol type. Currently, the only protocol supported is Modbus.

zCommand Length. This two byte field is the size of the rest of the message. Destination Identifier. This one byte field is reserved for future use.

The Modbus message follows the header. The message does not contain the address field, instead, the first byte is the Modbus function code.

The data structure for the header is declared in modbus.h and the CSample_View encode_header function encodes the header. The member functions encode_clear_stats, encode_read_stats, encode_read_rq, and encode_write_rq encode the corresponding Modbus messages.

70

840 USE 115 00 Version 1.0

Image 80
Contents Modicon Quantum Ethernet USE 115 00 VersionTraining October Modicon Quantum EthernetUSE 115 00 Vesion 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 aTransmit Data Twisted Pair ConnectorFiber Optic Connectors Errlog Utility DisketteNetwork Options Ethernet Tester 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 TopologiesMounting the Module on the Backplane Installing the ModuleAre You Really Ready to Install? Check 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 IP Network Address Assigning the Default Gateway Address and Subnet MaskResetting the Module Configuring More Than One Ethernet Module Configuring the Module with Concept Parameter Dialog for an Ethernet Web Embedded Server ModuleMstr Operation Code TCP/IP Ethernet Support Mstr Instruction IntroductionMstr Description 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 IndexModule information as described in the following table Reset Option Module Mstr OperationRead CTE Config Extension Table Mstr Operation 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 LEDKernel LED Fault LEDLink 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 Event Description Accessing TCP/IPCSampleView Class 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 Port Number TCP/IP Specific IssuesBroadcast/Multicast 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