This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
app-notes:can-tcpsockets-parsing [2018/02/06 08:04] preisig [Environment setup] |
app-notes:can-tcpsockets-parsing [2019/07/03 08:11] juraschek ↷ Links adapted because of a move operation |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Environment setup ===== | ===== Environment setup ===== | ||
- | {{:internal:can_environment.jpg}} | + | {{:can_environment.jpg}} |
The above graphic illustrates how the test environment was setup and what data gets transmitted. First to be able to simulate a CAN bus in a local environment PC1 runs [[https://www.peak-system.com/PCAN-FMS-Simulator-2.246.0.html|Peak System PCAN-FMS Simulator]] to generate CAN Frames based on the FMS Standard (supports FMS v 1.0 – 3.0). The generated frames are transmitted over [[https://www.peak-system.com/PCAN-USB.199.0.html|Peak System PCAN-USB]] into a Netmodule Router (NB2800 used in this example). Two example scripts on the router work with the incoming CAN traffic and send it back out over TCP, where [[http://sockettest.sourceforge.net/|SocketTest]] runs an PC2 as a simple TCP server. SocketTest is a tool based on Java that allows testing of UDP and TCP client and server sockets. In our case SocketTest is configured as a TCP server that is listening on Port 2000. | The above graphic illustrates how the test environment was setup and what data gets transmitted. First to be able to simulate a CAN bus in a local environment PC1 runs [[https://www.peak-system.com/PCAN-FMS-Simulator-2.246.0.html|Peak System PCAN-FMS Simulator]] to generate CAN Frames based on the FMS Standard (supports FMS v 1.0 – 3.0). The generated frames are transmitted over [[https://www.peak-system.com/PCAN-USB.199.0.html|Peak System PCAN-USB]] into a Netmodule Router (NB2800 used in this example). Two example scripts on the router work with the incoming CAN traffic and send it back out over TCP, where [[http://sockettest.sourceforge.net/|SocketTest]] runs an PC2 as a simple TCP server. SocketTest is a tool based on Java that allows testing of UDP and TCP client and server sockets. In our case SocketTest is configured as a TCP server that is listening on Port 2000. | ||
Line 10: | Line 10: | ||
To use the CAN Interface on the Router first you need to enable the CAN Interface with the correct Bitrate (250kBits used). | To use the CAN Interface on the Router first you need to enable the CAN Interface with the correct Bitrate (250kBits used). | ||
- | {{:internal:netbox-can-setup.jpg?600|}} | + | {{:netbox-can-setup.jpg?600|}} |
===== Peaksystem PCAN-FMS Simulator ===== | ===== Peaksystem PCAN-FMS Simulator ===== | ||
Line 21: | Line 21: | ||
By default, candump provides the following information: | By default, candump provides the following information: | ||
- | {{:internal:candump.jpg}} | + | {{:candump.jpg}} |
Interface, CAN Identifier, DLC and DATA | Interface, CAN Identifier, DLC and DATA | ||
Line 96: | Line 96: | ||
On the receiving end SocketTest listens on TCP port 2000 and displays the raw CAN frames: | On the receiving end SocketTest listens on TCP port 2000 and displays the raw CAN frames: | ||
- | {{:internal:sockettest-candump.jpg?600|}} | + | {{:sockettest-candump.jpg?600|}} |
===== Simple CAN Frame parsing (simple-can-parser.are) ===== | ===== Simple CAN Frame parsing (simple-can-parser.are) ===== | ||
An additional test was made to show a simple way of parsing CAN Frames. The example is based on checking for a specific PGN (parameter group number) and then get a SPN (supect parameter name) to display its value in human readable format which then gets logged in a file. | An additional test was made to show a simple way of parsing CAN Frames. The example is based on checking for a specific PGN (parameter group number) and then get a SPN (supect parameter name) to display its value in human readable format which then gets logged in a file. |