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
APIVersionchar [32]API version number

StMPXCoreVersion

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

MemberTypeDescription
BootVersionchar [16]Boot version number
APPVersionchar [32]APP version number
FPGAVersionchar [32]FPGA-IP version number

StMPXDeviceInfo

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

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

StMPXCANParam

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

MemberTypeDescriptionNotes
EnableTerminateunsigned charTermination resistor settingSee Termination Resistor for possible values.
Modeunsigned charOperation modeSee Operation Modes for possible values.
ArbitrationBaudrateunsigned charArbitration baud rateSee Arbitration Baud Rates for possible values.
ArbitrationSamplepointunsigned charArbitration sample pointSee Sample Points for possible values.
DataBaudrateunsigned charData baud rateSee Data Baud Rates for possible values.
DataSamplepointunsigned charData sample pointSee Sample Points for possible values.
Reservedunsigned char [2]Reserved

StMPXCANLogCB

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

MemberTypeDescriptionNotes
mSecunsigned longTimestamp (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.
uSecunsigned shortTimestamp (microseconds)
LogTypeunsigned charLog typeThis is a bitfield structure. See LogType for details.
DLunsigned charData lengthThis is a bitfield structure. See DL for details.
CANunsigned longCAN informationThis is a union of ID information and error information.
When used as error information, it is a unsigned long value (see Error Information).
When used as ID information, it is a bitfield structure (see ID).
Dataunsigned char [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
mSecunsigned longTimestamp (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.
uSecunsigned shortTimestamp (microseconds)
Protocolunsigned charProtocolSee Log Types for the meaning of the values.
Dirunsigned charDirectionSee Log Direction for the meaning of the values.
IDunsigned longCAN ID (standard or extended)For a standard ID, set bits 0–10 (the lower 11 bits).
RTRunsigned charRemote transmission request (RTR)See Remote Transmission Request for the meaning of the values.
IDEunsigned charID format (IDE)See ID Format for the meaning of the values.
DLunsigned charData length (DL)
Errorunsigned charError flagSee Error Flag for the meaning of the values.
ErrorInfounsigned longError informationSee Error Information for the meaning of the values.
Dataunsigned char [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
Protocolunsigned charProtocolSee Protocols for possible values.
BRSunsigned charBit rate switch (BRS)See Bit Rate Switch for possible values.
ErrorActionunsigned charError behaviorSee Error Behavior for possible values.
Reservedunsigned charReserved

StMPXCANFrameType

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

MemberTypeDescriptionNotes
isOneShotunsigned charOne-shot transmission enablementSee One-Shot Transmission for possible values.
FrameTypeunsigned charFrame typeSee Frame Types for possible values.
Enabledunsigned charSlot enablementSee Slot Enablement for possible values.
isLastDataunsigned charFinal 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
IDunsigned longCAN ID (standard or extended)For a standard ID, set bits 0–10 (the lower 11 bits).
RTRunsigned charRemote transmission request (RTR)See Remote Transmission Request for possible values.
IDEunsigned charID format (IDE)See ID Format for possible values.
Reservedunsigned char [2]Reserved

StMPXCANFrame

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

MemberTypeDescriptionNotes
IDStMPXCANIDCAN ID information
DLunsigned charData length (DL)
Reservedunsigned char [3]Reserved
Dataunsigned char [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
SlotNounsigned charSlot number (1–28)
TriggerTypeunsigned charTransmission trigger typeSee Trigger Types for possible values.
Reserved1unsigned char [2]Reserved
FrameTypeStMPXCANFrameTypeFrame attribute information
TriggerIDStMPXCANIDReceive trigger ID
msSendDelayunsigned longDelay 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.
msSendOffsetunsigned longTransmission offset (milliseconds)
msSendCycleunsigned longTransmission period (milliseconds)
msMinTransIntervalunsigned longMinimum guaranteed interval (milliseconds)
usSendDelayunsigned shortDelay time for event transmissions (microseconds)
usSendOffsetunsigned shortTransmission offset (microseconds)
usSendCycleunsigned shortTransmission period (microseconds)
usMinTransIntervalunsigned shortMinimum guaranteed interval (microseconds)
SendCounterunsigned shortNumber of transmissionsSetting 0 allows unlimited transmissions.
Reserved2unsigned char [2]Reserved
FrameStMPXCANFrameFrame information for transmission
Incrementunsigned char [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
mSecunsigned longTimestamp (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.
uSecunsigned shortTimestamp (microseconds)
IDunsigned longID informationThis is a bitfield structure. See ID for details.
DLunsigned charData length (DL)This is a bitfield structure. See DL for details.
FrameTypeunsigned charFrame attribute informationThis is a bitfield structure. See FrameType for details.
Dataunsigned char [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 unsigned char.
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 unsigned char.
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 unsigned long.
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 unsigned char.
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