Io Controller2 Manual
Io Controller2 Manual
I/O Controller 2
MANUAL
www.HW-group.com 1/ 42
I/O Controller 2 Manual HW group
Safety information
The device complies with regulations and industrial standards in force in the Czech Republic and the
European Union. The device has been tested and is supplied in working order. To keep the device in
this condition, it is necessary to adhere to the following safety and maintenance instructions.
The device must not be used in particular under any of the following conditions:
The manufacturer warrants the device only if it is powered by the supplied power adapter or an
approved power supply.
www.HW-group.com 2/ 42
I/O Controller 2 Manual HW group
I/O Controller 2
Ethernet – RS-232/485 + inputs and outputs
I/O Controller 2 is an Ethernet-enabled device with 8 digital inputs,
8 digital outputs and a RS-232/485 serial interface.
Basic features
• The remote port can be controlled with a virtual driver for Windows just like, for example,
COM 5 (a Windows XP / Vista / Windows 7 / Server 2003 / Server 2008 / x64 driver is
available free of charge). Compatible with RFC2217.
• SDK (Software Development Kit) is available for the device with examples for MS Visual
Basic, Delphi, Borland C++, JAVA, PHP and more
www.HW-group.com 3/ 42
I/O Controller 2 Manual HW group
Technical specifications
RS-232 serial port
+ Data bits 7 or 8 or 9
+ Stop bits, parity 1 or 2, None / Odd / Even / Mark / Space parity
+ Baudrates 50..115.2 kBd – entire range
+ Data flow control XON/XOFF, CTS/RTS, None
+ Interface 1x DB9M (RxD, TxD, CTS, RTS, DSR, DTR, RI, CD, GND)
+ Implemented RS-232 signals RxD, TxD, CTS, RTS, DSR, DTR, RI, CD
Ethernet port
+ Interface RJ45 100BASE-T / 100 Mbit/s
+ Compatibility Ethernet: Version 2.0/IEEE 802.3
+ Supported protocols IP: ARP, TCP + NVT (Network Virtual Terminal)
+ TCP connection closing Data – 5s timeout (with NVT – ACK/NOP support)
www.HW-group.com 4/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 5/ 42
I/O Controller 2 Manual HW group
Connectors
Connector pinout
RS-232 Port
Pin Signal
1 <- CD
2 <- RxD
Power LINK 3 -> TxD
4 -> DTR
5 -- GND
RS-485 Port
6 <- DSR
Pin Signal 7 -> RTS
8 <- CTS
A + (A>B) 9 <- RI
B - Cannon 9 - Male
www.HW-group.com 6/ 42
I/O Controller 2 Manual HW group
LEDs:
www.HW-group.com 7/ 42
I/O Controller 2 Manual HW group
1 20
PIN Description
GND Ground 1
OUT0 Output transistor 0 2
OUT1 Output transistor 1 3
OUT2 Output transistor 2 4
8x INPUTS
www.HW-group.com 8/ 42
I/O Controller 2 Manual HW group
Quick SETUP
www.HW-group.com 9/ 42
I/O Controller 2 Manual HW group
Default login:
▪ admin
▪ 1234
www.HW-group.com 10/ 42
I/O Controller 2 Manual HW group
• Change to the “TCP Client” tab and enter the configured IP address. Set the TCP Port to 99.
• Click “Connect”. The listing on the left displays the “WEB51>” prompt. Click inside this pane
and press ENTER. The window displays the current configuration.
• To set a parameter, enter the
corresponding letter and the desired
value (for example “I192.168.6.8” to
set the device IP address). To show
the help for a command, enter the
command and a question mark, and
press ENTER – for example, “I?
<Enter>“. All the settings are
described in detail later in this
manual.
• After setting the parameters, use R
for Reboot and press “Disconnect”
to disconnect from the device. The
device restarts.
www.HW-group.com 11/ 42
I/O Controller 2 Manual HW group
• Set DIP1 = OFF, DIP2 = OFF, connect the test board to the connector and turn on the
device.
• Change to the “UDP Setup” tab, find the devices, and make sure that the “Enable TCP setup”
and “Enable NVT” options in the lower left-hand portion next to the MAC list are checked for
the respective device . If not, check both options and save your settings to the device.
• Double-click the IP address in the “UDP Setup” tab and change to the “Test mode” tab. The
double-click action should transfer the IP address and port to the Test tab. If this does not
happen, enter the values manually.
• Click “Connect”. The listing at the
left-hand side displays Connecting,
followed by one or three NVT
commands in the received data. All
recognized commands are
displayed in blue.
The image shows the listing and the
configuration options of the
Hercules utility. To invoke the
menu, right-click inside the
receiving pane or the transmitting
pane.
• At this point, click “Read” in the
lower right-hand corner to read the
inputs (8 switches at the test
board). Input states are indicated by
the virtual LEDs D0 to D7,
respectively. States can be inverted
with the “LED polarity” option.
• The D0 – D7 checkboxes set the corresponding outputs. The first command sets all outputs to
defined states, subsequent commands set individual bits. Outputs can be again inverted using
the “Inversed” option.
The “Write together” option does not send commands immediately when an output is selected;
instead, outputs are set after clicking “Write”.
• When “Show I/O commands” is enabled, notice the I/O Controller control sequences in the
incoming and outgoing panels. This makes it easy to test the commands.
• Enter “FF F6” to the Send lines at the bottom, check HEX and click the corresponding Send
button to send this command. The receiving pane should show “<WEB51 HW 4.7 SW 2.J SN
00A608 #01>” or something similar. You have just sent your first NVT command requesting
“Are You There” identification, and the I/O Controller replied with its HW and SW version. The
SN number consists of the last three bytes of the MAC address.
• If the TCP connection is closed while working (red message “Connection refused by
remote host”), click “Connect” to reconnect. The module uses a rather short timeout (50 s)
for manual control.
www.HW-group.com 12/ 42
I/O Controller 2 Manual HW group
• Digital inputs and outputs cannot be controlled. RS-232 data work fine.
Most likely, “NVT” is disabled. Check this at the “UDP Setup” tab in the Hercules utility, in the TCP
Setup, or in the RS-232 Setup.
• 5-second timeout is too short to work with, is it possible to do something about it?
Yes, enable “Keep connection” in the Setup. I/O Controller then sends a command every 6
seconds that appears as “NVT: NOP” in the receiving pane, and the connection does not timeout.
www.HW-group.com 13/ 42
I/O Controller 2 Manual HW group
• The driver works in Windows XP, Vista, Windows 7, Windows 2003 Server, Windows 2008
Server, including 64-bit versions.
• If the device supports RFC 2217 (NVT), you can set the remote serial port parameters (speed,
parity, stop bits).
• The communication can be recorded to a LOG file for easier debugging.
• It is possible to create multiple virtual serial ports on a single computer (COM5, COM6,
COM7) by starting VSP.EXE from the command line with appropriate parameters.
• Select the I/O Controller sub-tab in the “Binary I/O” tab. Here
you can set and read digital inputs and outputs without additional software.
www.HW-group.com 14/ 42
I/O Controller 2 Manual HW group
HW VSP settings
NVT pane
Enables RFC2217 and detection of our remote ports. Remember
to activate NVT support on the remote device as well.
• NVT filter – Filters out NVT control characters from the data flow.
• NVT port setup – Configures the remote port parameters via control
commands to match the VSP in your PC. For example, if your
terminal program (e.g. Hyperterminal) changes the baudrate to 19200
Bd and this box is checked, the VSP driver sends a NVT command
(according to the RFC 2217 standard) to change the baudrate of the
remote TCP/IP serial port.
• Keep Connection – Keeps the TCP/IP connection open even after
50 seconds of inactivity.
www.HW-group.com 15/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 16/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 17/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 18/ 42
I/O Controller 2 Manual HW group
I: Address 192.168.6.15
MASK, IP address and Gateway functions:
Configures the IP address of the converter.
An Ethernet device communicates:
J: Port 23
Configures the converter's communication port – • Within a local Ethernet network
from 1 to 65535. No Gateway used or needed. However, IP
addresses of both sides must be within the
Port 99 is reserved for TCP Setup, if supported by configured mask. For example, a mask of
the particular model and enabled in the setup. 255.255.255.0 means that the IP
addresses can only differ in the last byte.
M: Mask 255.255.255.0
• Outside of the local network – through
IP network mask applicable in the local network.
the Gateway, which itself must have an IP
Communication with all devices outside of the local
address within the range delimited by the
network (as determined by the IP address and
mask.
network mask) is directed through the gateway.
N: Mask 0.0.0.0
This mask restricts addresses that are allowed to communicate with the device. Security can be
enhanced by setting a fixed address or a suitable restrictive mask that disallows communication with
unauthorized parties.
www.HW-group.com 19/ 42
I/O Controller 2 Manual HW group
The timeout can be fine-tuned by specifying a value from 10 to On the other hand, a long
255 according to this formula: timeout means a long period of
n <16 .. n * 0.2 s inaccessibility through other
n < 32 .. (n- 15)* 0.8 s + 3.0 s sockets (disconnected cable,
n < 64 .. (n- 31)* 3.2 s + 15.8 s TCP setup).
n <128 .. (n- 63)*12.8 s + 118.2 s
n <256 .. (n-127)*51.2 s + 937.4 s
www.HW-group.com 20/ 42
I/O Controller 2 Manual HW group
T: IP mode TCP
Switches between the TCP and UDP protocols. UDP communication is faster but prone to lost packets or
out-of-order delivery; therefore, it is only suitable for communication on a local network segment in a
request-response mode, usually to convert RS485 communication.
The “broadcast Rcv” parameter allows receiving broadcasts.
UDP/IP mode does NOT support
- NVT commands
0: TCP
- TEA authentication
1: UDP with broadcast Rcv Off
Challenge-response protocols can
2: UDP with broadcast Rcv On respond up to 40% faster.
V: NetworkVirtualTerminal Off
Network Virtual Terminal enables interpretation of Telnet sequences, including certain RFC2217
extensions that enable on-the-fly changes of serial port parameters (speed, parity, etc.). NVT
description can be found at our website: >> “Support & download” >> “NVT (Network Virtual
Terminal) protocol description”.
When communicating with the serial port using telnet, e.g. with the TeraTerm program or the
Hercules utility, NVT should be enabled. If you don't want to use this option, set your client to “RAW”
communication mode.
0: Off (do not use telnet control codes, pass through to serial port)
1: On (accept telnet control codes)
Note: With NVT off, it is not possible to control the digital inputs and outputs, and the SETUP
does not even show the corresponding settings.
www.HW-group.com 21/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 22/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 23/ 42
I/O Controller 2 Manual HW group
The timeout is specified as the number of characters, and displayed as the number of chars as well
as the time based on the current serial communication speed. If the speed changes, the time is
recalculated but the number of characters defining the timeout stays the same (10 characters means
about 11 ms at 9600 Bd, or 5.7 ms at 19200 Bd).
www.HW-group.com 24/ 42
I/O Controller 2 Manual HW group
Digital inputs and outputs are controlled over the Network Virtual Terminal. This means that the I/O
control commands are embedded into the TCP/IP data stream, along the serial port data. However,
these commands only appear in the Ethernet communication, they never pass through to the serial
port.
In recent firmware versions, digital inputs and outputs can be controlled from the serial port or over
an UDP connection (see #E and #V).
NVT commands are always prefixed with a control character and have a predefined binary format.
A detailed description of the NVT protocol with examples of commands is available at our website (in
the “Support & Download” section).
Note: Remember to set the desired initial value of outputs after reset.
www.HW-group.com 25/ 42
I/O Controller 2 Manual HW group
Examples:
• #T = 0 (0x00) – I/O Controller does not react to any changes at digital inputs I0 through I8.
• #T = 240 (0xF0) – I/O Controller only reacts to changes at digital inputs I7, I6, I5, I4. Changes
at inputs I3 to I0 are ignored. However, their changed values are always transmitted together
with any reaction to a change at I7..I4.
• #T = 255 (0xFF) – I/O Controller reacts to any change at any digital input I0 through I8.
Transmission means that whenever the I/O Controller is in the Client/Server mode (“Active mode”), it
reacts to changes at its inputs just as it reacts to incoming data from the serial port = if the connection
is closed, the I/O Controller establishes a connection with the specified remote side and sends the
appropriate NVT command to set the remote outputs.
If the TCP Server mode (“Passive mode”) is used and the connection is closed, nothing happens. If
the connection is open, data are send through the open connection.
Note: Even if the input states are not transmitted to the remote side, they can still be read
using the standard NVT commands for reading inputs.
I/O Controller distinguishes three types of synchronization when using two devices back-to-back.
Their parameters are usually configured in a similar way:
• Power Up init – (#B, #C, #D parameters) – After reset, I/O Controller sets the output to the
value specified in #A and attempts to contact the remote IP defined with S=x.x.x.x. When
successful, it requests the state of the remote device's inputs and sets its own inputs
according to the following formula.
• Data change – (#X, #Y, #Z, #W parameters) – Upon every change at the inputs (as restricted
with #T), I/O Controller informs the remote device. The remote device receives the value and
uses the second formula to set its outputs.
• Keep I/O – (#K, #L, #M, #N parameters) – I/O Controller periodically sends the state of its
inputs to the remote side.
www.HW-group.com 26/ 42
I/O Controller 2 Manual HW group
Examples:
• #D = 0 (0x00) – Values are transferred without changes. Logic HIGH at an input results in a
logic HIGH at the respective output.
• #D = 1 (0x01) – The D0 output bit is inverted with respect to the D0 input bit. Values at D1
through D7 are transferred without changes. Logic HIGH at an input results in a logic HIGH at
the respective output.
• #D = 255 (0xFF) – All output bits are inverted with respect to the respective input bits.
www.HW-group.com 27/ 42
I/O Controller 2 Manual HW group
Note: The previous formula is only used when two I/O Controllers are connected to each
other back-to-back. Inputs at one device are automatically mirrored at the outputs of
the other device. This is called the Box-2-Box mode.
Standard NVT commands can be used to access all the 8 output bits either directly,
without respect to the #B to #Z parameters, or using the defined masks.
However, in the common Box-2-Box mode, it is not possible to access the output
states from a PC because the I/O Controller supports only one TCP connection at a
time. As long as a TCP connection to the other I/O Controller is established, the I/O
Controller cannot be accessed from a PC.
Note: Be careful when controlling the outputs over NVT and using the Box-2-Box mode at the
same time. #X and #Y can define which bits can be set only over NVT and which bits will
be synchronized with the remote inputs.
Example: #Y= 0x00, #X=0xFF – The output is not affected by the remote side at all, all
output bits can be controlled over NVT.
#Z: OR mask 0
Defines the output bits that will be affected by automatic synchronization – see #C.
www.HW-group.com 28/ 42
I/O Controller 2 Manual HW group
Keep I/O – (#K, #L, #M, #N parameters) – I/O Controller periodically sends the states of its
inputs to the remote side.
#K#L#M#N commands correspond to #X#Y#Z#W and define the behavior when two I/O Controllers
are connected back-to-back and configured to periodically transmit port states. #X#Y#Z#W
commands define the behavior of the two I/O Controllers whenever the port states change (more
precisely, whenever the bits determined by #T change).
Setup examples
Using the described parameters, each bit can be independently configured either to keep a fixed
value, to synchronize itself with changes at an input, or to invert its state with respect to the state of
an input. Study the following examples:
Output = (X.n =0 Y.n =0 Z.n =0) – output at logic LOW, configurable only with NVT commands
Output = (Z.n =1) – output at logic HIGH, configurable only with NVT commands
Output = (X.n=0 Y.n=1 Z.n=0 W.n=0) – output is an exact copy of the remote input
Output = (X.n=0 Y.n=1 Z.n=0 W.n=1) – output is an inverted copy of the remote input
Note: In normal operation, the inputs are sampled every millisecond and a change is
registered whenever the input value differs from the last transmitted value in two
consecutive samples (= the change lasts at least 1.2 to 2.0 ms).
www.HW-group.com 29/ 42
I/O Controller 2 Manual HW group
• WEB
• TCP Telnet (NVT commands)
• RS-232 (NVT commands sent to the serial port – #V)
• UDP (NVT commands via UDP to the specified port – #U)
• Modbus/TCP
www.HW-group.com 30/ 42
I/O Controller 2 Manual HW group
System
www.HW-group.com 31/ 42
I/O Controller 2 Manual HW group
R: Reboot
Software restart. Necessary e.g. when the IP address is changed. Recommended after changing
parameters in TCP Setup.
Change Password
Applies only to WWW access. The default password is 1234.
www.HW-group.com 32/ 42
I/O Controller 2 Manual HW group
www.HW-group.com 33/ 42
I/O Controller 2 Manual HW group
*S: Start Trigger Pattern 58.0.0.0 (4B input data AND *M) = *S
Start trigger condition for packet transmission. Four bytes
are set; however, only the number of bytes specified in “L: Trigger Length” is considered.
www.HW-group.com 34/ 42
I/O Controller 2 Manual HW group
Security
===== Security Setup ====== 0: TEA authentication Off
%A: TCP autorisation Off 1: TEA authentication On
Activates TEA authentication (one-time exchange and
password verification to allow the TCP connection to be established) – requested from the remote
side after the connection is established.
WEB51=2.L=00:0A:59:00:A6:08;I192.168.1.24;J23;M255.255.255.0;G192.168.1.1;W0.0.0.0;N0.0
.0.0;X0.0;Y0.0;S192.168.6.51;U4023;T0;V0;K1;A250;&B9600;&D8;&P1;&S1;&C1;&R0;&T0;&G0;&H0
;%A0;%K01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F:10;%S1;#T3;#A3;#B192;#C3;#D0;#X0;#Y
0;#Z3;#W0;*L1;*P0;*S58.0.0.0;*M255.0.0.0;*X10.0.0.0;*Y255.0.0.0;*E999
www.HW-group.com 35/ 42
I/O Controller 2 Manual HW group
Outputs can be controlled either by entering a decimal value 0–255 corresponding to the output
states, or by toggling the switches at the WWW page.
www.HW-group.com 36/ 42
I/O Controller 2 Manual HW group
Firmware upgrade
Upgrades the current device firmware. This operation may change some settings.
www.HW-group.com 37/ 42
I/O Controller 2 Manual HW group
Default settings
*** HW-group.com HW 6.0 SW 3.1.u #01 ***
*** PortBox I/O ***
www.HW-group.com 38/ 42
I/O Controller 2 Manual HW group
WEB51> WEB51>
www.HW-group.com 39/ 42
I/O Controller 2 Manual HW group
• To permit communication with only one address, set N:255.255.255.255 and W:IP address of
the remote device.
• To use 9-bit communication, enable &V1 = &V: Variable Parity On at both devices.
• To enhance security, disable TCP Setup at port 99 with %S0 = %S: TCP/IP setup Off at both
devices.
If security is an essential requirement and the device should only communicate within the local
network, use the following settings. In this case, only communication within the LAN segment is
allowed (0 to 255 at the end of the IP address).
I: Address 192.168.1.2
I: Address 192.168.1.1 M: Mask 255.255.255.0
M: Mask 255.255.255.0 ===== In IP access filter ======
===== In IP access filter ====== W: Address 192.168.1.0
W: Address 192.168.1.0 N: Mask 255.255.255.0
N: Mask 255.255.255.0 S: Send to IP 192.168.1.1
S: Send to IP 192.168.1.2
www.HW-group.com 40/ 42
I/O Controller 2 Manual HW group
http://www.hw-group.com/support/nvt/index_en.html
support NVT, the „FF” character always prefixes a control Values up to 100 Dec = Client >> Server
Values over 100 Dec = Server >> Client
sequence.
CAS_ request for the device to perform a command
ASC_ device response, command performed + confirmation
www.HW-group.com 41/ 42
I/O Controller 2 Manual HW group
• 0 (00 hex) – Request for input states, response includes input port state.
• 16 .. 23 (10 .. 17 hex) – Set the output bit 0..7 to logic HIGH.
• 32 .. 39 (20 .. 27 hex) – Set the output bit 0..7 to logic LOW.
• 48 (30 hex) – Request for output states, response includes output port state.
Sub option 51 (33 hex)
Sets the value of the output port. In the response, the same value is returned (as read from the
internal register).
The 52 (34 hex) command is often preceded by the “FF FA 2C 32 00 FF F0” sequence, which
requests a value for the I/O Controller outputs. The response includes the I/O Controller output state
(for example “FF FA 2C 33 FF FF F0”). After that, only the “FF FA 2C 34 ZZ FF F0” sequence is
sent, where ZZ is the new value for the remote outputs.
Note: To enable the input change notification function, it is necessary to set the range of
transmitted inputs with “#T: Trigger AND mask”.
www.HW-group.com 42/ 42
I/O Controller 2 Manual HW group
where DF is the actual output port value (also depends on the previous port state). I/O Controller
changes only one bit but the response contains the entire port value.
Note: The function works similarly to the incoming serial port data. Thus, in the TCP
Client/Server mode (IP address of the remote side is specified) with NVT
enabled, the device attempts to establish a connection and send the input
change information whenever a single byte of serial data is received or any
digital input changes. After establishing the TCP connection, only the current
input state is sent, NOT the whole history of changes (while the connection was
closed).
www.HW-group.com 43/ 42
I/O Controller 2 Manual HW group
The current port speed can be retrieved by sending the value of 00 00 00 00 (the response contains
the current speed). If any other value is sent, the server uses it to set the serial port speed. When
converted to a decimal value, the value directly indicates the communication speed in Bauds.
Outgoing sequence: FF FA 2C 01 00 00 00 00 FF F0
I/O Controller returns: FF FA 2C 65 00 00 25 80 FF F0
Keep Connection
To keep the connection alive and avoid the 50 second inactivity timeout, use the “K: Keep
connection” option in the device setup. NVT must be enabled for this to work. The connection is
kept alive by sending a NOP command (FF F1) from the I/O Controller approximately every 5s.
If port sampling is enabled with the #T: Trigger AND mask, the device sends the I/O keep command
(“FF FA 2C 37 ZZ FF F0”) instead of the NOP command (see #K, #L, #M, #N).
Outgoing sequence: FF F6
I/O Controller returns: <WEB51 HW XXX SW XXX SN XXX #0F *OvErr *ParErr *FlErr>
Individual XXX values are often proprietary, or can be left out in case of error messages. Sample
reply: <WEB51 HW 4.5 SW 2.3 SN 01A03B #01>
www.HW-group.com 44/ 42