Ixxat CAN@net NT 200, CAN@net NT 420 SOFTWARE DESIGN GUIDE

CCAANN@@nneett NNTT 220000//442200
GGeenneerriicc PPrroottooccooll ffoorr GGaatteewwaayy MMooddee
SOFTWARE DESIGN GUIDE
4.02.0332.20000 1.5 en-US ENGLISH
Important User Information
Liability
Every care has been taken in the preparation of this document. Please inform HMS Industrial Networks of any inaccuracies or omissions. The data and illustrations found in this document are not binding. We, HMS Industrial Networks, reserve the right to modify our products in line with our policy of continuous product development. The information in this document is subject to change without notice and should not be considered as a commitment by HMS Industrial Networks. HMS Industrial Networks assumes no responsibility for any errors that may appear in this document.
There are many applications of this product. Those responsible for the use of this device must ensure that all the necessary steps have been taken to verify that the applications meet all performance and safety requirements including any applicable laws, regulations, codes, and standards.
HMS Industrial Networks will under no circumstances assume liability or responsibility for any problems that may arise as a result from the use of undocumented features, timing, or functional side effects found outside the documented scope of this product. The effects caused by any direct or indirect use of such aspects of the product are undefined, and may include e.g. compatibility issues and stability issues.
The examples and illustrations in this document are included solely for illustrative purposes. Because of the many variables and requirements associated with any particular implementation, HMS Industrial Networks cannot assume responsibility for actual use based on these examples and illustrations.
Intellectual Property Rights
HMS Industrial Networks has intellectual property rights relating to technology embodied in the product described in this document. These intellectual property rights may include patents and pending patent applications in the USA and other countries.
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
Table of Contents
Page
1 User Guide ........................................................................................................................... 3
1.1 Related Documents ............................................................ .... .... ...................................... 3
1.2 Document History ............ .... .... ................................................................................. .... ...3
1.3 Trademark Information..................................................................... .... .... ........................ 3
1.4 Conventions................................................................. .... .. .. ...........................................4
2 TCP Server Function ............................................................................................................ 5
3 ASCII Protocol...................................................................................................................... 6
3.1 Basic Message Format ..................................................................... .. ...............................6
4 Message Types .................................................................................................................... 7
4.1 Message................................... .... .... .............................................................................. 7
4.2 Cyclic Message ........ .... .... ..................................................................................... .... .... ...8
4.2.1 CYC INIT ..... .... .... . ... . ... . ... . ... . ... . ... . ... . .... ... . ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . ... . .. 8
4.2.2 CYC UPDATE . .... .... .... . ... .... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... .... .... .... . ... . ... . ... . ... . ... . . 9
4.2.3 CYC STOP ... . ... . ... . ... . .... ... . ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . .. 9
4.3 CAN Commands........................................ .... .... ............................................................. 10
4.3.1 Initializing the CAN Controller . . ... . ... . ... . ... . ... . ... . .... .... .... .... .... .... .... . ... . ... . ... . ... . ... . ... . .. 11
4.3.2 Configuring the Filter.. . ... . ... . .... .... .... .... .... . ... . ... .... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... 14
4.3.3 Starting the CAN Controller ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . ... . ... .... . ... . ... . ... . ... . ... . ... 16
4.3.4 Stopping the CAN Controller ... . ... . ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . .... ... . ... . .... .... .. 16
4.3.5 Requesting the Status. .... ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . .... ... . .... .... .... .... .... . ... . 17
4.4 Device Commands....................... .. .. ............................................................................... 19
4.4.1 DEV IDENTIFY... .... .... . ... . ... . ... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . 19
4.4.2 DEV VERSION . . ... . ... . ... . .... .... .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... .... .... .. 19
4.4.3 DEV PROTOCOL .. . ... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . ... . ... . .... .. 19
4.4.4 DEV INTERFACES ... .... .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . ... .... .... . ... . ... . 19
4.5 Events....................... .... .. .. ..................................................................................... .... .. 20
4.6 Responses ................................. .... ............................................................................... 20
4.6.1 Positive Response. .... .... .... . ... . ... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . ... . ... . ... . ... . ... . ... . . 20
4.6.2 Negative Response .. ... . ... . .... .... .... .... .... . ... .... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... .... . ... ... 20
4.6.3 Device Response .. . ... . ... . ... . ... . .... .... .... .... .... .... . ... . ... . ... . ... . ... . ... . ... . ... . ... . .... .... .... .... . 20
4.7 PING REQUEST .............................................................. .... .... ........................................ 21
5 How to Handle Incoming Messages ................................................................................. 22
6 Example ............................................................................................................................. 23
7 List of Error Codes ............................................................................................................. 24
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
This page intentionally left blank
User Guide 3 (26)

1 User Guide

Please read the manual carefully. Make sure you fully understand the manual before using the product.

1.1 Related Documents

Document
Installation Guide VCI Driver
User Manual CAN@net NT

1.2 Document History

