Phaedrus NETIOM-UDP User manual

NETIOM-UDP
User Manual
About This Manual
This manual provides a detailed description of the operation and features of Netiom-UDP. It
assumes that the reader is familiar with network terminology and therefore does not give any
detailed descriptions of networks or their operation.
If you are not familiar with networking then it may help to read the “Network Terminology”
document.
PC based software is provided which provides a graphical interface to the programming
features of Netiom-UDP. This manual makes reference to this software in the explanations for
the set up procedure.
It is not necessary to read the whole manual before setting up Netiom-UDP as it is unlikely
that you will use all of its features. For small networks the Quick Start section should get you
up and running so that you can create a basic link.
If you encounter problems with the Quick Start then it likely that you have some sort of
problem with network addressing. If so refer to that section. The Introduction and Operation
section may also help with problem solving.
Details of how Netiom-UDP establishes and controls the link are in the Appendices. This
information is provided for those who are interested in the internal workings of the link and for
a better understanding of its operation. It is not necessary to read or understand to this level
of detail to use the product.
Introduction
Netiom-UDP is a network enabled Input / Output module. It is intended to work in conjuction
with a PC or other network enabled devices. UDP packets sent from the PC can control the
16 outputs and send data via the serial port. Netiom-UDP will send the status of all inputs and
outputs and if data is received on the serial port this will be sent in addition to the I/O status.
Netiom-UDP consists of:
16 Digital Inputs
16 Digital Outputs
1 Serial Port
1 Ethernet Port
Three LEDs are provided which show the status of the ethernet connection. A link is provided
to switch between active mode and programming mode.
Netiom-UDP will work on both local networks and wide area networks such as the Internet.
To run Netiom-UDP you will need:
A 12 Volt d.c. power supply.
A null modem serial lead (for programming).
An ethernet cable to connect to the network.

Operation
Netiom-UDP has 3 LEDs which indicate the status of the ethernet connection.
Green indicates that Netiom-UDP is connected to the network. When it is on it indicates that
the network connection is present but not necessarily that Netiom-UDP is communicating with
the network.
Amber is the receive indication. This is normally on and switches off when data is received. In
normal operation this will flicker off every few seconds as it detects normal network polling.
Red is the transmit indication. This will switch off when data is transmitted from Netiom-UDP.
It is normally on.
The programming link is used to switch Netiom-UDP between active mode and programming
mode.
In active mode Netiom-UDP will connect to the network and respond to ethernet messages. It
will not respond to any commands issued on the serial port.
In programming mode Netiom-UDP will not access the network but it will accept commands
from the serial port. When the link is removed all network connections will be reset.

Quick Start
1. Place the programming link in position.
2. Connect the network to Netiom-UDP with an ethernet cable.
3. Connect a 12 Volt d.c. power supply to the power terminals.
4. The LED’s should now be illuminated. The amber LED may flicker occasionally.
5. You may now want to verify the settings using the Netiom-UDP Interface software.
6. Install and run the Netiom-UDP Interface Software.
7. Select the PC comms port you will be using. This is on the General page.
8. Connect a null modem lead between the PC comms port and the Netiom-UDP serial port.
9. Press the “Read From NETIOM” button. You can now review the settings.
10. The next step will depend on your network settings. If you have a DHCP server (typically
an ADSL router) proceed from section “With DHCP Server” otherwise go the section “Without
DHCP Server”.
With DHCP Server
11. Ensure that the following boxes are checked on the Data page:
“Get Address Automatically”
“Enable Client”
“Use Broadcast Address”
If are not checked then check them and download to Netiom-UDP using the “Write To
NETIOM” button on the general page.
12. Remove the programming link. The red LED should now flicker once or twice.
13. Wait for about 5 seconds and replace the programming link.
14. Read the data back from Netiom-UDP as before.
15. The assigned IP address will now be displayed on the Server page. If this reads 0.0.0.0
then the DHCP process has failed and it will be necessary to set up the IP address manually.
Follow the “Without DHCP Server” section instructions.
16. Repeat the procedure for the second module.
Without DHCP Server
17. You will need to set up the addressing manually. Uncheck the “Get Address
Automatically” box on the Data page of the Netiom-UDP Interface software.
18. If there are a large number of devices on your network you will need to be assigned an IP
address from your network administrator. If there are only a few PCs you can determine their
address from a command prompt. Type in “ipconfig” and the settings will be returned. Make a
note of each one and choose an address close to the ones returned changing only the fourth
number. For example if your network is using 192.168.0.2 and 192.168.0.5 try using
192.168.0.6.

