5.1.17. CANdb transmit message (pcx_CANdb_TransmitMessage)

Transmit a CAN message, the identifier and contents of which are defined by a Vector CANdb file.

5.1.17.1. Supported targets

All targets

5.1.17.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.17.3. Description

When a message is to be transmitted, the block encodes each of the signal inports into the message, as specified by the CANdb information, and transmits the message.

A CANdb file is a database of information regarding CAN nodes and CAN bus messages (more information regarding this format can be found by visiting the web site of Vector CANtech, Inc.). The database is edited using custom tools which make creation and maintenance of message information easier.

For each message, the database stores information like the message identifier, whether the identifier is standard or extended, what signals the message contains, etc.. For each signal, the database stores the start bit position, the bit length, bit ordering etc.. This block provides access to this information using the textual names assigned in the database, making the blocks easier to create and maintain (in contrast to the pcx_CANTransmitMessage block).

Warning

In some cases, the CAN database will contain messages with multiplexed signals (more than one signal is defined in a message with the same bit position and length). In order to use such a message, the user must pre-select only one of the signals to transmit. To do this, refer to Input All Message Signals?.

5.1.17.4. Inports

  • sim_error_flag

    A dummy input for simulation purposes only; may be grounded if not required. The value of outport error_flag in simulation.

    Value type:Boolean
    Calibratable:No
  • sim_request_count

    A dummy input for simulation purposes only; may be grounded if not required. The value of outport request_count in simulation. Only available if the mask parameter Provide Transmission Status is selected.

    Value type:Integer
  • sim_overwrite_count

    A dummy input for simulation purposes only; may be grounded if not required. The value of outport overwrite_count in simulation. Only available if the mask parameter Provide Transmission Status is selected.

    Value type:Integer
  • sim_ack_count

    A dummy input for simulation purposes only; may be grounded if not required. The value of outport ack_count in simulation. Only available if the mask parameter Provide Transmission Status is selected.

    Value type:Integer

5.1.17.5. Outports

  • error_flag

    Set to 1 if some error has occurred which prevents CAN transmission, otherwise set to 0.

    TypeConditions setting outport error_flag to 1
    run timethe message has been queued waiting for a transmit buffer to become available
    run timethe bus is in bus off state
    configurationthe bus has not been configured
    configurationmessage not configured, because too many transmit messages

    Value type:Boolean
    Calibratable:No
  • request_count

    A free running count of the application requests to transmit a message. The counter wraps to zero after reaching 65535. Only available if the mask parameter Provide Transmission Status is selected.

    Value type:Integer
  • overwrite_count

    A free running count of transmission requests which were queued by the software for later transmission because the CAN controller could not immediately accept the message for transmission. A queued message can be overwritten by subsequent attempts to transmit the same message (for instance, if the CAN bus is heavily loaded and the transmission rate high, the CAN controller may not be able to transmit the message before the application requests it is sent again, possibly with different data control from the previous request). The counter wraps to zero after reaching 65535. Only available if the mask parameter Provide Transmission Status is selected.

    Calibratable:No
  • ack_count

    A free running count of message transmissions successfully made by the CAN controller (i.e., those transmit messages which were acknowledged by at least one CAN node on the bus, not including the transmitting node). The counter wraps to zero after reaching 65535. Only available if the mask parameter Provide Transmission Status is selected.

    Value type:Integer

5.1.17.6. Mask parameters

  • CANdb file

    The name of the CANdb file, including extension. A path may be included, either relative or absolute, however the directory containing the file must be on the MATLAB search path. If more than one file has a matching (partial) path and filename, precedence is given firstly to the current MATLAB directory and then to the first location on the MATLAB search path.

    Only textual CANdb files are accepted (see restrictions in the notes section below).

    Value type:String
    Calibratable:No
  • Message Name

    The name of the message to transmit. The name must be specified in the CANdb file and must match case (e.g., message name EngineRPM is different from message name enginerpm).

    Value type:String
    Calibratable:No
  • Signal Names

    A comma separated list of signal names to pack into the message (e.g., "name1,name2" without the quotes). An empty list of names is supported, in which case the block shows no additional outports.

    Value type:String
    Calibratable:No
  • Input All Message Signals?

    If selected then all signals from the message are created as inports (similarly simulation outports if required), if unselected then only those signals in the signal names field are created as inports.

    If this field is ticked and the dialog closed, next time this field is unticked, the signal names field will contain the complete list of signals. This mechanism is useful when filling in the dialog for the first time but you are unsure of the field names (e.g., open block, fill in CANdb file name, message name and CAN bus, then tick this field, close the dialog, then select the block again, untick this field, then edit the list of required signals).

    Value type:Boolean
    Calibratable:No
  • Clip Signals To Engineering Limits?

    If selected then each signal shall be clipped to their engineering limits.

    Value type:Boolean
    Calibratable:No
  • Display Signal Units?

    If selected then each of the can message inport signals (and simulation outport signals) show their engineering units, if the CANdb file defines those units.

    Value type:Boolean
    Calibratable:No
  • CAN Bus Identifier

    Which can bus the message will be transmitted on.

    Value type:List
    Calibratable:No
  • Provide Transmission Status

    If selected then outports request_count, overwrite_count and ack_count, and their corresponding simulation inports, are made available.

    Value type:Boolean
    Calibratable:No
  • Checksum type

    A drop-down selection of the type of checksum to apply to the last raw byte in the message, computed over all of the preceding raw bytes in the message (even if they are not used by any signals). The default is None, and the other currently supported option is the 8-bit CRC defined by SAE-J1850.

    Value type:List
    Calibratable:No
  • Provide Simulation Output?

    If selected then dummy outports for each of the outport can message signals are provided by the block.

    Value type:Boolean
    Calibratable:No

5.1.17.7. Notes

  • Unused signals in a CAN message need not be specified in the Signal Names parameter.

  • Not all OpenECU modules have both CAN buses populated (see Section 1.1, “ECU hardware reference documentation” for details about each device).

  • If the block does not show expected signals as inports, it is likely that one or more of the block fields is incorrect. Check the fields for mistakes and correct them.

  • Vector do not release the file format of CANdb files, so this block reads CANdb files as best it can. When reading the CANdb file, if it cannot understand the file format, the block will not show the request inports. Update the diagram to find out what the problem is.

  • If the block does not show the signal inports expected, there is probably a mistake in the CANdb file name or one of the signal names. Update the diagram to find out what the error is.

  • The CANdb blocks do not support extended signal multiplexing. If extended signal multiplexing is present in the CANdb file, then the block will not be able to interpret the file.

  • The CANdb blocks do not support signals defined in the CANdb file as signal type "double"

  • The CANdb blocks do not support CANdb messages without signals. For these messages, use the pcx_CANTransmitMessage block.

  • Due to the internal design of the CANdb blocks, a loss of precision may occur when dealing with integer values greater than 23 bits in size. This error increases as the value of the signal increases beyond this limit. If integer precision is required, it is recommended that the pcx_CANTransmitMessage block be used and for any scaling/offset specified in the DBC to be implemented by the application.