Page 1
CAN@net II/Generic TCP/IP Gateway for CAN with Open Socket API MANUAL ENGLISH...
Page 2
Internet: www.hms-networks.de E-Mail: info-ravensburg@hms-networks.de Support For problems or support with this product or other HMS products please request support at www.ixxat.com/support. Further international support contacts can be found on our webpage www.ixxat.com Copyright Duplication (copying, printing, microfilm or other forms) and the electronic distribution of this document is only allowed with explicit permission of HMS Technology Center Ravensburg GmbH.
Introduction 1 Introduction 1.1 Overview The CAN@net II/Generic features simple, flexible access to a CAN system via Ethernet. By supporting the TCP/IP protocol, the CAN@net II/Generic can be accessed worldwide via Internet. This manual is intended to help familiarize you with your CAN@net II/Generic device.
CAN bus from virtually every Ethernet/TCP/IP host. The CAN@net II/Generic runs a server on TCP Port 19227, which is capable of handling the ASCII Protocol specified in chapter 4. Any Ethernet/TCP/IP host can connect to this server and exchange commands and CAN messages with it using the ASCII Protocol.
The bridge setup allows you to connect two CAN systems over an Ethernet/TCP/IP network, e.g. the local intranet or even the internet. For the bridge setup one of the CAN@net II/Generic takes over the role of the client which connects to a CAN@net II/Generic in the role of a server.
Please see chapter 4 Configuration” of the manual “CAN@net II - Intelligent PC/CAN Interface”. 3.3 Gateway Configuration In order to use a CAN@net II/Generic as server in a gateway mode (as described in 2.1) it is sufficient to do a basic configuration. CAN@net II/Generic, Version 1.5...
II/Generic, which shall act as server, it is sufficient to do the basic configuration. (2) One of the two CAN@net II/Generic devices must be configured to act as client. This can be done via the Web Interface; see the description in chapter 5.2 "Device configuration".
In addition to CAN messages, the server also handles commands. These can be commands to start/stop the CAN controller, to set the CAN baudrate and so on. It is also possible to retrieve the version numbers of the CAN@net II/Generic firmware or of the ASCII-Protocol.
19227. The "CAN message" is used to exchange information in both directions; to and from the CAN@net II/Generic. When the CAN@net II/Generic receives a message on the CAN bus it packs this CAN messages into an ASCII-Protocol message of type "CAN message"...
“4D,20,53,44,37,20,32,30,30,20,31,20,32,20,33,20,34,20,35,20,36,20,37,20,0 A,0D”. 4.2.3 CAN Controller Command Messages of the type "CAN Controller Command" are used to control the CAN controller on the CAN@net II/Generic and to modify the settings of the filter table. Message format: Command Parameters \r\n The groups of characters are separated by a space each. For a valid "CAN controller command", the fields C, Command and \r\n must be specified.
Page 13
Add CAN ID to the controller filter list Remove CAN ID from the controller filter FILTER REMOVE CAN ID list FILTER SEARCH CAN ID Search CAN ID within the filter list FILTER CLEAR Clear the filter list CAN@net II/Generic, Version 1.5...
(like message identifiers) to match commands to their responses. 4.2.4 Device Command Messages of the type "Device command" are used to exchange information regarding the CAN@net II/Generic as a whole. Message format: Command Parameters \r\n The groups of characters are separated by a space each. For a valid "Device command", the fields D, Command and \r\n must be specified.
So the sequence of responses to commands which were issued in a row may be changed. And the ASCII-Protocol provides no mechanism (like message identifiers) to match commands to their responses. CAN@net II/Generic, Version 1.5...
0x75 ID not found in the filter list ERR_ID_IN_LIST 0x76 ID is already in the filter list ERR_LIST_FULL 0x77 ID was not added to the list, filter list is full ERR_CMD_UNKNOWN 0x80 Unknown command Wrong parameter CAN@net II/Generic, Version 1.5...
0x90 Interface is in the wrong state WRONG to execute this command Table 4.2.3 CAN@net II/Generic error codes 4.2.6 Info Message Messages of the type "Info message" are used to feed the ASCII-Protocol client with actual information. This message is sent only as a response to requests like "CAN controller command"...
Identifiers stated in the filter list are forwarded. Upon startup of the CAN@net II/Generic, the filter list is loaded from Flash to RAM. Now the filter list is ready for use and will be applied if filtering is enabled.
CAN messages. Measurements show that these times can vary from 2 … 200 msec or possibly worse in extreme situations. When the workload on the CAN@net II/Generic is so high that it cannot process all messages, the excess messages are discarded and an error message will be issued.
This chapter describes the necessary steps to start the CAN data exchange between the ASCII-Protocol server and the client. After Power Up, the CAN@net II/Generic is busy booting. The ASCII-Protocol server is started and ready to receive and process commands. This is indicated by the CPU LED, which is blinking with a frequency of 1Hz.
II/Generic must have its own IP address and also the rest of the IP settings. Also make sure that the CAN@net II/Generic is connected to the network. In order to connect to the CAN@net II/Generic Web Interface simply type in the URL "http://xxx.xxx.xxx.xxx" with xxx.xxx.xxx.xxx being the actual IP address of the CAN@net II/Generic.
A screenshot of the device configuration page is shown in Screenshot 5.2 on the following page. When opened, the device configuration page displays the current settings. By clicking into the fields with the current values, the settings can be edited. CAN@net II/Generic, Version 1.5...
Device configuration steps: 1. If the CAN@net II/Generic should act as ASCII-Protocol server, choose server and proceed with step 3. If the CAN@net II/Generic should be configured as a client, choose client and proceed with step 2. 2. Under the header "Configure client" there are the settings that must be given when a CAN@net II/Generic should act as client in a bridge configuration as described in 2.2 Bridge setup.
Web Browser. In order to adopt the new values, the “Store Configuration” button must be clicked. Only then are the new values transferred to the CAN@net II/Generic. The Web Server responds to this by displaying the same configuration page with additional process reply information right under the “Device...
2. To add/remove or search for an ID, enter the ID in the field of step 2. More than one ID can be entered by separating them by a space (e.g."2 b f 10 11"). The ID must be entered as a hexadecimal value (without a "0x" prefix). CAN@net II/Generic, Version 1.5...
3. Enable or disable the filter list. With the filter list disabled, all CAN messages are forwarded by the CAN@net II/Generic, regardless of their ID. If the filter list is enabled, only the identifiers which are in the list are forwarded from CAN to TCP/IP.
Web Interface 5.4 Expert Configuration With the expert configuration the CAN@netII /Generic can be optimized for different communication demands. Screenshot 5.6 Expert configuration CAN@net II/Generic, Version 1.5...
Page 28
CAN@net II/Generic will retrigger the burst collection time of 20ms with every received CAN message. 20ms after the last CAN response message the CAN@net II/Generic will send a TCP packet with all CAN responses of the nodes. In the section “Data congestion buffering”, the internal data buffer behavior is configured.
When writing TCP applications in general, the data-stream character of TCP must be considered. Let's have a look at an example: Imagine, the CAN@net II/Generic receives 3 messages on the CAN bus. After packing these three CAN messages into ASCII-Protocol messages they look as...
Studio. For your convenience the source code for the demo application can be retrieved from the CAN@net II/Generic device in file form using the Web Interface. Check the home (or /index) page of the CAN@net II/Generic Web Interface for the "[CAN@net II/Generic demo client application]"...
Page 31
Receive three messages on the CAN bus. In order to verify this, an analyzing tool or a CAN sender must be connected to your CAN bus. The CAN messages will be received by the CAN@net II/Generic which sends them as ASCII-Protocol messages to the demo application. Here the messages are displayed using the printf() function.
Two IP addresses are required for the bridge setup. Please ask your system administrator to provide two IP addresses for your use. In the example, the two IP addresses 192.168.10.100 and 192.168.10.101 are used. Figure A-1: Example for Bridge configuration CAN@net II/Generic, Version 1.5...
Page 33
(5) Store the new values into the device flash memory by entering the device password and pressing the Submit button in step 3 and 4 of the device configuration page. (6) Reset or reboot the Client device. CAN@net II/Generic, Version 1.5...
Q: Which settings are necessary to operate the CAN@net II/Generic in my Ethernet network? A: At least the IP address for the CAN@net II/Generic must be set. Make sure that the CAN@net II/Generic has its own IP Address; ask your system administrator.
CAN bus and cannot hand it to the ASCII-Protocol server, it sends one of these two error messages. One or more CAN messages will be discarded. The CAN@net II/Generic is not able to follow the data rate of your system.
Bridge Setup Q: Data exchange between the two CAN systems is not functional. A: For the Bridge setup, one CAN@net II/Generic must be configured to act as server (standard configuration) and one CAN@net II/Generic must be configured to act as client. The client can be configured via the Web Interface.
C RESET C STATUS C FILTER ADD CAN ID C FILTER REMOVE CAN ID C FILTER SEARCH CAN ID C FILTER CLEAR C FILTER ENABLE C FILTER DISABLE C FILTER LOAD C FILTER SAVE C FILTER SHOW CAN@net II/Generic, Version 1.5...
Page 38
I CAN filter show command received. Filter list is [Enables/Disabled] and contains X IDs: I 1 2 3 4 5 6 7 8 9 a b c d e f 10 I 11 12 13 14 15 16 17 18 19 CAN@net II/Generic, Version 1.5...
Page 39
Wrong config parameter Wrong init parameter Wrong filter parameter E 81 CAN init command received. Baudrate [XYZ] is unknown E 82 CAN bus baud rate was not detected CAN init command received. Could not detect baudrate. AutoBaud failed. CAN@net II/Generic, Version 1.5...
Page 40
CAN init command received. Baudrate configuration [XYZ] failed E 83 CAN controller failed to set requested baud rate E 90 Interface is in the wrong state to execute this command CAN already started CAN already stopped CAN not initialized CAN@net II/Generic, Version 1.5...
Need help?
Do you have a question about the CAN@net II/Generic and is the answer not in the manual?
Questions and answers