A slide presentation with pictures is also available http://www.haxxio.com/udpser/slides
Topic | Description |
Replacing a Serial Cable |
One of the most straight-forward uses for the Redirector is the replacement of a simple serial cable.
Some of the drawbacks of RS232 cables are:
|
Wireless RS232 |
Wireless RS232 has been available for many years, but the existing systems suffer from a number of drawbacks
|
Groups of PCs and/or terminal Servers communicating |
There are three basic modes in which a group of PCs and/or terminal servers can communicate with each other
|
Replacing RS485 networks |
RS485 networking is the basis of almost all industrial networking, all SCADA and BMS applications.
RS485 networks work differently to the common RS232 cable.
A RS232 cable connects just two devices.
A RS485 network has a number (generally limited to 32) of devices all connected to a 2 wire (almost always a single twisted pair) bus. All devices can listen on this bus, and one device may transmit at one time.
Generally, one device will be the "master", and it will poll all the other devices, the "slaves".
This type of network is relatively easy to replace with a UDP network based system. In particular, as the application is based on a poll-and-reponse paradigm, with all data neatly packaged into error checked packets, a network based solution can be deployed that is as reliable as the traditional twisted pair.
It is also possible to augment a RS485 network to either allow expansion to non-RS485 devices, or to allow a remote computer using IP to connect to the RS485 network.
The lowest cost terminal server with both an RS485 port and is UDP capable that we are aware of is the Moxa DE-211. The Moxa range shares similar software, so any of the Moxa range should work happily with the Redirector.
The Terminal Servers and Redirerector(s) can be configured either as as one-to-many application, as described in Groups of PCs and/or terminal Servers communicating , or as a genuine many-to-many.
To configure a many-to-many network, all terminal servers and redirectors should be configured to transmit to the broadcast address. That way, any data transmitted by one device will be "heard" by all. This is the traditional mode for RS485 networks, as there is no physical addressing, only devices that know what btheir own addresses is, and can thus respond when spoken to. |
Interfacing to X10 over IP |
This is a specific version of Replacing a Serial Cable
X10 is a very low cost Home Automation control system, which uses signals super-imposed on the mains power, using the existing wiring, to monitor and control devices. The actual X10 signal itself is a series of data bits, encoded at 120KHz, sent synchronized to the zero crossings of the mains waveform, at a slow rate.
As the 120KHz mains synchronized signal isn't the easiest signal to generate, and because until recently the X10 signal was patented, the X10 corporation produce a number of interface devices to enable hardware devices and software systems to easily interface to X10.
There are two basic types of X10 interfaces, defined by the interface to the host computer.
The first is the TW523 and variants, which connects to the computer using TTL compatible interface standards, and which the computer has to conform to the timing requirements for X10. This type of interface is used by most of the micro-controller based systems, for example the JDS TimeCommander and Stargate, or the HomeVision system. You cant use a terminal server and the Redirector to remote these devices, as they do not have a serial interface.
The other sort of interface is the CM10 / CM11 / CM12 interfaces, which are controllers in their own right, which communicate with their host using RS232. This category of device an be remoted using a terminal server and the Redirector.
The lowest cost terminal server we are aware of which we have actually used is the SitePlayer telnet box which at the time of writing is $79 US. See the SitePlayer web site.
To remote a CM10 / CM11 / CM12, use the following configuration.
In the Services menu, for the UDP Serial Port setting, pick an unused UDP port, for example 990. In the Serial menu, configure the Baud Rate to 4800, and check Data Bits and Parity is 8 Bits, No Parity. Flow Control should be set to None. See the discussion below regarding what setting to use for UDP Remote IP. You may also wish to change the default settings in the IP Configuration menu, if you don't want a default DHCP arrangement, though the default DHCP arrangement will work just fine.
The setting for UDP Remote IP depends on how you have configured the computer that has the Redirector and X10 control software on it. The issue is that the Terminal Server needs either to "know" the address of the target PC, or you have to use broadcast mode. If the target PC has a fixed address (ie one not configured using DHCP) then configure that address into the terminal server "UDP Remote IP" setting. Otherwise (ie you are using DHCP for your target PC), configure in 255.255.255.255 as a broadcast address.
Next, on the target PC with the Redirector installed, configure the Redirector UDP port to be the same as you set in the Terminal Server (eg 990), tick the Bind To UDP Port Checkbox, and in the Transmitted Data pane, set the UDP Transmit Mode Selection to "Reply to last sender"
Set the Minimum packet send interval to 50 ms.
In the Serial Port pane, configure a Virtual Serial Port (VSP) to an appropriate value. What is an appropriate value? This depends on both your PC, and the software you wish to use. ActiveHome, for example, only permits choices of serial port COM1 to COM4, so you need to configure a VSP in that range. If the Redirector doesn't offer you a port in that range, you will need to disable a physical serial port using your computer's BIOS settings, so that the port name becomes free for the Redirector to generate a VSP on. If your software is more accommodating, then a port in the range COM9 to COM16 is recommended.
And that's all there is to it. This configuration has been tested with ActiveHome, and appears to work as well as when the CMxx device is physically connected to the computer.
A word of warning - do not try and share a CMxx device between several computers using the Redirector, there is no protocol level control over the data, and although it may well work most of the time, sometimes (as they say in Ghostbusters) the streams will cross and state information will get garbled. |