Skip to main content

Structure Definitions (CAN)

This section describes CAN-related structure definitions for this product.

Main APIs

Definition List

Type NameDescription
StMPXCANParamCAN parameter setting information
StMPXCANLogLog information for CAN log acquisition API
StMPXCANFrameOptionCAN frame option information
StMPXCANFrameTypeCAN frame attribute information
StMPXCANIDCAN ID information
StMPXCANFrameCAN frame information
StMPXCANSlotCAN slot information
StMPXCANDirectCAN direct transmission information

Definition Details

StMPXCANParam

Members of StMPXCANParam (CAN parameter setting information) are as follows.

VariableTypeDescriptionNotes
EnableTerminateunsigned charTermination resistor enable/disableSee CAN Termination Resistor.
Modeunsigned charOperation modeSee CAN Operation Mode.
ArbitrationBaudrateunsigned charArbitration baudrateSee CAN Arbitration Baudrate.
ArbitrationSamplepointunsigned charArbitration sample pointSee CAN Sample Point.
DataBaudrateunsigned charData baudrateSee CAN Data Baudrate.
DataSamplepointunsigned charData sample pointSee CAN Sample Point.
Reservedunsigned char [2]Reserved 
tip

Available sample points depend on the combination of arbitration baudrate and data baudrate.
For details, see Baudrate and Sample Point Settings.

StMPXCANLog

Members of StMPXCANLog (log information for CAN log acquisition API) are as follows.

VariableTypeDescriptionNotes
mSecunsigned longTimestamp (milliseconds)Timestamp is represented by combining mSec and uSec.
For example, for 12.345 ms (12 ms + 345 us), mSec is 12 and uSec is 345.
uSecunsigned shortTimestamp (microseconds)
Protocolunsigned charProtocolSee Log Type.
Dirunsigned charDirectionSee Log Direction.
IDunsigned longCAN ID (standard or extended)For standard ID, set in lower 11 bits (bit10 to bit0).
RTRunsigned charRemote Transmission Request (RTR)See CAN RTR.
IDEunsigned charID format (IDE)See CAN ID Format.
DLunsigned charData length (DL)
Errorunsigned charError flagSee CAN Error Flag.
ErrorInfounsigned longError informationSee CAN Error Information.
Dataunsigned char [64]DataElement indices 0 to 63 correspond to D1 to D64.

StMPXCANFrameOption

Members of StMPXCANFrameOption (CAN frame option information) are as follows.

VariableTypeDescriptionNotes
Protocolunsigned charProtocolSee CAN Protocol.
BRSunsigned charBit Rate Switch (BRS)See CAN Bit Rate Switch.
ErrorActionunsigned charError behaviorSee CAN Error Behavior.
Reservedunsigned charReserved

StMPXCANFrameType

Members of StMPXCANFrameType (CAN frame attribute information) are as follows.

VariableTypeDescriptionNotes
isOneShotunsigned charOne-shot transmission enable/disableSee CAN One-shot Transmission.
FrameTypeunsigned charFrame typeSee CAN Frame Type.
Enabledunsigned charSlot enable/disableSee CAN Slot Enable/Disable.
Reservedunsigned charReserved 
OptionStMPXCANFrameOptionCAN frame option information 

StMPXCANID

Members of StMPXCANID (CAN ID information) are as follows.

VariableTypeDescriptionNotes
IDunsigned longCAN ID (standard or extended)For standard ID, set lower 11 bits (bit10 to bit0).
RTRunsigned charRemote Transmission Request (RTR)See CAN RTR.
IDEunsigned charID format (IDE)See CAN ID Format.
Reservedunsigned char [2]Reserved 

StMPXCANFrame

Members of StMPXCANFrame (CAN frame information) are as follows.

VariableTypeDescriptionNotes
IDStMPXCANIDCAN ID information 
DLunsigned charData length (DL)Available values are 0 to 8, 12, 16, 20, 24, 32, 48, and 64.
Reservedunsigned char [3]Reserved 
Dataunsigned char [64]Data (D1 to D64)Element indices 0 to 63 correspond to D1 to D64.

StMPXCANSlot

Members of StMPXCANSlot (slot information) are as follows.

VariableTypeDescriptionNotes
SlotNounsigned charSlot number (1 to 28)
TriggerTypeunsigned charTransmission trigger typeSee CAN Transmission Trigger Type.
Reserved1unsigned char [2]Reserved
FrameTypeStMPXCANFrameTypeCAN frame attribute information
TriggerIDStMPXCANIDReception trigger ID
msSendDelayunsigned longDelay for event transmission (ms)Delay for event transmission, transmit offset, transmit cycle, and minimum guaranteed transmit interval are represented as follows.
[Delay for event transmission] msSendDelay, usSendDelay
[Transmit offset] msSendOffset, usSendOffset
[Transmit cycle] msSendCycle, usSendCycle
[Minimum guaranteed transmit interval] msMinTransInterval, usMinTransInterval
For example, to set transmit offset to 12.345 ms (12 ms + 345 us), set msSendOffset=12 and usSendOffset=345.
msSendOffsetunsigned longTransmit offset (ms)
msSendCycleunsigned longTransmit cycle (ms)
msMinTransIntervalunsigned longMinimum guaranteed transmit interval (ms)
usSendDelayunsigned shortDelay for event transmission (us)
usSendOffsetunsigned shortTransmit offset (us)
usSendCycleunsigned shortTransmit cycle (us)
usMinTransIntervalunsigned shortMinimum guaranteed transmit interval (us)
SendCounterunsigned shortTransmission countIf set to 0, transmission count is unlimited.
Reserved2unsigned char [2]Reserved
FrameStMPXCANFrameCAN frame information
Incrementunsigned char [64]Increment enabled/disabledElement indices 0 to 63 correspond to D1 to D64.
See CAN Increment Enable/Disable.

StMPXCANDirect

Members of StMPXCANDirect (CAN direct transmission information) are as follows.

VariableTypeDescription
FrameTypeStMPXCANFrameTypeCAN frame attribute information
FrameStMPXCANFrameCAN frame information