19. Enter the obtained number into the IP address boxes. You should be safe using
192.168.0.1 for the gateway address and 255.255.255.0 for the Submask.
20. Download the new data to Netiom-UDP using the “Write To NETIOM” button on the
general page.
21 When the download is complete remove the programming link.
Interface Software
PC based software is provided to provide a graphical interface to programming Netiom-UDP.
On the opening page there are controls for loading and sending data and a logging area
which will show a log of activity as well as any problems encountered.
The Data page is used to set all the necessary parameters for the Netiom-UDP.
Data
Data can be written to Netiom-UDP or read from it via the serial port at 19200 baud. Note that
the programming link must be in place before communications can be established with
Netiom-UDP. The best way to use the program is to read data from Netiom-UDP, modify it
and then write it back.
At start up the program will load a set of defaults from the file “DefaultConfig.txt”. If you need
a different set of defaults you can overwrite this file with your own values. If you have several
different configurations then these can be saved as separate files.
Before sending data to Netiom-UDP the data is checked for any inconsistencies and will not
proceed if any are found. If problems are encountered a list is written to the logging window.
During the write operation to Netiom-UDP all data is read back and compared with the data
sent. If there are any problems then they will be reported in the log window.
Setting The Address
In order to function properly on a network Netiom-UDP needs know the following information:
IP Address
Gateway Address
Submask
Netiom-UDP is able to collect this information automatically if the network has a DHCP
server. However if these addresses are obtained automatically they will be dynamic and can
change with time. This may cause an interruption to the link, however it should be restored
automatically.
To obtain an address automatically check the “Get Address Automatically” box. After you
download the data to Netiom-UDP and remove the link Netiom-UDP will attempt to obtain the
relevant information.

To set up the addresses manually uncheck the” Get Address Automatically” box and enter the
addresses in the appropriate edit boxes. Each box must contain a number in the range 0 to
255. The default values are:
IP Address: 192.168.0.6
Gateway Address: 192.168.0.1
Submask: 255.255.255.0
These values should be OK for small networks with only one or two computers and a gateway
router.
If you need to change them you will need to ascertain the values from the network. For local
networks there are three address ranges:
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
The best way to find free addresses is to log on to the gateway router as this will keep track of
all the attached devices. It will also show its own IP address which should be used as the
Gateway Address.
You can find the settings on any local PC running Windows by going to the command prompt
and typing “config”. This will return the IP Address of the PC, the Gateway Address and the
Submask. If you only have one PC and gateway router then use the last two values for the
Gateway Address and Submask and increment the last digit of the IP Address by 1.
Port Number
The port number is used as part of the network interface. This can be set anywhere in the
range 1 to 65535. However values below 1024 should be avoided as these are generally pre-
allocated to well known services.
Connections
The connections section defines how the link is established and maintained.
In client mode the Netiom-UDP will periodically send out a network packet even if the link is
not established. Data will be transmitted whenever a change occurs on the inputs or when a
serial message is received. If there has been no change for a period defined by the Update
Period then a message will be transmitted as a heartbeat.
If client mode is not select messages are not transmitted until the link is established.
Messages will then be sent in the same way as in client mode.
When in client mode the Netiom-UDP will need to know the IP address to connect to the other
end of the link. Two methods are available. If Use Broadcast Address is selected Netiom-UDP
will transmit a broadcast to all devices on the network. The device at the other end will
recognise this message and return with a reply indicating its own IP address. The originating
device will then use this new IP address for further communication. Note that this method is
only suitable for local area networks as broadcasts are not allowed to transverse gateways.
The second method is to supply an IP address. In this case the originating Netiom-UDP will
establish contact directly with the other end. This method must be used for wide area
networks such as the internet.
Serial Port
With the programming link in place the serial port always runs at 19200 baud.