Author
HMS
HMS
Version
1.0 June 2016
1.1
1.2
1.3
1.4 January 2019
1.5
Date
October 2016 Adjusted filter examples in 4.2 CAN commands
July 2017 Added information about CAN@net NT 420
April 2018 Adjusted PING REQUEST and title
March 2019 Layout changes
Description
First release
Minor corrections in chapter 4, added command for cyclic message, updated error codes

1.3 Trademark Information

Ixxat®is a registered trademark of HMS Industrial Networks. All other trademarks mentioned in this document are the property of their respective holders.
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
User Guide 4 (26)

1.4 Conventions

Instructions and results are structured as follows:
instruction 1
instruction 2
result 1
result 2
Lists are structured as follows:
item 1
item 2
Bold typeface indicates interactive parts such as connectors and switches on the hardware, or menus and buttons in a graphical user interface.
This font is used to indicate program code and other kinds of data input/output such as configuration scripts.
This is a cross-reference within this document: Conventions, p. 4
This is an external link (URL): www.hms-networks.com
This is additional information which may facilitate installation and/or operation.
This instruction must be followed to avoid a risk of reduced functionality and/or damage to the equipment, or to avoid a network security risk.
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
TCP Server Function

2 TCP Server Function

In the Gateway mode the device is acting as a TCP server and transmits and receives data on the TCP port that is defined with the CAN-Gateway Configurator. The default TCP port is 19228.
Connection:
Server exclusively accepts a single connection.
Additional connection requests are rejected.
Server exchanges data and commands with the ASCII protocol.
The server receives Ethernet ASCII protocol messages, extracts the original CAN message and transmits the CAN message to the selected CAN bus. Received CAN messages are packed into the ASCII protocol and forwarded to the connected Ethernet TCP/IP client. The server also handles commands.
The device automatically starts the protocol server after power-up. When a connection to the server is closed or lost, the device is restarted and waiting for a new connection.
5 (26)
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
ASCII Protocol 6 (26)

3 ASCII Protocol

The ASCII protocol is used to pack data (CAN messages) and commands for the transfer over Ethernet TCP/IP network.
The ASCII-Protocol in Version 2.0 supports 6 different message types:
Messages (both directions)
CAN Commands (from client to server)
Device Commands (from client to server)
Events (from server to client)
Responses (from server to client)
Ping Request
Commands have to be confirmed. Before a new command can be transmitted an answer has to be received.

3.1 Basic Message Format

Basic Rules of ASCII Protocol:
Messages are coded with ASCII characters exclusively.
Valid characters:
letters from a to z (no national characters)
no distinction between upper and lower case
numbers from 0 to 9
Messages start with a valid ASCII character and are terminated dependent on the settings in the CAN-Gateway Configurator with \r\n, \r, or \n (End-Of-Line).
Directly after End-Of-Line the next message can follow.
Messages containing invalid characters are discarded.
Message contents (e.g. CAN identifier, CAN data) are noted in HEX notation. Other formats are not supported. HEX specifier (0x...) is omitted.
ASCII protocol message consists of groups of ASCII characters, each group separated by a space character (0x20).
More than one consecutive space characters (0x20) are reduced to a single space character.
No space characters before and after a CAN message
The groups of ASCII characters describe different types of messages or commands contained in the ASCII-Protocol message.
The single characters of an ASCII-Protocol message are transmitted over the TCP connection in readable order; beginning with the “message type” group of ASCII characters and ending with the termination \n.
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
Message Types

4 Message Types

4.1 Message

Used to exchange CAN messages between the device and the Ethernet TCP/IP host and to exchange information in both directions, to and from the device.
When a device receives a message on the CAN bus:
CAN message is packed into an ASCII protocol message of type Message and transmitted over Ethernet TCP/IP.
When device receives an ASCII-Protocol message of type Message from Ethernet TCP/IP:
Message is unpacked and translated into a CAN message.
CAN message is transmitted to the CAN bus.
Make sure, that the CAN controller is in running state before a message is transmitted (see CAN
Commands, p. 10). Otherwise the message is discarded. If the device is in running state and no messages
can be transmitted (e. g. invalid bus connection) the device discards one message every 10 ms to prevent a data jam.
M <port> <format> <identifier> [<data-byte>] | dlc=<dlc>]
7 (26)
Parameter
Parameter
port
format Message format according to CFT:
identifier Message identifier (in HEX) data-byte Only in data messages.
dlc Only in remote frames (RTR) in Classic CAN mode, valid values 0–8
Description
CAN port number (NT 200: 1...2, NT 420: 1...4)
C – Controller type (C – CAN, F — CAN FD)
F – Frame Format (S – Standard, E – Extended)
T – Frame Type (D – Data, R – RTR) Remote frames (RTR) are only supported by Classic CAN.
Classic CAN: up to 8 (blank separated) data bytes (in HEX) CAN FD: up to 64 (blank separated) data bytes (in HEX)
Example
Classic CAN data message:
M 1 CSD 100 55 AA 55 AA
CAN FD data message:
M 2 FED 18FE0201 01 02 03 04 05 06 07 08
Classic CAN remote frame:
M 1 CSR 101 dlc=05
Return Value
None
CAN@net NT 200/420 Software Design Guide
4.02.0332.20000 1.5 en-US
Loading...
+ 19 hidden pages