Structure Definitions (CAN)
This section describes CAN-related structure definitions for this product.
Main APIs
- StMPXCANParam: MPXCANSetParam
- StMPXCANLog: MPXCANGetLogEx
- StMPXCANSlot: MPXCANSetSlot
- StMPXCANFrame: MPXCANChangeSlot
- StMPXCANDirect: MPXCANDirectSend
Definition List
| Type Name | Description |
|---|---|
| StMPXCANParam | CAN parameter setting information |
| StMPXCANLog | Log information for CAN log acquisition API |
| StMPXCANFrameOption | CAN frame option information |
| StMPXCANFrameType | CAN frame attribute information |
| StMPXCANID | CAN ID information |
| StMPXCANFrame | CAN frame information |
| StMPXCANSlot | CAN slot information |
| StMPXCANDirect | CAN direct transmission information |
Definition Details
StMPXCANParam
Members of StMPXCANParam (CAN parameter setting information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| EnableTerminate | unsigned char | Termination resistor enable/disable | See CAN Termination Resistor. |
| Mode | unsigned char | Operation mode | See CAN Operation Mode. |
| ArbitrationBaudrate | unsigned char | Arbitration baudrate | See CAN Arbitration Baudrate. |
| ArbitrationSamplepoint | unsigned char | Arbitration sample point | See CAN Sample Point. |
| DataBaudrate | unsigned char | Data baudrate | See CAN Data Baudrate. |
| DataSamplepoint | unsigned char | Data sample point | See CAN Sample Point. |
| Reserved | unsigned char [2] | Reserved |
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.
| Variable | Type | Description | Notes |
|---|---|---|---|
| mSec | unsigned long | Timestamp (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. |
| uSec | unsigned short | Timestamp (microseconds) | |
| Protocol | unsigned char | Protocol | See Log Type. |
| Dir | unsigned char | Direction | See Log Direction. |
| ID | unsigned long | CAN ID (standard or extended) | For standard ID, set in lower 11 bits (bit10 to bit0). |
| RTR | unsigned char | Remote Transmission Request (RTR) | See CAN RTR. |
| IDE | unsigned char | ID format (IDE) | See CAN ID Format. |
| DL | unsigned char | Data length (DL) | |
| Error | unsigned char | Error flag | See CAN Error Flag. |
| ErrorInfo | unsigned long | Error information | See CAN Error Information. |
| Data | unsigned char [64] | Data | Element indices 0 to 63 correspond to D1 to D64. |
StMPXCANFrameOption
Members of StMPXCANFrameOption (CAN frame option information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| Protocol | unsigned char | Protocol | See CAN Protocol. |
| BRS | unsigned char | Bit Rate Switch (BRS) | See CAN Bit Rate Switch. |
| ErrorAction | unsigned char | Error behavior | See CAN Error Behavior. |
| Reserved | unsigned char | Reserved |
StMPXCANFrameType
Members of StMPXCANFrameType (CAN frame attribute information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| isOneShot | unsigned char | One-shot transmission enable/disable | See CAN One-shot Transmission. |
| FrameType | unsigned char | Frame type | See CAN Frame Type. |
| Enabled | unsigned char | Slot enable/disable | See CAN Slot Enable/Disable. |
| Reserved | unsigned char | Reserved | |
| Option | StMPXCANFrameOption | CAN frame option information |
StMPXCANID
Members of StMPXCANID (CAN ID information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | unsigned long | CAN ID (standard or extended) | For standard ID, set lower 11 bits (bit10 to bit0). |
| RTR | unsigned char | Remote Transmission Request (RTR) | See CAN RTR. |
| IDE | unsigned char | ID format (IDE) | See CAN ID Format. |
| Reserved | unsigned char [2] | Reserved |
StMPXCANFrame
Members of StMPXCANFrame (CAN frame information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | StMPXCANID | CAN ID information | |
| DL | unsigned char | Data length (DL) | Available values are 0 to 8, 12, 16, 20, 24, 32, 48, and 64. |
| Reserved | unsigned char [3] | Reserved | |
| Data | unsigned 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.
| Variable | Type | Description | Notes |
|---|---|---|---|
| SlotNo | unsigned char | Slot number (1 to 28) | |
| TriggerType | unsigned char | Transmission trigger type | See CAN Transmission Trigger Type. |
| Reserved1 | unsigned char [2] | Reserved | |
| FrameType | StMPXCANFrameType | CAN frame attribute information | |
| TriggerID | StMPXCANID | Reception trigger ID | |
| msSendDelay | unsigned long | Delay 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, usMinTransIntervalFor example, to set transmit offset to 12.345 ms (12 ms + 345 us), set msSendOffset=12 and usSendOffset=345. |
| msSendOffset | unsigned long | Transmit offset (ms) | |
| msSendCycle | unsigned long | Transmit cycle (ms) | |
| msMinTransInterval | unsigned long | Minimum guaranteed transmit interval (ms) | |
| usSendDelay | unsigned short | Delay for event transmission (us) | |
| usSendOffset | unsigned short | Transmit offset (us) | |
| usSendCycle | unsigned short | Transmit cycle (us) | |
| usMinTransInterval | unsigned short | Minimum guaranteed transmit interval (us) | |
| SendCounter | unsigned short | Transmission count | If set to 0, transmission count is unlimited. |
| Reserved2 | unsigned char [2] | Reserved | |
| Frame | StMPXCANFrame | CAN frame information | |
| Increment | unsigned char [64] | Increment enabled/disabled | Element 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.
| Variable | Type | Description |
|---|---|---|
| FrameType | StMPXCANFrameType | CAN frame attribute information |
| Frame | StMPXCANFrame | CAN frame information |