Académique Documents
Professionnel Documents
Culture Documents
This driver allows the IPC to communicate with other PCs and Controllers using the UDP or TCP protocol from the TCP/IP protocol suite. In this document many terms related to TCP/IP are used, for explanation of these no additional information is available at the moment.
17-1
Contents 1 Driver overview..................................................................................... 3 2 Configuring the driver and assigning parameters ............................. 4 3 Extended CI commands for TCP/IP..................................................... 6 4 Modules for TCP/IP .............................................................................. 8
4.1 Data received by handlers.........................................................................14 4.2 Error codes...............................................................................................14
17-2
Chapter 17: TCP/IP 1 Driver overview To function properly every TCP/IP participant (host) needs an IP address and netmask. The FST TCP/IP driver allows 3 ways for configuring these: configuration in the Driver configuration screen, using function blocks or dynamically using the BOOTP protocol. If the IP address is 0 (0.0.0.0) either through configuration or change through a function block the BOOTP protocol will be automatically activated. If the IP address is set the BOOTP protocol will be deactivated.
The FST TCP/IP driver implements the following protocols / services for communication and testing:
protocol ICMP UDP UDP UDP UDP UDP TCP port n.a. 7 13 991 992 993 7 port desc. n.a. echo daytime CI CI_EXT CI_BIN echo description used for PING returns all data received returns string with date and time command interpreter extended command interpreter binary data exchange returns all data received
Accessing the command interpreter uses as follows: send an UDP datagram with the CI command (without CR / LF) to the FST controller and port number 991 and the result will be returned. For example DR0 will result in something like =1099. Using the extended command interpreter on port 992 is similar with the following extension, the result will be DR0 NULL charachter =1099. The response will be the original question and the CI reply seperated by a NULL character.
17-3
Chapter 17: TCP/IP 2 Configuring the driver and assigning parameters If you want to use TCP/IP in an FST IPC project, you must enter the TCP/IP driver in the driver configurer and assign the necessary parameters. Destination drive: Specify the drive on which the TCP/IP driver TCPIPDRV.EXE is located or onto which it is to be loaded. Interrupt of CP10 module: The interrupt as configred on the CP10 or CP11 module. Allowed values are 2, 3, 5, 6 and 7. IO port configuration: The IO port (in hexadecimal !) as configured on the CP10 or CP11 module. Allowed values are 300, 320, 340 and 360. Interrupt for packet driver: The software interrupt (in hexadecimal !) to be used by the packet driver. The TCP/IP driver actually consists of 2 parts: a packet driver to communicate with the CP10 or CP11 and the TCP/IP driver itself. The communication between these parts is through a software interrupt. This interrupt is configurable to avoid conflicts with other drivers. Allowed values are 68, 69, 6A, 6B, 6C, 6D, 6E and 6F. IP address: The IP address. Leave the address to 0.0.0.0 if the address is configured through the IP_IP function block or dynamically through the BOOTP protocol. IP netmask: The IP netmask. Leave the mask to 255.255.255.0 if the netmask is configured through the IP_MASK function block or dynamically through the BOOTP protocol. IP address gateway: The IP address for the standard gateway. Leave the address to 0.0.0.0 if there is no gateway or the gateway
17-4
Chapter 17: TCP/IP address is configured through the IP_GATE function block or dynamically through the BOOTP protocol.
Configuration of TCP/IP driver for E.IPC-CP15 For the CP15 the configuration is slightly different. In this case only the interrupt for packet driver and IP configuration are entered. Additonally there is a configuration file PKT.INI (in the FST runtime directory) which must be edited to reflect to settings to be used. Most important parameters are BitRate, Channel, RadioType and SystemId.
17-5
Chapter 17: TCP/IP 3 Extended CI commands for TCP/IP This driver extends the IPC command interpreter with the following commands:
!26
Display driver info and version number. This information will also be displayed if an unknown command is entered (for example !26?).
!26Axx
Displays information from the Address Resolution Protocol (ARP). The TCP/IP driver holds a table of 16 IP addresses and Ethernet addresses. If the position (xx) is omitted the displayed information will automatically cycle through the used positions.
!26Hxx
Displays information about currently defined TCP and UDP handlers and their state. If the position (xx) is omitted the displayed information will automatically cycle through the defined handlers.
!26I
Display IP configuration
17-6
!26SI
Display IP statistics
Displays IP packet statistics: total send, total received, checksum errors, wrong destination address.
!26SP
Displays Ethernet packet statistics: total send, total received, overflow, packet too large.
!26ST
Displays IP packet statistics: total send, total received, checksum errors, wrong destination address, no handler for TCP port.
!26SU
Displays IP packet statistics: total send, total received, checksum errors, wrong destination address, no handler for UDP port.
!26Txx
Displays the IP addresses currently defined in the IP table. The TCP/IP driver can hold a total of 16 IP addresses for easy reference.
17-7
All modules return an error code in FU32, see the table with all errorcodes for an explanation of the individual codes.
17-8
Output parameters
Output parameters
17-9
Output parameters
Output parameters
17-10
Output parameters
Some additional data is written if a datapacket is received. See table below for layout. The handler number returned in FU33 must be stored and used to send TCP datapackets.
Output parameters
17-11
Output parameters
17-12
Output parameters
Some additional data is written if a datapacket is received. See table below for layout. UDP_SEND Send an UDP datapacket
Input parameters FU32 FU33 FU34 FU35 FU36 FU32 local port number to use index number in IP table Destination port number number of bytes to send number of first flagword to send 0 if successful, otherwise error
Output parameters
17-13
4.1 Data received by handlers Handlers write data to flagwords if a packet is received. Also written is the IP address, port number of the datapackets sender. The following table lists all data stored (FWx is the installed flagword):
Number of packets received by handler Sender IP address Sender IP address Sender IP address Sender IP address Sender port number Number of databytes received Start of actual datapacket
Note that the received size is the number of bytes, not the number of words.
4.2 Error codes If FU32 is <> 0 then the function module returned an error, following table lists the error codes:
Invalid parameter TCP/IP driver not loaded Illegal IP address Illegal table index (> 20) Table position empty
17-14