Skip to main content

Structure Definitions (struct)

This chapter explains the structure definitions provided by this product.

List of Structures

Structure typeDescription
StMPXAPIVersionAPI version information
StMPXCoreVersionMicroPeckerX version information
StMPXDeviceInfoMicroPeckerX device information
StMPXCANParamParameter settings
StMPXCANLogCBLog information for callbacks
StMPXCANLogLog information for API mode
StMPXCANFrameOptionCAN/CAN FD frame option
StMPXCANFrameTypeCAN/CAN FD frame attributes
StMPXCANIDCAN ID information
StMPXCANFrameCAN/CAN FD frame information
StMPXCANSlotSlot information
StMPXCANDirectDirect transmission information
StMPXCANReplayLogLog replay transmission information

Structure Details

StMPXAPIVersion

Members of the StMPXAPIVersion structure (API version information) are listed below.

MemberTypeDescription
APIVersionint8_t [32]API version number

StMPXCoreVersion

Members of the StMPXCoreVersion structure (MicroPeckerX version information) are listed below.

MemberTypeDescription
BootVersionint8_t [16]Boot version number
APPVersionint8_t [32]APP version number
FPGAVersionint8_t [32]FPGA-IP version number

StMPXDeviceInfo

Members of the StMPXDeviceInfo structure (MicroPeckerX device information) are listed below.

MemberTypeDescriptionNotes
Serialuint32_tSerial numberMatches the serial number printed on the label attached to the MicroPeckerX unit.
Modelint8_t [64]Product model (example: S810-MX-FD2)

StMPXCANParam

Members of the StMPXCANParam structure (parameter settings) are listed below.

MemberTypeDescriptionNotes
EnableTerminateuint8_tTermination resistor settingSee Termination Resistor for possible values.
Modeuint8_tOperation modeSee Operation Modes for possible values.
ArbitrationBaudrateuint8_tArbitration baud rateSee Arbitration Baud Rates for possible values.
ArbitrationSamplepointuint8_tArbitration sample pointSee Sample Points for possible values.
DataBaudrateuint8_tData baud rateSee Data Baud Rates for possible values.
DataSamplepointuint8_tData sample pointSee Sample Points for possible values.
Reserveduint8_t [2]Reserved

StMPXCANLogCB

Members of the StMPXCANLogCB structure (log information for callbacks) are listed below.

MemberTypeDescriptionNotes
mSecuint32_tTimestamp (milliseconds)Combine mSec and uSec to represent the timestamp.
For example, for 12.345 ms (12 ms and 345 μs), mSec is 12 and uSec is 345.
uSecuint16_tTimestamp (microseconds)
LogTypeuint8_tLog typeThis is a bitfield structure. See LogType for details.
DLuint8_tData lengthThis is a bitfield structure. See DL for details.
CANuint32_tCAN informationThis is a union of ID information and error information.
When used as error information, it is a uint32_t value (see Error Information).
When used as ID information, it is a bitfield structure (see ID).
Datauint8_t [64]Data (D1 to D64)Array elements 0–63 correspond to data bytes D1–D64.

StMPXCANLog

Members of the StMPXCANLog structure (log information for API mode) are listed below.

MemberTypeDescriptionNotes
mSecuint32_tTimestamp (milliseconds)Combine mSec and uSec to represent the timestamp.
For example, for 12.345 ms (12 ms and 345 μs), mSec is 12 and uSec is 345.
uSecuint16_tTimestamp (microseconds)
Protocoluint8_tProtocolSee Log Types for the meaning of the values.
Diruint8_tDirectionSee Log Direction for the meaning of the values.
IDuint32_tCAN ID (standard or extended)For a standard ID, set bits 0–10 (the lower 11 bits).
RTRuint8_tRemote transmission request (RTR)See Remote Transmission Request for the meaning of the values.
IDEuint8_tID format (IDE)See ID Format for the meaning of the values.
DLuint8_tData length (DL)
Erroruint8_tError flagSee Error Flag for the meaning of the values.
ErrorInfouint32_tError informationSee Error Information for the meaning of the values.
Datauint8_t [64]Data (D1 to D64)Array elements 0–63 correspond to data bytes D1–D64.

StMPXCANFrameOption

Members of the StMPXCANFrameOption structure (CAN/CAN FD frame option information) are listed below.

MemberTypeDescriptionNotes
Protocoluint8_tProtocolSee Protocols for possible values.
BRSuint8_tBit rate switch (BRS)See Bit Rate Switch for possible values.
ErrorActionuint8_tError behaviorSee Error Behavior for possible values.
Reserveduint8_tReserved

StMPXCANFrameType

Members of the StMPXCANFrameType structure (CAN/CAN FD frame attributes) are listed below.

MemberTypeDescriptionNotes
isOneShotuint8_tOne-shot transmission enablementSee One-Shot Transmission for possible values.
FrameTypeuint8_tFrame typeSee Frame Types for possible values.
Enableduint8_tSlot enablementSee Slot Enablement for possible values.
isLastDatauint8_tFinal frame flagEffective only when the operation mode is log replay mode or burst transfer mode (log replay).
See Final Frame Flag for possible values.
OptionStMPXCANFrameOptionCAN/CAN FD frame option information

StMPXCANID

Members of the StMPXCANID structure (CAN ID information) are listed below.

