How to setup CAN bus communication

Setting up a Q.station X controller to read and write signals over CAN bus

What is CAN bus?

Q.station CAN bus interface options

Cables and connector details

Bus termination

Setting up CAN variables on the controller

    What is CAN bus?

    The Controller Area Network (CAN bus) is a serial communications protocol that efficiently supports distributed real-time control with a high level of security.

    Q.station CAN bus interfaces options

    Each Q.station X controller has one CAN 2.0 port that supports a baud rate of up to 1 Mbps. Additional CAN ports are possible using the Q.station X's USB ports with a CAN-USB adapter (e.g. PCAN-USB).

    Cable and connector details

    Cables

    We recommend using only shielded CAN bus cable and that the shield is connected flat onto the control cabinet frame. The shield is a Faraday cage screening the CAN twisted pairs from noise so it must be connected to an earth (GND) potential.


    Gantner offers 2 types of CAN bus cable compatible with the Q.station X.

    CAN bus cable with 120 Ω bus termination

    • Article no. 603320, 3 m, LEMO to flying leads

    CAN bus cable without bus termination

    • Article no. 799138: 1 m, LEMO to flying leads
    • Article no. 471626: 3 m, LEMO to flying leads
    • Article no. 799037: 1 m, LEMO plugs on both sides

    Connector

    Q.station X recommended mating connector: LEMO FGG.00.302.CLAD30Z

    FGG.00.302.CLAD30Z ($ 14.23 EA) MSW EQUIV. | eBay   

    Top pin: CAN Low

    Bottom pin: CAN High

    PCAN-USB adapter

    Connector pin assignment according to specification CiA 106.

    D-Sub Connector

    Assignment

    Pin

    CAN_V+ (optional)

    1

    CAN_Low

    2

    CAN_High

    7

    CAN_GND

    3, 6

     

     




    Bus termination

    A CAN bus termination (of 120 Ω each) must be present at the two physical endpoints of the CAN network. The bus termination might be installed by external 120 Ω resistors placed in between the CAN High and CAN Low wires at both endpoints of the network.

    The CAN port on the Q.station X controller does not have a bus termination, which provides the option to daisy-chain the controller to other CAN ports.

    The CAN port is behind the galvanic isolation of the controller, so there could be resistance measured across the CAN High and Low pins, which is normal.

    Setting up CAN variables on the controller

    CAN signals can be brought into the controller using virtual variables.

    For importing CAN signals from a DBC file, please refer to the article Using a DBC file for importing and exporting CAN configuration data.

    1. Right-click Virtual variables and select Add > Append variables.


    2. Enter the number of new variables to create and select OK.


    3. Double-click the newly created variable to open the Variable settings. Enter the desired name and change the Type to Remote and Remote type to CAN.
    4. In the Remote settings, select the Port and enter the CAN channel information.


      Port CAN 1 is the onboard CAN interface of the Q.station X (additional CAN interfaces can be connected via USB).
      ID The base ID is max. 11 bit (Hex 7FF), and the extended ID is max. 29 bit (Hex 1FFFFFFF).
      Data format Defines the format of the data in the CAN message, this has to be a valid format to interpret the data correctly.
      Data bit start A CAN frame consists of max. 64-bit of data and can include multiple CAN messages (for example, 2x 8-bit, 1x 16-bit, and 1x 32-bit messages), with this parameter the start bit of the message to read into the CAN frame is defined.
      Data bit length The maximum bit length of a CAN message is defined by the selected CAN data format but can also be less, for example: if the CAN data format is 16-bit, 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.
      Data byte order The standard byte order of a CAN message is Little-endian (Intel), to switch the byte order select Big-endian (Motorola).
    5. When complete, click OK. Make sure to write any changes to the controller by clicking Write in the Configuration toolbar.