In active mode you can specify the baud rate so that Netiom-UDP can communicate with
external equipment. Netiom-UDP can support baud rates in the range 2400 to 38400 baud.
Netiom-UDP will store incoming serial data in a 64 byte working buffer until it deems that the
data string is complete. Once complete or the buffer is full the data is transmitted to the
remote Netiom-UDP.
You can specify either a carriage return/line feed pair (CR/LF) indicates that the data is
complete or use a timed methology i.e. no data for a fixed period. If the latter is chosen then
the timeout value can be specified in the range 20mS to 20 seconds.
Note that it is important that both ends of the link have the same baud rate as there is limited
buffering within the Netiom-UDPs and congestion could cause data loss.
Watchdog
The watchdog facility can be used to monitor link activity. If this facility is enabled then output
1 will be activated when the link is established. Note that this will then remove the functionality
of Input 1.
MAC Address
This field shows the MAC address of the Netiom-UDP. It is not possible to change this
number and is provided for information only.
Pings
Netiom-UDP will respond to network pings. To ping Netiom-UDP from a PC use the command
line ping followed by its IP address. For example:
ping 192.168.0.6

Hardware
Connections
The digital inputs and outputs are available via screw terminals or 10 way headers. The
headers also have power pins so that auxiliary modules can be powered directly from Netiom-
UDP. Each of the headers has the same pin assignment regardless of whether they are
inputs or outputs. The following diagram shows the pin arrangement:
Digital Inputs
Each digital input is connected to a CMOS gate via a 100K resistor. It is pulled up to the
internal 5 Volt supply rail via a 10K resistor.
The input can be directly interfaced to TTL and CMOS outputs. The input voltage should not
exceed 5 Volts. In addition the inputs can use clean contacts referenced to 0 Volts or open
collector outputs again referenced to 0 Volts.
If the driving modules do not share the same power supply as Netiom-UDP then it will be
necessary to common their 0 Volt lines.
The inputs are scanned with a timebase of 100mS. Thus the input signal must be present for
200mS in order to guarantee Netiom-UDP seeing it.
With the input high or open circuit Netiom-UDP will report it as a “1”, otherwise it will be
reported as a “0”.

Outputs
Outputs are open collector and can be used to drive relays solenoid LEDs etc. Optional LED
and relay modules are available which plug directly into the 10 way header.
Note that if these outputs are to drive inductive loads such as relays and motors then the load
must have some form of back EMF suppression fitted. IF SUPPRESSION IS NOT FITTED
THEN THE OUTPUT DEVICE WILL BE DAMAGED. The following diagram shows how to
interface the VIOM output to a relay.

Analogue Inputs
Analogue inputs are not used with Netiom-UDP.
Hardware Accessories
Display Module
The display module consists of 8 LEDs which can be connected directly on to the Netiom-
UDP controller. Connection is via a ribbon cable to the output header. If all 16 outputs are to
be displayed then two VIOM Display modules will be required.
Relay Module
The Relay module consists of 8 single pole change over relays which can be connected
directly on to the Netiom-UDP controller. Connection is via a ribbon cable to the output
header. If all 16 outputs are to be used then two Relay modules will be required.

Using Netiom-UDP on the Internet
Netiom-UDP can work on wide area networks such as the Internet as well as local networks.
Dial up networks using modems are not suitable for accessing Netiom-UDP.
The local network will be connected to the Internet via a gateway. This may be a computer or
an ADSL router or some similar device. The gateway will have two IP addresses, one which it
will present to the local network and one which it will present to the Internet. The Internet IP
address will be supplied by your ISP.
If you are connecting to Netiom-UDP via the Internet then you will need to use the Internet IP
address. You will also need to tell the gateway to route incoming traffic to Netiom-UDP. This
is called “Port Forwarding”. Thus you will need to set the gateway “Port Forwarding” to the
same port as you have defined the Port Number parameter to the Netiom-UDP IP address.
Then any port requests the gateway receives from the Internet will be forwarded to Netiom-
UDP.
Troubleshooting
Problem: No LEDs are illuminated
Solution: This is likely to be a power problem. Check that power is connected and that it is the
correct polarity.
Problem: The green LED is off but the red and yellow are on.
Solution: This is an ethernet connection problem. Make sure that the ethernet cable is firmly
in position at both ends. Is the router or hub is switch on?
Is the cable good and is it the correct type? There are two types of ethernet cables, straight
through and cross over. If you are connecting into a hub or router you should use a straight
through type. If you are connecting directly to a PC you will need to use a cross over type.
Problem: Netiom-UDP will work fine on a local network but it will not work over the internet.
Solution: Make sure that you have not set the client addressing to Use Broadcast Address at
either end of the link.
Make sure that you have set port forwarding on both gateways to the correct port and IP
address.
Some gateways will remember old IP addresses and their associated MAC addresses. Thus
the gateway may be forwarding packets using an incorrect MAC address. Try resetting the
gateway or changing the IP address of the Netiom-UDP to another address.
Phaedrus Limited
Unit 1
Darwen Enterprise Centre
Railway Road
Darwen
BB3 3EH
U.K.
Tel / Fax +44 (0)1254 772622
e-mail [email protected]
Issue 1
March 2005

