Structure Definitions (struct)
This section describes the structure definitions of this product.
Definition List
| Structure Type Name | Description |
|---|---|
| StMPXAPIVersion | API version information |
| StMPXCoreVersion | MicroPeckerX version information |
| StMPXDeviceInfo | MicroPeckerX device information |
| StMPXCANParam | Parameter configuration information |
| StMPXCANLogCB | Callback log information |
| StMPXCANLog | Log information for log acquisition APIs |
| StMPXCANFrameOption | CAN/CAN FD frame option information |
| StMPXCANFrameType | CAN/CAN FD frame attribute information |
| StMPXCANID | CAN ID information |
| StMPXCANFrame | CAN/CAN FD frame information |
| StMPXCANSlot | Slot information |
| StMPXCANDirect | Direct transmission information |
| StMPXCANReplayLog | Log replay transmission information |
Definition Details
StMPXAPIVersion
Members of the StMPXAPIVersion structure (API version information) are as follows.
| Variable Name | Type Name | Description |
|---|---|---|
| APIVersion | char [32] | API version number |
StMPXCoreVersion
Members of the StMPXCoreVersion structure (MicroPeckerX version information) are as follows.
| Variable Name | Type Name | Description |
|---|---|---|
| BootVersion | char [16] | Boot version number |
| APPVersion | char [32] | APP version number |
| FPGAVersion | char [32] | FPGA-IP version number |
StMPXDeviceInfo
Members of the StMPXDeviceInfo structure (MicroPeckerX device information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| Serial | unsigned long | Serial number | Same as the serial number shown on the serial label attached to MicroPeckerX. |
| Model | char [64] | Product model name (example: S810-MX-FD2) |
StMPXCANParam
Members of the StMPXCANParam structure (parameter configuration information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| EnableTerminate | unsigned char | Termination resistor enable/disable | For setting values, see 終端抵抗有無. |
| Mode | unsigned char | Operation mode | For setting values, see 動作モード. |
| ArbitrationBaudrate | unsigned char | Arbitration baud rate | For setting values, see アービトレーションボーレート. |
| ArbitrationSamplepoint | unsigned char | Arbitration sample point | For setting values, see サンプルポイント. |
| DataBaudrate | unsigned char | Data baud rate | For setting values, see データボーレート. |
| DataSamplepoint | unsigned char | Data sample point | For setting values, see サンプルポイント. |
| Reserved | unsigned char [2] | Reserved area |
StMPXCANLogCB
Members of the StMPXCANLogCB structure (callback log information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| mSec | unsigned long | Timestamp (milliseconds) | Timestamp values are represented by combining mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | unsigned short | Timestamp (microseconds) | |
| LogType | unsigned char | Log type | Bit-field structure (see LogType). |
| DL | unsigned char | Data length | Bit-field structure (see DL). |
| CAN | unsigned long | CAN information | Union of ID (ID information) and ErrorInfo (error information).When handled as ErrorInfo, it is unsigned long (see エラー情報).When handled as ID, it is a bit-field structure (see ID). |
| Data | unsigned char [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
StMPXCANLog
Members of the StMPXCANLog structure (log information for log acquisition APIs) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| mSec | unsigned long | Timestamp (milliseconds) | Timestamp values are represented by combining mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | unsigned short | Timestamp (microseconds) | |
| Protocol | unsigned char | Protocol | For value meanings, see ログ種別. |
| Dir | unsigned char | Direction | For value meanings, see ログ方向. |
| ID | unsigned long | CAN ID (standard ID or extended ID) | For a standard ID, use the lower 11 bits (bit 10 to bit 0). |
| RTR | unsigned char | Remote transmission request (RTR) | For value meanings, see リモート送信要求. |
| IDE | unsigned char | ID format (IDE) | For value meanings, see IDフォーマット. |
| DL | unsigned char | Data length (DL) | |
| Error | unsigned char | Error flag | For value meanings, see エラーフラグ. |
| ErrorInfo | unsigned long | Error information | For value meanings, see エラー情報. |
| Data | unsigned char [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
StMPXCANFrameOption
Members of the StMPXCANFrameOption structure (CAN/CAN FD frame option information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| Protocol | unsigned char | Protocol | For setting values, see プロトコル. |
| BRS | unsigned char | Bit rate switch (BRS) | For setting values, see ビットレートスイッチ. |
| ErrorAction | unsigned char | Error behavior | For setting values, see エラーの振る舞い. |
| Reserved | unsigned char | Reserved area |
StMPXCANFrameType
Members of the StMPXCANFrameType structure (CAN/CAN FD frame attribute information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| isOneShot | unsigned char | One-shot transmission enable/disable | For setting values, see ワンショット送信有効/無効. |
| FrameType | unsigned char | Frame type | For setting values, see フレーム種別. |
| Enabled | unsigned char | Slot enable/disable | For setting values, see スロット有効/無効. |
| isLastData | unsigned char | Final frame determination | Valid only when operation mode is log replay mode or burst transfer mode (log replay). For setting values, see 最終フレーム判定. |
| Option | StMPXCANFrameOption | CAN/CAN FD frame option information |
StMPXCANID
Members of the StMPXCANID structure (CAN ID information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| ID | unsigned long | CAN ID (standard ID or extended ID) | For a standard ID, set the lower 11 bits (bit 10 to bit 0). |
| RTR | unsigned char | Remote transmission request (RTR) | For setting values, see リモート送信要求. |
| IDE | unsigned char | ID format (IDE) | For setting values, see IDフォーマット. |
| Reserved | unsigned char [2] | Reserved area |
StMPXCANFrame
Members of the StMPXCANFrame structure (CAN/CAN FD frame information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| ID | StMPXCANID | CAN ID information | |
| DL | unsigned char | Data length (DL) | |
| Reserved | unsigned char [3] | Reserved area | |
| Data | unsigned char [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
StMPXCANSlot
Members of the StMPXCANSlot structure (slot information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| SlotNo | unsigned char | Slot number (1 to 28) | |
| TriggerType | unsigned char | Transmission trigger type | For setting values, see トリガ種別. |
| Reserved1 | unsigned char [2] | Reserved area | |
| FrameType | StMPXCANFrameType | Frame attribute information | |
| TriggerID | StMPXCANID | Reception trigger ID | |
| msSendDelay | unsigned long | Delay time for event transmission (milliseconds) | Delay time for event transmission, transmission offset, transmission cycle, and minimum guaranteed transmission interval are represented by combining each pair below. [Delay time for event transmission] msSendDelay, usSendDelay[Transmission offset] msSendOffset, usSendOffset[Transmission cycle] msSendCycle, usSendCycle[Minimum guaranteed transmission interval] usMinTransInterval, usMinTransIntervalFor example, to set 12.345 ms (12 ms and 345 us) for transmission offset, set msSendOffset = 12 and usSendOffset = 345. |
| msSendOffset | unsigned long | Transmission offset (milliseconds) | |
| msSendCycle | unsigned long | Transmission cycle (milliseconds) | |
| msMinTransInterval | unsigned long | Minimum guaranteed transmission interval (milliseconds) | |
| usSendDelay | unsigned short | Delay time for event transmission (microseconds) | |
| usSendOffset | unsigned short | Transmission offset (microseconds) | |
| usSendCycle | unsigned short | Transmission cycle (microseconds) | |
| usMinTransInterval | unsigned short | Minimum guaranteed transmission interval (microseconds) | |
| SendCounter | unsigned short | Transmission count | If set to 0, transmissions are unlimited. |
| Reserved2 | unsigned char [2] | Reserved area | |
| Frame | StMPXCANFrame | Transmission frame information | |
| Increment | unsigned char [64] | Increment enabled/disabled | Array indexes 0 to 63 correspond to data bytes D1 to D64.For setting values, see インクリメント有無. |
StMPXCANDirect
Members of the StMPXCANDirect structure (direct transmission information) are as follows.
| Variable Name | Type Name | Description |
|---|---|---|
| FrameType | StMPXCANFrameType | Frame attribute information |
| Frame | StMPXCANFrame | Transmission frame information |
StMPXCANReplayLog
Members of the StMPXCANReplayLog structure (log replay transmission information) are as follows.
| Variable Name | Type Name | Description | Remarks |
|---|---|---|---|
| mSec | unsigned long | Timestamp (milliseconds) | Timestamp values are represented by combining mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | unsigned short | Timestamp (microseconds) | |
| ID | unsigned long | ID information | Bit-field structure (see ID). |
| DL | unsigned char | Data length (DL) | Bit-field structure (see DL). |
| FrameType | unsigned char | Frame attribute information | Bit-field structure (see FrameType). |
| Data | unsigned char [64] | Data (D1 to D64) | Array indexes 0 to 63 correspond to data bytes D1 to D64. |
Supplementary Information
Bit-field Structures
LogType
LogType is a bit-field structure of type unsigned char.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| Type | 6 | Log type | For value meanings, see ログ種別. |
| Dir | 1 | Direction | For value meanings, see ログ方向. |
| Error | 1 | Error flag | For value meanings, see エラーフラグ. |
DL
DL is a bit-field structure of type unsigned char.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| NotUsed | 4 | Not used | |
| DLC | 4 | Data length code (DLC) | For the relation between DLC and data length, see Data Length Code and Data Length. |
ID
ID is a bit-field structure of type unsigned long.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| ID | 29 | CAN ID (standard ID or extended ID) | For a standard ID, use the lower 11 bits (bit 10 to bit 0). |
| Reserved | 1 | Reserved area | |
| RTR | 1 | Remote transmission request (RTR) | For value meanings, see リモート送信要求. |
| IDE | 1 | ID format (IDE) | For value meanings, see IDフォーマット. |
FrameType
FrameType is a bit-field structure of type unsigned char.
Members are as follows.
| Variable Name | Bit Count | Description | Remarks |
|---|---|---|---|
| ErrorPassive | 1 | Error behavior | For setting values, see エラーの振る舞い. |
| BRS | 1 | Bit rate switch (BRS) | For setting values, see ビットレートスイッチ. |
| FDF | 1 | FD format (FDF) | For setting values, see FDフォーマット. |
| Terminator | 1 | Final frame determination | For setting values, see 最終フレーム判定. |
| Reserved | 4 | Not used (reserved area) |
Data Length Code and Data Length
The relation between data length code (DLC) and data length (DL) is as follows.
| Data Length Code | Data 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 |