Cypress | Chameleon CTM-15X | PAD Operation for CTM-15X

CTM-15X PAD
OPERATION
Model
Revision
Chameleon CTM-15X
Modem
Revision 1.0
3066 Beta Avenue Burnaby, B.C. V5G 4K4
Phone: 604.294.4465
Fax: 604.294.4471
support@cypress.bc.ca
Revision Control
Revision Control
Description
Revision
Date
Customer Release
Revision 1.0
04-Dec-2009
1 Contents
Revision Control .............................................................................................................................................. 2
1
Contents .................................................................................................................................................. 2
2
CTM-15X PAD Operation......................................................................................................................... 3
2.1
3
4
5
Selecting the appropriate PAD settings .......................................................................................... 4
Commands for PAD operation ................................................................................................................ 4
3.1
Initiating a PAD connection from the modem ................................................................................ 6
3.2
Closing a PAD connection ............................................................................................................... 6
State Diagrams for PAD operation modes .............................................................................................. 7
4.1
PAD Server Modes (padmode 0/1) ................................................................................................. 8
4.2
PAD Client Single Session Modes (padmode 2/3)........................................................................... 9
4.3
PAD Client Persistent Mode (padmode 4/5)................................................................................... 9
Example Modem PAD Configuration .................................................................................................... 10
5.1
Modem PAD Configuration for a SCADA Field Device in Slave Mode .......................................... 10
5.2
Modem PAD Configuration for a SCADA Master Device Polling a Single Field Device in Slave
Mode 11
5.3
Modem PAD Configuration for a SCADA Master Device Polling Multiple Field Devices in Slave
Mode 12
5.4
6
Modem PAD Configuration for a Reporting Field Device ............................................................. 14
Technical Support/Warranty................................................................................................................. 15
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
2
CTM-15X PAD Operation
2 CTM-15X PAD Operation
Packet Assembly and Disassembly (PAD) is used for sending and receiving “raw” data over IP networks.
The modem takes care of establishing IP network connections, as well as the encapsulation of data within
UDP or TCP packets. This eliminates the need for a TCP/IP stack running on the host device. This
application note details how to setup a CTM-15x cellular wireless data modem in PAD mode in order
to provide a communications link between a serial port end device and a central control application.
A PAD connection uses the CDMA EVDO (Rev A) or the HSPA+ packet data network providing the
advantages of higher data rates for quicker response times, and always being connected. PAD mode
is typically used for supervisory control and data acquisition (SCADA) applications. PAD mode can be
used with master and slave devices that use proprietary communication protocols such as the Allen
Bradley DF1 or used to provide direct communications with field devices normally operated on a dialup modem connection.
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
3
Commands for PAD operation
2.1
Selecting the appropriate PAD settings
There are two main PAD modes: UDP PAD or TCP PAD.
UDP transport protocol is connectionless and does not guarantee data delivery. However, it is much
lighter than TCP in terms of data transmitted. It is considered suitable for the following applications:
When total data transfer must be kept to a minimum. Losing a packet is not critical, or the application
communication protocol itself provides for retransmissions.
TCP transport protocol is connection oriented and does guarantee data delivery. It will keep trying to
send a packet multiple times until its delivery is acknowledged. Because of these characteristics, it has
much more overhead compared to UDP. It is suitable for the following applications: When the total
amount of data transfer is not critical. Losing a packet is critical and the application communication
protocol itself does not perform retransmissions.
Both UDP PAD and TCP PAD can operate in either client or server mode. Client mode means that the
modem is required to establish a connection to a remote device in server mode (this may be through
another modem). Server mode means that the modem is continually listening on a port and will accept
connections from a remote server (this may be from another modem).
3 Commands for PAD operation
The default serial port baud rate is 115,200. If you need to change the serial port settings use the
following command:
cmd port n d p s f
where n is the required serial port baud rate
p is the parity setting: N, E, or O
d is the number of data bits: 7 or 8
s is the number of stop bits: 1 or 2
f is the flow control setting:
0 (no flow control) OR
1 (software flow control) OR
2 (hardware flow control)
You will now need to adjust the terminal application to these new settings.
cmd mode n
Use n = 2 if the host device connected to the modem’s serial port
will initiate the PAD connection using cmd pad. Use n = 4 if the
modem is required to initiate the PAD connection – after a power
cycle the modem will come up in PAD connected mode.
cmd padmode x
x = 0 start up UDP PAD mode. The modem will revert to server
mode once the connection is closed. (default)
x= 1 start up TCP PAD mode. The modem will revert to server
mode once the connection is closed.
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
4
Commands for PAD operation
x = 2 start up UDP PAD client mode - one session. The modem
will revert to command mode once the connection is closed.
x = 3 start up TCP PAD client mode - one session. The modem will
revert to command mode once the connection is closed.
x = 4 start up persistent UDP PAD client mode
x = 5 start up persistent TCP PAD client mode
cmd padip iii.iii.iii.iii
For server mode use 0.0.0.0 (this is the modem’s default). For
client mode use the IP address of the server modem, or if the
host device will initiate the connection keep this as 0.0.0.0
cmd padport xxxxx
For PAD mode 0 or 1 (server modes), xxxxx is equal to the
modem’s PAD listening port. For all other PAD modes (client
modes), xxxxx is equal to the port of the server modem. In PAD
mode 0 or 1, when used as a client the modem will transmit to
this port and then listen on this port when it reverts to server
mode.
cmd padfwdc x
This is the PAD forwarding character. It defines which Hex value
or ASCII character (in decimal) will initiate the encapsulation and
transmission process. The default is ASCII character 13 (carriage
return). If your protocol always ends a “sentence” with the same
terminating character then it can be set here. If no forwarding
character is required set this to x = 0. If x = 0, padfwdt or padfwdl
will invoke sending the packet.
cmd padfwdl x
This is the PAD forwarding length (default x = 40). It defines how
many characters will initiate the encapsulation and transmission
process. Generally this parameter is set to a value greater than
the longest “sentence” in your protocol. If no forwarding length
is required set this to maximum (1000). If x = 0 is specified then
every character is sent immediately.
cmd padfwdt x
This is the PAD forwarding time in 50 ms increments. It defines
the time after receiving the last character in a “sentence” that
the encapsulation and transmission process will be initiated. If
every character is required to be sent immediately then set n = 0.
cmd padecho x
If the connected device requires every character it sends to the
modem to be echoed back on the serial port then set n = 1.
Otherwise, set n = 0 to disable the echo feature.
cmd padsvct n [c]
The n parameter sets the server connect timeout in seconds
(default n = 15). The c parameter (optional) sets the maximum
PAD connection timer in seconds (default c = 0, disabled). If the
modem is configured using cmd padmode 0/1, it starts as a client
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
5
Commands for PAD operation
then after n seconds reverts to server mode in order to receive
incoming connections from another client. If the modem is
required to be always in client mode then use cmd padmode 4/5
while setting n = 0, c = 0 to disable the timers.
cmd save
Save the current settings to non-volatile memory. When cmd
mode 4 is saved, the modem will now always power up in auto
connect, PAD mode with the settings as configured above.
cmd pwrmode 2
Power cycling the modem will initiate the PAD connect for cmd
mode 4.
cmd padreset
Drop the current PAD connection and perform the following:
padmode 0/1: return to server mode
padmode 2/3: return to serial command console
padmode 4/5: establish new PAD connection
This command allows manual triggering of the equivalent actions
that occur on when one of the padsvct timers expire.
3.1
Initiating a PAD connection from the modem
If the modem has been configured in cmd mode 4 (auto connect to network and PAD host interface) then
after a power cycle no other action is required to initiate the connection.
If the modem has been configured in cmd mode 2 (auto connect to network) then it will be necessary to
initiate the PAD connection using a command:
cmd pad
Use this if cmd padip and cmd padport have been previously
configured. If cmd padip 0.0.0.0 has been configured then the
modem will connect in server mode and listen on the port
defined by cmd padport. If cmd padip iii.iii.iii.iii has been
configured with a non-zero IP address then the modem will
connect to that IP address in client mode and transmit to the
port defined by cmd padport.
Note that it is the client end that has to initiate the connection – the server is simply waiting to accept an
incoming connection.
3.2
Closing a PAD connection
Closing a PAD connection can be done in various ways:
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
6
State Diagrams for PAD operation modes
Send the escape sequence to the serial port (the default escape sequence is +++) – note that no “Enter” is
required as part of the escape sequence. The modem will drop into command mode. The escape
sequence may be changed using the command cmd padesc <string>. Note the PAD escape guard timer is
set using the cmd padesct n command.
When the modem has been previously configured for PAD client mode - one session (cmd padmode 2 or
cmd padmode 3), using the command cmd padreset will cause the PAD connection to drop and the
modem will go into the serial console.
The cmd padsvct server connection timer will expire after a period of inactivity equal to its setting
(default 15 seconds). When the modem has been configured with cmd padmode 0/1 and cmd padip
using a valid IP address, and is in client mode for the first time, once this timer expires the modem will go
into server mode. The cmd padsvct maximum connection timer will expire after a period equal to its
setting, regardless of the PAD data connection condition (default 0 seconds, meaning disabled).
On TCP PAD connections if the server end drops the connection then a modem configured with cmd
mode 4 (auto connect to network and PAD) and cmd padmode 5 (auto connect TCP PAD client) will
attempt to reconnect the TCP session.
4 State Diagrams for PAD operation modes
The following section provides the state diagrams that describe PAD operation for each of its modes:
• PAD server mode: cmd padmode 0 (UDP), cmd padmode 1 (TCP)
• PAD client, single-session mode: cmd padmode 2 (UDP), cmd padmode 3 (TCP)
• PAD client, persistent mode: cmd padmode 4 (UDP), cmd padmode 5 (TCP)
In the state diagrams below, the circles indicate the current state of PAD and the arrows exiting the
circles indicate events which cause PAD to change its state.
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
7
State Diagrams for PAD operation modes
4.1
PAD Server Modes (padmode 0/1)
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
8
State Diagrams for PAD operation modes
4.2
PAD Client Single Session Modes (padmode 2/3)
4.3
PAD Client Persistent Mode (padmode 4/5)
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
9
Example Modem PAD Configuration
5 Example Modem PAD Configuration
5.1
Modem PAD Configuration for a SCADA Field Device in Slave Mode
In this example, a Chameleon modem is connected to a SCADA field device which is polled by a remote
server. The field device in slave mode is either connected to another Chameleon modem or has built-in
TCP/IP functionality. The field device communicates with a remote server or master device via a
request/response protocol. The slave devices will only send responses to requests sent.
The device connected to the modem’s serial port is operating at 9600 baud with no hardware flow
control (Tx, Rx, & Gnd signals only), and responds to every incoming sentence with a reply of maximum
length 50 bytes of ASCII data always terminated with the character <. The serial slave device does not
support echoing of data that it sends to the modem. The chosen listening port is 5000.
Enter the following commands from the serial console of the modem connected to the serial slave
device:
cmd factory
cmd mode 4
cmd port 9600 8 n 1 0
It will now be necessary to adjust the baud rate of the terminal application to 9600.
cmd padmode 0/1
PAD server mode: 0 = UDP, 1 = TCP
cmd padecho 0
Do not echo data sent by the slave device back on the serial port
cmd padip 0.0.0.0
Sets PAD to server mode only (default settings, in effect after cmd factory)
cmd padport 5000
Sets port on which field device will be listening for requests
cmd padfwdc 60
Decimal value of ASCII <
cmd padfwdl 51
Greater than longest message size
cmd padfwdt 20
Sets the forwarding time to 1 second idle period
(default setting, in effect after cmd factory)
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
10
Example Modem PAD Configuration
cmd padsvct 15 0
cmd save
cmd pwrmode 2
Set connection timeout to 15 seconds, maximum connection timer is disabled
(default settings, in effect after cmd factory)
Save configuration to modem’s non-volatile memory
Power cycle
5.2
Modem PAD Configuration for a SCADA Master Device Polling a Single
Field Device in Slave Mode
In this example, a Chameleon modem is connected to a master device which polls data from a single field
device in slave mode. The field slave device is either connected to another Chameleon modem or has
built-in TCP/IP functionality. The master device is typically a server running a SCADA application and
communicates with the field device via a request/response protocol. The slave devices will only send
responses to requests sent.
The modem connected to a master device operates at a baud rate of 19200 with full hardware flow
control. The master device receives sentences on its serial port of maximum length 100 bytes (with no
common end character) which are to be sent to a single slave unit at IP address 100.100.1.2, port 5000.
The serial master device requires echoing of data that it sends to modem.
For the modem connected to the serial master device, enter the following commands from the serial
console:
cmd factory
cmd mode 4
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
11
Example Modem PAD Configuration
cmd port 19200 8 n 1 2
It will now be necessary to adjust the baud rate of the terminal application to 19200.
cmd padmode 4/5
PAD client, persistent mode: 4 = UDP, 5 = TCP
cmd padecho 1
Echo data sent by the master device back on the serial port
(default setting, in effect after cmd factory)
cmd padip 100.100.1.2 Sets IP address of field device being polled
cmd padport 5000
Sets port of field device being polled
cmd padfwdc 0
No forwarding character
cmd padfwdl 101
Greater than longest message size
cmd padfwdt 10
Sets the forwarding time to 0.5 seconds idle period
cmd padsvct 15 0
Set connection timeout to 15 seconds, maximum connection timer is disabled
(default settings, in effect after cmd factory)
cmd save
Save configuration to modem’s non-volatile memory
cmd pwrmode 2
Power cycle
5.3
Modem PAD Configuration for a SCADA Master Device Polling Multiple
Field Devices in Slave Mode
In this example, a Chameleon modem is connected to a programmable master device intended to poll
multiple field devices in slave mode. The master device is typically a server running a custom SCADA
application and communicates with field devices via a request/response protocol. The slave devices will
only send responses to requests sent.
The modem is connected to a master device at baud rate of 19200 with full hardware flow control. It
receives sentences on its serial port of maximum length 100 bytes (with no common end character) which
are to be sent to multiple slave units at IP addresses 100.100.1.1-100.100.1.10, port 5000. The slave
devices typically respond within 8 seconds. The serial master device requires echoing of data that it sends
to the modem. In this example, the master device requires built-in scripting functionality to perform
predefined actions based on serial port output when in command mode.
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
12
Example Modem PAD Configuration
Enter the following commands from the serial console of the modem connected to the serial master
device:
cmd factory
cmd mode 2
cmd port 19200 8 n 1 2
It will now be necessary to adjust the baud rate of the terminal application to 19200.
cmd padmode 2/3
PAD client, single-session mode: 2 = UDP, 3 = TCP
cmd padecho 1
Echo data sent by the master device back on the serial port
(default setting, in effect after cmd factory)
cmd padfwdc 0
No forwarding character
cmd padfwdl 101
Greater than longest message size
cmd padfwdt 100
Sets the forwarding time to 5 seconds idle period
cmd padsvct 10 0
Set connection timeout to 10 seconds, maximum connection timer disabled
cmd save
Save configuration to modem’s non-volatile memory
cmd pwrmode 2
Power cycle
In command mode, for each request to a specific slave device, the master device should send the
following commands:
cmd padip 100.100.1.1 Sent by master device to set new PAD slave to which to connect
cmd pad
Sent by master device to start new PAD connection
Upon executing cmd pad, the modem will connect to the PAD slave with IP address 100.100.1.1 as
specified in cmd padip, transmit a request, and disconnect if the connection idle time is 10 s, or if the
escape sequence is entered on the serial port (default is +++). Once disconnected, the modem will drop
into command mode. Repeat cmd padip and cmd pad for other slave devices using IP addresses
100.100.1.2-100.100.1.10.
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
13
Example Modem PAD Configuration
In this example, the master device requires some scripting or programmable functionality to perform the
following actions iteratively for polling data from slave devices:
1. Detect the modem’s command mode by checking that the pound character (#) is received on the
serial port
2. Execute cmd padip using the field device’s IP address
3. Execute cmd padport using the field device’s port
4. Execute cmd pad to start PAD operation
5. Send the current field device request over the serial port
6. Wait for the response from the field device. In this example, the modem should drop back into
command mode after 10 seconds.
5.4
Modem PAD Configuration for a Reporting Field Device
In this example, a Chameleon modem is connected to a field device that reports to a remote server
without the need to be polled. The field device generates data on the serial port whenever it is available
and the modem will send this data remotely over-the-air. The remote field device operates at a baud rate
of 9600 and uses hardware flow control. The field device generates ASCII data with varying length and is
always terminated with the carriage return character <CR>. The field device does not require echoing of
data that it sends to the modem.
For the modem connected to the reporting field device, enter the following commands from the
serial console:
cmd factory
cmd mode 4
cmd port 9600 8 n 1 2
It will now be necessary to adjust the baud rate of the terminal application to 9600.
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
14
Technical Support/Warranty
cmd padmode 4/5
cmd padip 200.100.1.1
cmd padport 8000
cmd padecho 0
cmd padfwdc 13
cmd padfwdl 40
cmd padfwdt 20
cmd padsvct 15 0
cmd save
cmd pwrmode 2
PAD client, persistent mode: 4 = UDP, 5 = TCP
Sets IP address of remote server handling data reported by the field device
Sets port to which data is to be sent
Do not echo data sent by the field device back on the serial port
Decimal value of ASCII <CR> (default setting, in effect after cmd factory)
Data to be sent over the air in 40-byte packets or less if <CR> in first 40 bytes
(default setting, in effect after cmd factory)
Sets the forwarding time to 1 second idle period
(default setting, in effect after cmd factory)
Set connection timeout to 15 seconds, maximum connection timer is disabled
(default settings, in effect after cmd factory)
Save configuration to modem’s non-volatile memory
Power cycle
6 Technical Support/Warranty
Cypress Solutions Service
Support Group
1.877.985.2878 or 604.294.4465
9.00am to 5.00pm PST
support@cypress.bc.ca
© 2009 Cypress Solutions
PAD Operation (Revision 1.0)
15
Download PDF