Q.station CAN Interface Configuration

How to connect to the CAN interface of a Q.station controller

Purpose


This guide describes how to connect to the CAN interface of a Q.station controller. The Q.station has 1 x CAN interface available. The connection is located on the bottom side of the controller and marked as CAN1-H (high) and L (low). The configuration for the CAN interface is done using GI.bench or test.commander

Procedure (GI.bench)

Reading/writing to external signals

  1. Set the correct baud rate of the bus. Under the controller in the project window, right-click CAN #1 > Edit Adapter
  2. Supported baud rates: 10000, 20000, 50000, 100000, 125000, 250000, 500000, 800000, 1000000
  3. It is possible to import a .dbc file to automatically create the CAN virtual variables. Import
  4. To manually create CAN variables: right-click Virtual Variables > Add > Append Variables. Select how variables to add and click OK.
  5. Change type to Remote and Remote type to CAN
  6. Go to the Remote section to enter the CAN parameters
  7. Click OK to save changes

Configure DAQ IO to be read over CAN

  1. Right-click controller and select Edit CAN Variables
  2. Select each channel or shift-click to highlight multiple variables. Check the box for the desired CAN bus.
  3. For each channel you can edit byte order, data type, control type, multiplexing, etc.
  4. Click OK to save changes then write updates to controller

Procedure (test.commander)

  1. Set the correct baud rate of the bus. Go to the Q.station settings > Slave Interface > CAN#1
    Supported rates: 10000, 20000, 50000, 100000, 125000, 250000, 500000, 800000, 1000000


  2. Add a CAN message: for every message, read or write on the CAN bus, one variable has to be added to the virtual variables section of the Q.station. Right-click on virtual variables > Add Variable > CAN_INPUT or CAN_OUTPUT.


  3. Double-click on the new virtual variable that was created, and the settings window for the CAN message will appear:


  4. Parameters for a CAN message:
    1. Name: variable name
    2. Variable kind: this has to be set to CAN (default)
    3. CAN UART: only UART#1 can be selected.
    4. Use extended ID: either a base identifier or an extended identifier is needed.
    5. CAN message ID [hex]: the base ID is a maximum of 11 bits (hex 7FF), and the extended ID is a maximum of 29 bits (hex 1FFFFFFF).
    6. Byte order: the standard byte order of a CAN message is Intel. In some cases, it might be necessary to switch the byte order. Therefore, Motorola is also supported.
    7. CAN Data format: defines the data format in the CAN message. This has to be a valid format to interpret the data correctly.
    8. Start bit: a CAN frame consists of a maximum of 64 bits of data and can include multiple CAN messages. Ex: 2 x 8-bit, 1 x 16-bit, 1 x 32-bit messages. With this, the start bit of the message to read into the CAN frame is defined.
    9. Bit length: the maximum bit length of a CAN message is defined by the selected CAN data format but can also be less. Ex: if the CAN data format is 16 bits, and the bit length is only 5, the missing bits will internally be filled up or cut off to be able to convert it correctly.
    10. Scaling Type: a linear scaling of the measurement value is possible with Factor & Offset or 2-point calibration.
    11. Data format settings: this is the internal data format used in the controller. When reading a CAN message, the value represented in the CAN data format will be converted into this format for integration into the controller process and vice versa.
  5. Additional parameters for a CAN output message:
    1. Set Data direction > OUTPUT, INPUT/OUTPUT: Source: the output source is the channel itself
    2. Set Data direction > EMPTY: Source: as output source, any INPUT variable of the system can be selected.
    3. Write CAN messages control:
      1. Only when the value changes
      2. Write always
      3. Cyclic
      4. On host
      5. On variable > 0.5
  6. Data Processing
    1. Read CAN message:
    2. Write CAN message:

More information about CANbus: http://en.wikipedia.org/wiki/CAN_bus