CANIO: ESD40[2|5] - PEAK USB - IXXAT - Peak Mini PCIe CAN FD

canio_esd405_net.png

Reference Information ESD405/IXXAT/Peak

I/O Card Model Number

CS-ES-CAN-405-x.

I/O Driver Model Number

WCS-ES-CAN-405.

I/O Module License:

ICS-SWB-1212.

Reference Information Peak

The CAN I/O boards ESD402, ESD405 and IXXAT600 support four input and output networks (channels). The IXXAT640 board supports an additional 4 LIN channels. Messages sent and received on these networks have an ID and up to 8 bytes of data for regular CAN and 64 bytes for CAN FD. I/O points may be mapped to fields within the 8/64 bytes of data.

Support for Peak Mini PCIe CAN FD board is via the SocketCAN interface.

Prerequisite for PEAK-CAN USB

This driver/I/O task does not support the Peak mini PCIe CAN card which is support under Socket CAN.
To run this I/O task, you need to have PEAK-CAN USB device. Please Download the PCAN drivers from here and install before using this SimWB IO task. PCAN driver version 7.15 or later works with kernels 2.x to 4.x. Usually the installation steps are as shown below:

tar –xzf peak-linux-driver-X.Y.Z.tar.gz
cd peak-linux-driver-X.Y.Z
make clean
sudo make install

Prerequisite for Socket CAN

To use Socket CAN, you must ensure the appropriate modules are loaded and correctly configure the relevant CAN interface. Use the tools provided by the canutils package (you may need to install it).

NVIDIA hardware (Jeston,Xavier, Drive,etc.)

On the NVIDIA family of hardware, you must for example use something like the following script to configure a CAN interface.

 #!/bin/sh
sudo rmmod mttcan
sudo rmmod can-raw
sudo rmmod can
sudo modprobe can
sudo modprobe can-raw
sudo modprobe mttcan

Non NVIDIA processors

On other platform you must load the peak module to support the Peak Mini PCIe CAN card.

 #!/bin/sh
sudo modprobe peak_pciefd

To set the baud rate of the channel you can run the command:
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
The command to set the baud rate and the CAN FD baud rate and bring the interface up will be run by the SimWB I/O task.
Be aware that all baud rates are not supported by every type of CAN hardware.

Buttons

Expand All expandall00021.png

Expands the hierarchy tree showing board configuration.

Collapse All collapseall00022.png

Collapses the hierarchy tree showing the board configuration to show only the channel nodes.

New IDnew_id.png

Adds a new message ID for the selected network.

New Fieldnew_field.png

Adds a field to the selected label.

Deletedelete00024.png

Deletes the selected node and everything, including mappings, below it. Networks cannot be deleted.

Nets

Specifies the data speed of the selected CAN channel in kBit/s.

For the IXXAT CAN boards and the ESD 402 board, the FD speed can also be set in the FD kBit/s combo box. This is only enabled when configuring a CAN FD supporting IXXAT/ESD CAN board. In addition, there is an option to specify choose Bosch's original protocol which is 'Non ISO CAN FD' and do not have stuff-bit counter bits in the CAN-frame. By default, we assume the messages conform to ISO standard 11898-2:2015, referred to as ‘CAN FD’.

Define the CAN IDs

canio_esd405_id.png

Create the CAN IDs that will be received / sent on the board specific channels.

ID

The message identifier. This is an 11-bit value, unless the 29-Bit ID option is selected.

Multiplexed Frame

Specifies that the message is spread across multiple frames. One field within the frame is specified as the multiplexing variable that distinguishes between the messages with the same message ID.

29-Bit ID

Specifies that the message ID is a 29-bit value instead of an 11-bit value.

FIFO

Specifies that the message is transmitted as soon as it changes. For output messages only. Not available for CANIO Peak.

Sched Rate (ms)

The rate in milliseconds at which transmission is scheduled. For output messages only. Not available for CANIO Peak.

Message Length

Specifies data length in message in bytes:

RTR Frame