Appendix 1
Link Initiation
1. Client Mode with Fixed IP Address
At start up an ARP (Address Resolution Protocol) request is issued. If the request is resolved
Netiom-UDP will know the MAC address of the target device and will know that it is present
on the network. A network packet will then be transmitted with the current status of the inputs.
This should then result in the return of a packet from the target end thus establishing the link.
If the ARP request is not resolved then Netiom-UDP will wait for the Timeout period and then
re-issue the request. This will continue until a response is returned.
If there is a break in the receipt of packets from the remote end of the link for the Timeout
period then the link is reset and a new ARP request is issued. Again this is repeated until the
link is re-established.
2. Client Mode with Broadcast IP Address
At start up a network packet is transmitted with the current input status. The IP address will be
255.255.255.255 and the MAC address will be 0xFFFFFFFF both defined as broadcast
values. The target will recognise that this is a packet from a Netiom-UDP and will respond
using the originating IP and MAC addresses as their target addresses. The originating device
will receive the packet, recognise that it a Netiom-UDP package and will now deduce the IP
and MAC addresses of the remote end. The next packet transmitted by the originating end
will use this new information thus establishing the link.
3. Non-Client Mode
At start up the Netiom-UDP will listen for packets on the assigned Port Number. It will not
transmit and data at this time. When a packet is received it is inspected to determine if it is a
Netiom-UDP packet. If it is then it will respond to the packet with the current status of its
inputs using the originating IP and MAC addresses as the target address thus establishing the
link.
If there is a break in the receipt of packets from the remote end of the link for the Timeout
period then the Netiom-UDP will stop transmitting and revert to listening mode again.

Appendix 2
Data Transmission
Netiom-UDP uses UDP (User Datagram Protocol) packets to transmit information across the
network. This is a simpler but faster protocol than TCP and more suited to this type of link.
While there is no change in input conditions and no serial port activity a packet is sent at the
end of the user defined update period. The packet is marked as non-urgent so that the remote
end knows that this is a regular update packet and does not need to respond until its own
update period expires. This heartbeat message ensures that the remote end knows that the
link is still in place and that if packets are lost then outputs are still synchronised.
If there is a change of input conditions or a serial port message is received then Netiom-UDP
will immediately transmit a message irrespective of the state of the update period. This
message will be marked as urgent and assigned a message number. On receiving this
message the remote end will acknowledge the packet. The originating end will wait for this
acknowledgement and if it is not received within a fixed period will re-issue it. The re-issues
will continue until either an acknowledgement is received or a new message is generated by
another input change / serial message receipt or until the update period expires.
Each packet is divided into 4 sections. The first section identifies the message as originating
from a Netiom-UDP device. The second section is used for control, marking as urgent / non-
urgent etc. The third section defines the current state of the I/O and is always transmitted.
The final section is only present if there is a serial port message and contains the data
received.

Appendix 3
Serial Port Data
It is not practicable for data to be sent over the network one character at a time. Therefore
Netiom-UDP packages the data for onward transmission.
As each character is received from the serial port it is placed into a 64 byte buffer. When a
packet is complete with either a carriage return / line feed pair or a break of transmission as
defined by the user it is packed into a UDP packet and transmitted.
If the package size reaches the buffer limit again it is packaged up and sent to the remote
end.
Inherent in this process is a transmission latency. Transmission at the remote end will not
commence until reception at the local end is complete (or the buffer is full). Systems using the
serial port must take this latency into account especially if retries and timeouts are employed.
Problems may also be encountered if large amounts of data is to be transmitted. Netiom-UDP
uses a strategy of acknowledgements and retries to minimise the effect of lost data packets.
However Netiom-UDP has limited storage for holding data for retransmission and if an
acknowledgement has not been received before another packet is ready for transmission the
new packet will be transmitted and the previous pack discarded. Normally this will not cause
problems as the data loss is relatively rare but critical data should be checked within the
receiving application.

