IXXAT CAN@net II/Generic Manual Download Page 20

CAN@net II/Generic, Version 1.5 

ASCII Protocol Server 

 

20

 

 

4.5  Getting Started 

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. 

 

The next step is to initialize the CAN controller hardware. Because the CAN 
controller is not started yet, it is not possible to exchange CAN messages. Any 
CAN messages received by the ASCII-Protocol server during this state  are 
discarded. 

The necessary steps are as follows: 

  Issue a CAN init command to the ASCII-Protocol server. This command also 

sets the desired CAN bus baud rate. The command "C INIT 500 \r\n" for 
example will initialize the can controller hardware to 500 kBit/sec. 

  Wait for the ASCII-Protocol Server to respond, either with an error message 

or with an OK. 

  Issue a CAN start command “C START” to the ASCII-Protocol server. This 

command will put the CAN controller hardware into operating mode. 

  Wait for the ASCII-Protocol Server to respond; either with an error message 

or with an OK. 

 
Now the ASCII-Protocol server is fully configured and operational. If there was 
any CAN data sent to the ASCII-Protocol server during this setup session, the 
data has been discarded. 

 (After a “C START” command is acknowledged with OK), the ASCII-Protocol 
server can receive data from the CAN bus and forward it to the ASCII-Protocol 
client. 

 
An example for these necessary steps can be seen in the coding example 
described in section 6.2. 
 

 

Summary of Contents for CAN@net II/Generic

Page 1: ...CAN net II Generic TCP IP Gateway for CAN with Open Socket API MANUAL ENGLISH...

Page 2: ...s document is only allowed with explicit permission of HMS Technology Center Ravensburg GmbH HMS Technology Center Ravensburg GmbH reserves the right to change technical data without prior announcemen...

Page 3: ...ion 9 4 ASCII Protocol Server 10 4 1 ServerFunction 10 4 2 ASCII Protocol 10 4 2 1 Basic Message Format 10 4 2 2 CAN Message 11 4 2 3 CAN Controller Command 12 4 2 4 Device Command 14 4 2 5 Error Mess...

Page 4: ...configuration 7 Figure 3 1 Connectors and displays of the CAN net II Generic 8 Figure 4 1 CAN Controller Command Request Response Cycle 14 Figure 4 2 Device Command Request Response Cycle 15 Figure A...

Page 5: ...ter studying the information on our homepage and the manuals please contact our support department In the support area on our homepage you will find the relevant forms for your support request In orde...

Page 6: ...otocol The server relays the commands and messages to the CAN bus and vice versa The server is restricted to accept only a single connection to TCP port 19227 Additional connection requests are reject...

Page 7: ...c Server Figure 2 2 Bridge configuration 2 3 CAN ID Filtering The CAN net II Generic application firmware includes a filtering mechanism based on CAN Identifiers The basis for the filtering is a filte...

Page 8: ...tors two Duo LEDs are available which indicate the communication status For more information on the LEDs please see chapter 3 2 Indicators of the manual CAN net II Intelligent PC CAN Interface Figure...

Page 9: ...on as described in chapter 3 2 Basic device configuration must be done for both devices For the CAN net II Generic which shall act as server it is sufficient to do the basic configuration 2 One of the...

Page 10: ...ted Ethernet TCP IP client 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...

Page 11: ...ssage types are CAN message CAN controller command Device command Error message Info message 4 2 2 CAN Message The ASCII Protocol messages of type CAN message are used to exchange CAN messages between...

Page 12: ...0 1 2 3 4 5 6 7 r n Note The messages are ASCII coded Every single character of the example message M SD7 200 1 2 3 4 5 6 7 r n will be one byte in the TCP paket 4D 20 53 44 37 20 32 30 30 20 31 20 32...

Page 13: ...SJA1000 running at 16 MHz INIT AUTO The CAN controller tries to auto detect a baud rate on the bus START Start an initialized CAN controller STOP Stop a CAN controller RESET Reset a CAN controller STA...

Page 14: ...e response As some commands may take longer to be processed than others the timing of the response messages may vary So the sequence of responses to commands which were issued in a row may be changed...