Define this CAN ID frame as a RTR frame. When the ID is an input, the user must enter the sched rate associated with this frame. The scheduling rate is the rate used to poll the remote station for the CAN ID message. For output frames, the sched rate field is disabled and the I/O task updates the content of the message every time the content is modified.

ID Only

When checked, SimWB will only send or receive the CAN ID and no associated payload will be sent or received. Because of the fact that CAN IDs do not exist per se in the RTDB, an RTDB item must be mapped to the ID even though the mapping is ignored.

Fast Data (CAN FD)

This is only supported on CAN FD supporting IXXAT and ESD CAN boards. When set, the data will be transmitted using the FD (Flexible data rate on the board).

Extended Data (CAN FD)

This is only supported on CAN FD supporting IXXAT and ESD CAN boards. When set, the payload of the CAN message can be up to 64 bytes long.
Only the following lengths are valid: 0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64. A shorter message will be padded to the next allowable message size.

Create RTDB Mapping

canio_esd405_field.png

Define the mapping from subfields of the CAN message to individual RTDB variables. Add a mappable field by clicking on the New ID button.

Raw Type

How to interpret the raw bits of the field.

Packed

Integer bit field. Location is specified by the Bit setting.

char

One-byte integer. Location is specified by the Byte setting.

short

Two-byte integer. Location is specified by the Byte setting.

int

Four-byte integer. Location is specified by the Byte setting.

float

Four-byte floating-point number. Location is specified by the Byte setting.

double

Eight-byte floating-point number. Location must be specified as 0 by the Byte setting.

Byte (offset)

Byte offset within the 8-byte data of the non-bit field data.

Bit (offset:size)

Bit offset and size within the 64-bit data of the bit field data.

Big Endian

Interprets the bytes as most significant byte first.

Mux

Designates this field as the multiplexing variable that distinguishes between various frames having the same message ID when the ID’s Multiplexed Frame option is selected. One and only one field should have this option set.

Mux Value

Designates the value of the multiplexing variable to select which frame of a multiplexed message this field belongs to.

Message Control

When creating a CAN output message, message control branches are automatically added. Those mappable controls are in addition and do not replace the SimWB API calls with the same functionality. By mapping message control to RTDB variables, the model(s) - which have no direct access to the SimWB API - can directly control the CAN messages properties.
When mapping the Sched / FIFO, Schedule Rate etc. control branches to RTDB variables, the output message properties can be controlled directly by changing RTDB variable values. The values of the connected variables are initialized to value corresponding to the properties of the messages. Thus, the value of the variables defined in the initial conditions or the default value assigned when creating the RTDB variables do not apply.

LIN Mappings for IXXAT 640

The IXXAT 640 Board provides 4 LIN channels in addition to 4 CAN channels. Mapping information for these LIN channels is similar to that for the Lipowsky BabyLIN device.

Custom Bit Timing Parameters for IXXAT Boards

 

The IXXAT 600/640 Board provides provides the ability to set custom bit timing so that the sampling point can be set. The sampling point defines in percent when the hardware sample the CAN bus during the duration of a bit.
Click on the Custom xD bit rate checkbox to enable settings the custom parameters.
The parameters in the custom dialog (SEG1/SEG2/SJW/DTO) are specified in unit of Tq (Time Quanta). The Sync segment is always 1 Tq.
The sampling point is calculated as follows:
 
  sp = (1+seg1)/(1+seg1+seg2)
 
A custom baud rate can be specified in the Baud Rate entry field. The possible sample points for this baud rate will be displayed in the Sample Point combo box. When selecting a sample point, the BRP/SEG1/SEG2 will be filled with parameters appropriate for the baud rate and sample point chosen.
The baud rate is calculated as follows:
 
  baud = 8000000/(BRP*(1+seg1+seg2)
 
Where 80000000 is the IXXAT clock frequency in Hz (80 MHz).

Synchronous I/O Task: Cantor

This process packs all CAN raw output values corresponding to CAN output items and places them in the CAN output FIFO queue. The process will not queue a request into the FIFO queue if the raw CAN message is unchanged since the last test cycle.

The FIFO queue is read by the canasyncio asynchronous task that writes them to the hardware board.