Appendix 4
Data Format To Netiom-UDP
The basic format of the message without a serial output string is:
[Identifier][Message Type][Message Number][Output Data]
where:
Identifier is fixed and must be NetiomUDP . This is to prevent other network devices using the
same port number causing data to be written to the outputs inadvertantly.
Message Type is a single character and may be:
‘A’ indicates that the data is a regular update to which Netiom-UDP will not send an
acknowledgement. Normally this type of message is used as a heartbeat to indicate that the
link is still established. If the data has changed then Netiom-UDP will still update the outputs.
‘U’ indicates that new data is present and that an acknowledgement is requested. In this case
Netiom-UDP will reply with the current status on inputs and outputs.
‘C’ indicates that the message was generated in response to a ‘U’ type message.
‘R’ indicates that the message is a resend because a previous ‘U’ type message has not been
acknowlaged.
Message Number is a single binary byte and is used to ensure that type ‘R’ messages do not
send multiple strings over the serial port. Normally this value is incremented (and allowed to
roll over) for each non ‘R’ type message. If a type ‘R’ message is sent it should use the
Message Number of the previous message. Note that a value of zero should be avoided for
the message number.
Output Data is a 16 character string which represents the state of the outputs. Output 1 is the
first character of the string while output 16 is the last. A ‘1’ indicates that the output is on, a ‘0’
indicates that the output is off and a ‘*’ indicates that the output should remain unchanged.
Example:
NetiomUNPA~1100************
Will turn outputs 1 and 2 on. outputs 3 and 4 off and leave all others unchanged. No response
will be returned from Netiom-UDP.
The basic format of the message with a serial output string is:
[Identifier][Message Type][Message Number][Output Data][Serial Identifier][Number of
Characters][Data]
where
Serial Identifier is the character ‘S’ and indicates that the message contains serial data.
Number of Characters is a single binary character with the number of characters to be sent
via the serial port
Data is the serial string to be sent. This can be in any format.

Appendix 5
Data Format From Netiom-UDP
The basic format of the message without a serial output string is:
[Identifier][Message Type][Message Number][Digital Input Data][Output Data][Analogue Data]
where:
Identifier is fixed and is always NetiomUDP .
Message Type is a single character and may be:
‘A’ indicates that the data is a regular update to which Netiom-UDP will not expect an
acknowledgement. Normally this type of message is used as a heartbeat to indicate that the
link is still established.
‘U’ indicates that new data is present and that an acknowledgement is requested.
‘C’ indicates that the message was generated in response to a ‘U’ type message.
‘R’ indicates that the message is a resend because a previous ‘U’ type message has not been
acknowledged.
Message Number is a single binary byte and is used to ensure that type ‘R’ messages do not
send multiple strings over the serial port. Normally this value is incremented (and allowed to
roll over) for each non ‘R’ type message. When a type ‘R’ message is sent it uses the
Message Number of the previous message. Note that a value of zero is never sent.
Digital Input Data is a 16 character string consisting of ‘1’s and ‘0’s followed by a comma
representing the states of the inputs.
Output Data is a 16 character string consisting of ‘1’s and ‘0’s followed by a comma
representing the states of the outputs.
Analogue Data is a 4 field comma delimited string. Each of the fields is an ASCII number up
to 4 characters representing the value on an Analogue Input. Input 1 is reported first.
Example:
NetiomUDPA~1100110011001100,1111000011110000,123,456,99,1024
The basic format of the message with a serial output string is:
[Identifier][Message Type][Message Number][Digital Input Data][Output Data][Analogue Data]
[Serial Identifier][Number of Characters][Data]
where
Serial Identifier is the character ‘S’ and indicates that the message contains serial data.
Number of Characters is a single binary character with the number of characters received via
the serial port
Data is the serial string to be sent. This can be in any format.
Table of contents