Page 15: ...t or power on RESET Device reset Table 4 2 2 Device commands All messages of type Device command are answered by the ASCII Protocol server with either an error message see 4 2 5 or the requested infor...

Page 16: ...es and their description Error Code Description ERR_QUEUE_OVERRUN 0x10 Software queue overrun ERR_DATA_OVERRUN 0x11 CAN controller buffer overrun ERR_STATUS_SET 0x12 CAN error status set ERR_STATUS_RE...

Page 17: ...sages 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 or Device command They...

Page 18: ...essages with this new ID will now be forwarded to the Ethernet Due to the fact that this filter list is kept in RAM the modifications to it are volatile This means that with power down the modificatio...

Page 19: ...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 discarde...

Page 20: ...SCII Protocol server This command also sets the desired CAN bus baud rate The command C INIT 500 r n for example will initialize the can controller hardware to 500 kBit sec Wait for the ASCII Protocol...

Page 21: ...being the actual IP address of the CAN net II Generic Please make sure that your Web Browser has no Proxy settings enabled and that the IP network between your host running the Web Browser and the CAN...

Page 22: ...modifying whether the CAN net II Generic should act as an ASCII Protocol server or client A screenshot of the device configuration page is shown in Screenshot 5 2 on the following page When opened the...

Page 23: ...ct as client in a bridge configuration as described in 2 2 Bridge setup If a valid IP address is entered here the CAN net II Generic will act as client in a bridge configuration It will use the IP add...

Page 24: ...ion reply information 4 The new device configuration is now stored in the device In order to apply the new settings the device must reboot Enter the password for your device and press the Reboot Devic...

Page 25: ...power cycle Or by clicking the Load button the filter list from flash can be restored overwriting the filter list in RAM Screenshot 5 4 Filter configuration Filter configuration steps 1 The Load butt...

Page 26: ...c 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 4 All filter list changes are held in RAM In order to store the chang...

Page 27: ...II Generic Version 1 5 Web Interface 27 5 4 Expert Configuration With the expert configuration the CAN netII Generic can be optimized for different communication demands Screenshot 5 6 Expert configu...

Page 28: ...ms The 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 a...

Page 29: ...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 pac...

Page 30: ...n 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 link The demo does not respect the TCP data...

Page 31: ...ges to the demo application Here the messages are displayed using the printf function Clear the complete filter list set a single CAN ID to be allowed from CAN to Ethernet and enable the filter mechan...

Page 32: ...ven example CAN Bus 1 with baudrate 250 kBd and CAN Bus 2 with 100 kB will be connected using an Ethernet TCP IP network Two IP addresses are required for the bridge setup Please ask your system admin...

Page 33: ...ask 255 255 255 0 Gateway address 0 0 0 0 3 Devices must be connected to the Ethernet network and must be reset Connect to the Client web interface with any Internet browser with enabled JavaScript ty...

Page 34: ...Web Browser cannot open the CAN net II Generic Web Interface A Make sure the Internet Browser you are using has its proxy settings disabled With the proxy settings enabled a URL request to the IP addr...

Page 35: ...ta rate of your system Q The CAN net II Generic does not send my ASCII Protocol CAN messages on the CAN bus A Make sure that the CAN controller is initialized with the correct baud rate and that it is...

Page 36: ...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 Interfa...

Page 37: ...E extended T Frame Type D Data R RTR D Data Length Code 0 through 8 ID CAN Message ID XX CAN Message Data 0 through 8 Bytes long r n Message terminator Controller Messages Command Parameters C INIT B...

Page 38: ...C STATUS I CAN status command received I CAN status Bus off Error Warning Data Overrun Init Mode Note all XYZ are optional C FILTER ADD I OK ID 0xX added to filter list C FILTER REMOVE I OK ID 0xX rem...

Page 39: ...E 10 Software queue overrun E 11 CAN controller buffer overrun E 12 CAN error status set E 13 CAN error status reset E 14 Bus off E 20 Unknown message frame format E 21 Unknown message RTR flag E 70...

Page 40: ...om baudrate configuration XYZ failed BT0 and BT1 are invalid CAN init command received Baudrate configuration XYZ failed E 83 CAN controller failed to set requested baud rate E 90 Interface is in the...

Reviews: