550 564 06 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
UDP/IP Ethernet Communication ChannelThe function of a communication channel is to provide a mechanism for transferring data externally using different electrical standards to form a communication Port. The actual electrical interface is achieved by means of hardware, but the channel registers provide the user with facilities for selecting transfer timings and format, and for reading and writing data.
A UDP/IP Ethernet Communication channel can be used for transferring P-NET packets over an Ethernet network. The P-NET packets are wrapped into UDP packets.
For a UDP/IP Ethernet device, one channel is used for Ethernet data transfer, for local as well as for remote communication. ‘Local’ means communication within a local, secure IP network, whereas ‘remote’ means communication outside the secure IP network, typically on the Internet, through NAT routers. A default UDP Port number (34378) is reserved for local communication, and another (34379) for remote. All remote P-NET communication must include a password, to protect the device from unauthorized access. The network administrator should set up the NAT router to transfer packets to the remote communication UDP Port only. If this is done, only P-NET packets including a correct password will be accepted if they come from the NAT router, whereas P-NET packets from the local, secure IP network are accepted without password.
In general, it is recommended to use only a switched network, to reduce collisions, and to eliminate the time taken by P-NET nodes for rejecting packets intended for other nodes in a network. To completely avoid collisions, select Full Duplex. As auto negotiation to 10 MBit, Full Duplex is not possible, managed switches must be used, and manually configured.
Furthermore, it is recommended to use a separate IP subnet for P-NET nodes. P-NET devices with a UDP/IP Ethernet Communication Channel are set up to the default IP subnet address 172.17.17.xx. The subnet mask is fixed at 255.255.255.0. There are two ways of enabling a PC to communicate on this subnet: Either in the Advanced TCP/IP setup window in the control panel, add a new IP address (for example 172.17.17.10), or set up a local router to route packets to subnet 172.17.17.xx. Any other subnet address can be used, and is easily configured by means of the "Set P-NET Node Address" feature in VIGO.
Every server in a P-NET UDP/IP network must have a fixed IP address, and does not use DHCP. Normally, P-NET devices with a UDP/IP Ethernet Communication Channel have the IP address 172.17.17.NA, where NA is the P-NET Node Address. When the P-NET Node Address is set (for example by means of the Set P-NET Node Address utility in VIGO), the complete IP address is automatically set too. The P-NET Node address of a server can be in the interval 1..125. 0 is illegal, and 126 and 127 are used for netcast (broadcast within IP subnet).
A NetIndex and a NodeAddress form the address of a node in a P-NET UDP/IP network. The NetIndex selects the subnet, to which the node is logically connected, and the NodeAddress selects the node on that net. Up to 124 different subnets can be configured in the IPNetTable of the Ethernet communication channel. Subnet number 125 is reserved for dynamic client nodes. A subnet can be of type IPRange or UDPRange.
On an IPRange subnet, the first 3 bytes of the IP address come from the IPNetTable entry selected by the NetIndex, and the last byte from the NodeAddress. Example: IPNetTable[24] is an IPRange subnet, with IP address 172.18.19.00. The server logically connected to this subnet, with NodeAddress 12 is addressed with NetIndex = 24, NodeAddress = 12. IPRange subnets are used for direct addressing of nodes, without going through NAT routers. The same UDP port number is used to address all nodes on the same IPRange subnet. The UDP port number is defined in the IPNetTable. The value is typically 34378.
On a UDPRange network, the complete IP address comes from the IPNetTable entry selected by the NetIndex. The NodeAddress is added to the UDPPort defined in the IPNetTable entry. This configuration is used to access nodes on a remote network, through a NAT router. The IPAddress of the UDPRange subnet is the IPAddress exposed to the Internet by the remote NAT router. The router must be configured to translate the incoming UDP port number into the IPAddress of the node to be accessed, and to UDP port number 34379. A separate UDPRange subnet must be used for each remote network to be accessed.
Variables in a UDP/IP Ethernet Communication Channel
RegNo. 2: IPStateThis variable is a record having the following structure:
IPState holds the actual parameters for the communication channel, and statistics information.
IPAddrHolds the IP address of this node. The IP address is defined in RegNo. 5: NodeParam. It can be changed using the "Set P-NET Node Address" utility in VIGO.
MACAddrMACAddr holds the Ethernet MAC address of this node. The MAC address is fixed.
ReceivedPackets, SentPacketsThe values of ReceivedPackets and SentPackets hold the number of UDP/IP packets received and sent respectively. The values are cleared following a master reset.
ErrorsThis record holds counters for different error situations. The name of each counter indicates the type of error. The counters are cleared following a master reset.
LineStateThis field holds the actual state of the Ethernet connection. Bit15 indicates, whether the link signal is present (True) or not (False). The information is automatically updated once pr. second. This field was introduced in version 2.0.
RegNo. 3: SpecialFeaturesThis variable is a record having the following structure:
SpecialFeatures is used to define special functions for the communication channel. The Reserved parameter may not be changed.
Flags
SpecialFeatures.Flags
Following a Master reset, the device will act as if all flags were false.
Bit 0 If No write access is True, it means that no P-NET write requests are legal on this port. Any P-NET request holding one of the instructions STORE, AND, OR, TAS or LONGSTORE will result in a "Write protection" response. This goes for all requests, whether they are requests for this device, or gateway requests. Bit 1 If No access is True, it means that no P-NET requests are legal on this port. In other words, this port only works as a P-NET master. Any P-NET slave request will result in a "Write protection" response. This goes for all requests, whether they are requests for this device, or gateway requests. Bit 2 Not used Bit 3 Not used Bit 4
This flag was introduced in version 1.14. Bit 5 Not used Bit 6 Not used Bit 7 Not used
WLAN_UpdateIntervalDevices connected to a Wireless LAN might have to send out their MAC address in an Arp packet on a periodic basis, to keep the radio modules updated with the actual network configuration. This can be achieved by inserting a non-zero value in this variable. The value defines the time interval in seconds between transmissions of Arp packets. MaxResponseTimeThe value of this variable defines for how many seconds this device should wait for a response after sending a request. If no response is received within the specified time, the P-NET error “TIME OUT” is generated (or the request is retransmitted if Retries > 0).
RegNo. 5: NodeParamThis variable is a record having the following structure:
PNETNoThe field PNETNo holds the P-NET node address of this device, seen from the Ethernet port. The P-NET Node Address is also the last byte of the IP Address. Each time the Node Address is changed, the value of IPAddr is also changed.
The value of the field PNETNo may also be changed via Service.PNETSerialNo, for example, by using the "Set P-NET Node Address" utility in VIGO. This will result in a netcast, where the first 3 bytes of the destination IP address is the subnet address, and the value of the last byte = 255. The P-NET packet holds the serial number of the device, and the new PNETNo. The value of PNETNo is transferred to the EEPROM, regardless of the state of Service.WriteEnable, as is the value of IPAddr. The first 3 bytes of IPAddr is set to the first 3 bytes of the destination IP address of the netcast UDP/IP packet. The last byte of IPAddr is set to the same value as PNETNo.
IPAddrThis field holds the IP Address of this node. The default value is 172.17.17.0, which is an illegal IP Address. At least the last byte should be changed. Changing the value of PNETNo will do this. As the last byte of the IP Address is the same as PNETNo, it is NOT possible to change this byte by writing to IPAddr. Refer to the description of PNETNo for information on how the value of IPAddr is typically changed.
RegNo. 6: IPNetTable
This variable holds a list of all the subnets that can be accessed from this node when it is acting as a master (client). A configuration tool is normally used to configure the table.
Refer to the general " UDP/IP Ethernet Communication Channel" description for an overview of the purpose of this table.
By default, all fields in this table hold $FFFF. A value of $FFFF or 0 in NoOfIPNets indicates, that the table has not been initialised by any configuration tool. In this situation, a default subnet with NetIndex = 1 is set up as an IPRange net, with the same subnet address as the subnet address of this node, and with UDP port number = 34378.
This means, that from PROCESS-PASCAL, all IP nodes on the same subnet can be accessed with NetIndex = 1, and NodeAddress = the P-NET node address of the node. It also means, that the gateway functionality of P-NET systems is fully supported by P-NET over IP, without any further configuration.
IPAddress The IPAddress field holds the IP subnet address, if the net is an IPRange net, or the complete IP address of the remote NAT router if, the net is a UDPRange net.
UDPPort The UDPPort field holds the UDP port number sent to all nodes, if the net is an IPRange net, or the start UDP port number, if the net is a UDPRange net.
Router The Router field holds the node address of the router through which requests to nodes on this subnet are to be sent. Routers are always located on the same subnet as this device. If the nodes on a subnet are accessed directly, the value of Router must be = 0.
IPNettype The IPNettype field defines the type of this subnet. The value of this field can be UnUsed, IPRange or UDPRange.
RegNo. 7: Retries
This register defines the maximum number of retries made in the event of a transmission error, before the error is reported. The defined maximum number of retries is for each 54 byte block in a LONG LOAD / STORE. Therefore, the value of Retries should be very low.
RegNo. 12: PasswordTable
ChecksumChecksum holds the value obtained by adding (on a word-by-word basis), all the following fields in this register (85 words). This facility has been introduced to enable a password configuration tool to check whether a new configuration was stored correctly. This is not possible by reading back the actual passwords, as these fields are “WriteOnly”.
ClientPasswordThis field holds the password used by this node when acting as a client, and sending a request to a server that requires a password. Whether a server requires a password or not, is defined in ServerTable.
NoOfPasswordsNoOfPasswords holds the actual number of passwords in the Passwords field. This field has been introduced to reduce the amount of time used for password checking in the operating system.
PasswordsThe Passwords field holds all the acceptable passwords that can be used when this node is acting as a server, and is accessed using the remote communication UDP Port number. A P-NET UDP packet to this UDP Port must hold a password. When a request is received, a search is made (by the operating system) through the Passwords. If a match is found between the password in the received packet and an element in the Passwords field, the request is accepted. If not, the request is ignored.
To prevent users with access to this device from reading the passwords of other users, this variable is “WriteOnly”. The Checksum field can be used to ensure, that the password configuration is correct.
RegNo. 14: ChTypeThis variable is a record having the following structure:
The ChType variable indicates what type of channel this is, how many channel registers are used, and what functions this channel offers.
ChType has the following values:
ChannelType = 17 (Ethernet Communication Channel)
Exist =
RegNo. 15: ChErrorThis variable is a record having the following structure:
ChError for Ethernet Communication channel
Bit 7 Device error. If this bit is set, the rest of the bits have no meaning because a device error can cause random error codes on the individual channels (see also "Service channel"). Bit 4 IP Address conflict. If this bit is set, two different MAC addresses have been detected for the same IP address. That means, two different nodes have the same IP address. Bit 0 Hardware initialisation error is generated when initialisation of the built-in Ethernet communication chip fails.
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||