Ethernet Developers Guide

B.10 Transmit State Machine

The transmit state machine establishes a connection, and periodically transmits a request. The different states for the transmit state machine are as follows.

IDLE. In the IDLE state, there is no connection.

RESOLVING_NAME. In the RESOLVING_NAME state, CSample_View is waiting for the window socket DLL to convert a node’s name into an IP address.

CONNECTING. In the CONNECTING state, CSample_View is waiting for the window socket DLL to generate the FD_CONNECT event. This event indicates if the attempt to establish a connection succeeded or failed.

CONNECTED. The CONNECTED state indicates that a connection has been successfully established.

WAIT_TO_TX. In the WAIT_TO_TX state, CSample_View is waiting to transmit the message. It transmits the message, when the time from the last

ztransmit exceeds the specified poll interval.

BLOCKED. When CSample_View attempts to send a message, the window socket DLL may not be able to transmit the complete message. This is a flow control condition, and CSample_View enters the BLOCKED state. The window socket DLL generates the FD_WRITE event when it can send more

zdata.

TX_DONE. CSample_View enters the TX_DONE when it has completed transmitting the request.

If the CSample_View is in the IDLE state, and user selects either the connect menu item, or the connect tool bar button, CSample_View OnManagConnect function attempts to establish connect with its tcpip_initate_connection function. This function examines the remote destination and determines if it’s a name or an IP address. If it’s a name, OnMangConnect changes the transmit state to RESOLVING_NAME, and it invokes the window sockets DLL WSAAsyncGetHostByName function to resolve the name. Window sockets DLL will generate the user defined WM_TCPIP_NAME_RESOLVED message which indicates if the name has been resolved. The OnTcpIpNameResolved member function process the WM_TCPIP_NAME_RESOLVED message. If the name is not resolved, OnTcpIpNameResolved changes the transmit state back to IDLE.

72

840 USE 115 00 Version 1.0

Page 82
Image 82
Schneider Optics Modicon Quantum Ethernet manual Transmit State Machine