MemberTypeDescriptionNotes
IDuint32_tCAN ID (standard or extended)For a standard ID, set bits 0–10 (the lower 11 bits).
RTRuint8_tRemote transmission request (RTR)See Remote Transmission Request for possible values.
IDEuint8_tID format (IDE)See ID Format for possible values.
Reserveduint8_t [2]Reserved

StMPXCANFrame

Members of the StMPXCANFrame structure (CAN/CAN FD frame information) are listed below.

MemberTypeDescriptionNotes
IDStMPXCANIDCAN ID information
DLuint8_tData length (DL)
Reserveduint8_t [3]Reserved
Datauint8_t [64]Data (D1 to D64)Array elements 0–63 correspond to data bytes D1–D64.

StMPXCANSlot

Members of the StMPXCANSlot structure (slot information) are listed below.

MemberTypeDescriptionNotes
SlotNouint8_tSlot number (1–28)
TriggerTypeuint8_tTransmission trigger typeSee Trigger Types for possible values.
Reserved1uint8_t [2]Reserved
FrameTypeStMPXCANFrameTypeFrame attribute information
TriggerIDStMPXCANIDReceive trigger ID
msSendDelayuint32_tDelay time for event transmissions (milliseconds)The delay time, offset, period, and minimum guaranteed interval are each represented by a combination of the following members.
Delay time: msSendDelay, usSendDelay
Offset: msSendOffset, usSendOffset
Period: msSendCycle, usSendCycle
Minimum interval: msMinTransInterval, usMinTransInterval
For example, to set a transmission offset of 12.345 ms (12 ms and 345 μs), set msSendOffset to 12 and usSendOffset to 345.
msSendOffsetuint32_tTransmission offset (milliseconds)
msSendCycleuint32_tTransmission period (milliseconds)
msMinTransIntervaluint32_tMinimum guaranteed interval (milliseconds)
usSendDelayuint16_tDelay time for event transmissions (microseconds)
usSendOffsetuint16_tTransmission offset (microseconds)
usSendCycleuint16_tTransmission period (microseconds)
usMinTransIntervaluint16_tMinimum guaranteed interval (microseconds)
SendCounteruint16_tNumber of transmissionsSetting 0 allows unlimited transmissions.
Reserved2uint8_t [2]Reserved
FrameStMPXCANFrameFrame information for transmission
Incrementuint8_t [64]Increment settingArray elements 0–63 correspond to data bytes D1–D64.
See Increment Setting for possible values.

StMPXCANDirect

Members of the StMPXCANDirect structure (direct transmission information) are listed below.

MemberTypeDescription
FrameTypeStMPXCANFrameTypeFrame attribute information
FrameStMPXCANFrameFrame information for transmission

StMPXCANReplayLog

Members of the StMPXCANReplayLog structure (log replay transmission information) are listed below.

MemberTypeDescriptionNotes
mSecuint32_tTimestamp (milliseconds)Combine mSec and uSec to represent the timestamp.
For example, for 12.345 ms (12 ms and 345 μs), mSec is 12 and uSec is 345.
uSecuint16_tTimestamp (microseconds)
IDuint32_tID informationThis is a bitfield structure. See ID for details.
DLuint8_tData length (DL)This is a bitfield structure. See DL for details.
FrameTypeuint8_tFrame attribute informationThis is a bitfield structure. See FrameType for details.
Datauint8_t [64]Data (D1 to D64)Array elements 0–63 correspond to data bytes D1–D64.

Additional Information

Bitfield Structures

LogType

LogType is a bitfield structure of type uint8_t.
Its members are listed below.

MemberBitsDescriptionNotes
Type6Log typeSee Log Types for the meaning of the values.
Dir1DirectionSee Log Direction for the meaning of the values.
Error1Error flagSee Error Flag for the meaning of the values.

DL

DL is a bitfield structure of type uint8_t.
Its members are listed below.

MemberBitsDescriptionNotes
NotUsed4Not used
DLC4Data length code (DLC)For the relationship between data length codes and data lengths, see Data Length Codes and Data Lengths.

ID

ID is a bitfield structure of type uint32_t.
Its members are listed below.

MemberBitsDescriptionNotes
ID29CAN ID (standard or extended)For a standard ID, set bits 0–10 (the lower 11 bits).
Reserved1Reserved
RTR1Remote transmission request (RTR)See Remote Transmission Request for the meaning of the values.
IDE1ID format (IDE)See ID Format for the meaning of the values.

FrameType

FrameType is a bitfield structure of type uint8_t.
Its members are listed below.

MemberBitsDescriptionNotes
ErrorPassive1Error behaviorSee Error Behavior for possible values.
BRS1Bit rate switch (BRS)See Bit Rate Switch for possible values.
FDF1FD format (FDF)See FD Format for possible values.
Terminator1Final frame flagSee Final Frame Flag for possible values.
Reserved4Not used (reserved)

Data Length Codes and Data Lengths

The relationship between data length codes (DLC) and data lengths (DL) is shown below.

Data length codeData length
0 (0x0)0
1 (0x1)1
2 (0x2)2
3 (0x3)3
4 (0x4)4
5 (0x5)5
6 (0x6)6
7 (0x7)7
8 (0x8)8
9 (0x9)12
10 (0xA)16
11 (0xB)20
12 (0xC)24
13 (0xD)32
14 (0xE)48
15 (0xF)64