Skip to main content

API Details (LIN)

This page describes details of LIN-specific APIs available in this product.

Read This First​

API Quick Reference (Constants / Structures / Preconditions / Minimal Examples)​

APIConstants used by this APIStructures used by this APICallable precondition statusMinimal code examples (C++/C#/VBA)
MPXLINSetParamLIN Operation Mode, LIN RevisionStMPXLINParamRUNLIN Monitor (G++), LIN Master (G++), LIN Slave (G++), LIN Monitor (Python), LIN Master (Python), LIN Slave (Python)
MPXLINGetLogExBuffer Overrun PresenceStMPXLINLogNONE/MON/SIMLIN Monitor (G++)
MPXLINSetStatusLIN Status-PARAM/SYNC/SIMLIN Master (G++), LIN Slave (G++)
MPXLINSetMasterSimLIN Frame TypeStMPXLINMasterSimPARAM/SYNCLIN Master (G++)
MPXLINSetMasterItemLIN Simulation Enable/Disable-SIMLIN Master (G++)
MPXLINChangeMasterItemLIN Frame TypeStMPXLINMasterSimItemSIMLIN Master (G++)
MPXLINSetMasterScheduleLIN Simulation Enable/Disable-PARAM/SYNC/SIMLIN Master (G++)
MPXLINChangeMasterScheduleAPI Return Values-PARAM/SYNC/SIMLIN Master (G++)
MPXLINPauseMasterScheduleLIN Simulation Enable/Disable-SIMLIN Master (G++)
MPXLINMasterInterruptLIN Frame TypeStMPXLINMasterSimItemSIMLIN Master (G++)
MPXLINSetSlaveSimLIN Frame TypeStMPXLINSlaveSimPARAM/SYNCLIN Slave (G++)
MPXLINSetSlaveItemLIN Simulation Enable/Disable-SIMLIN Slave (G++)
MPXLINChangeSlaveItemLIN Frame TypeStMPXLINSlaveSimItemSIMLIN Slave (G++)
MPXLINSlaveWakeupLIN Frame Type-SIMLIN Slave (G++)

Notation​

On this page, each API is described in the following format.

Format[Function type] [Function name]([argument], ...)
Argument[Argument type][Argument name][in/out][Argument description]
Return value[Return type][Return value (error code)][Description of return value (error code)]
Function[Function behavior]
Note[Supplementary information]

If an argument type is a structure, refer to Structure Definitions (struct) (LIN) and Structure Definitions (struct) (common).

For [in/out], in means set by caller before invocation, and out means set by the function during processing.

API Details​

MPXLINSetParam​

Sets LIN communication parameters.

FormatER MPXLINSetParam(uint32_t Serial, StMPXLINParam * Param)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
StMPXLINParam *ParaminPointer to parameter setting structure
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionSets LIN communication parameters for CH1 of the MicroPeckerX device specified by Serial using values in Param.
NoteCalling this API changes MicroPeckerX status to MPX_STATUS_PARAM (waiting for parameter configuration).

MPXLINGetLogEx​

Gets monitoring log data (TX/RX data) into caller-provided LIN log structure array.

FormatER MPXLINGetLogEx(uint32_t Serial, StMPXLINLog * Log, uint16_t Num, uint16_t * Count, uint8_t * BufferOver)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
StMPXLINLog *Login/outLog structure array
uint16_tNuminNumber of elements in log structure array
uint16_t *CountoutNumber of acquired logs
uint8_t *BufferOveroutBuffer overrun
(see Buffer Overrun Presence)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
FunctionGets LIN logs from CH1 of the MicroPeckerX device specified by Serial.
Set Log to the destination structure array and set Num to the number of elements in that array.
The number of acquired log entries is set to Count.
If Count exceeds Num, buffer overrun occurs and BufferOver is set to MPX_LOG_BUFOVER_TRUE.
NoteCaller must prepare destination structure array.

MPXLINSetStatus​

Sets LIN status.

FormatER MPXLINSetStatus(uint32_t Serial, uint8_t Status)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tStatusinLIN status
(see LIN Status)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionSets LIN status for CH1 of the MicroPeckerX device specified by Serial.
NoteThis API is valid only when LIN operation mode is set to master simulation mode.

MPXLINSetMasterSim​

Sets LIN master simulation settings per schedule.

FormatER MPXLINSetMasterSim(uint32_t Serial, uint8_t SchNo, StMPXLINMasterSim * MasterSim, uint8_t Num)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tSchNoinSchedule number (0 to 31)
StMPXLINMasterSim *MasterSiminPointer to LIN master simulation list structure
uint8_tNuminNumber of elements in LIN master simulation structure array
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionSets LIN master simulation for schedule SchNo on CH1 of the MicroPeckerX device specified by Serial.
Set Num to element count of LIN master simulation structure array included in simulation list structure.
NoteValid only when LIN mode is set to master simulation mode.

MPXLINSetMasterItem​

Changes enable/disable of LIN master simulation setting per item.

FormatER MPXLINSetMasterItem(uint32_t Serial, uint8_t SchNo, uint8_t ItemNo, uint8_t Ena)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tSchNoinSchedule number (0 to 31)
uint8_tItemNoinItem number (0 to 63)
uint8_tEnainItem enable/disable
(see LIN Simulation Enable/Disable)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionSets enable/disable for item ItemNo in schedule SchNo on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is master simulation mode.
This API changes only enable/disable by item. To change other settings, call MPXLINChangeMasterItem.

MPXLINChangeMasterItem​

Changes settings of specified LIN master simulation item.

FormatER MPXLINChangeMasterItem(uint32_t Serial, uint8_t SchNo, uint8_t ItemNo, StMPXLINMasterSimItem * MasterSimItem)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tSchNoinSchedule number (0 to 31)
uint8_tItemNoinItem number (0 to 63)
StMPXLINMasterSimItem *MasterSimIteminPointer to LIN master simulation item structure
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionChanges settings of item ItemNo in schedule SchNo on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is master simulation mode.

MPXLINSetMasterSchedule​

Changes enable/disable and one-time transmission setting per LIN master schedule.

FormatER MPXLINSetMasterSchedule(uint32_t Serial, uint8_t SchNo, uint8_t Ena, uint8_t OneTime)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tSchNoinSchedule number (0 to 31)
uint8_tEnainSchedule enable/disable
(see LIN Simulation Enable/Disable)
uint8_tOneTimeinOne-time transmission enable/disable
(see LIN Simulation Enable/Disable)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionChanges enable/disable and one-time transmission settings of schedule SchNo on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is master simulation mode.

MPXLINChangeMasterSchedule​

Changes currently executed schedule in LIN master simulation.

FormatER MPXLINChangeMasterSchedule(uint32_t Serial, uint8_t SchNo)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tSchNoinSchedule number (0 to 31)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionChanges active schedule to schedule number SchNo on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is master simulation mode.

MPXLINPauseMasterSchedule​

Pauses or resumes currently running schedule in LIN master simulation.

FormatER MPXLINPauseMasterSchedule(uint32_t Serial, uint8_t Ena)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tEnainSchedule pause enable/disable
(see LIN Simulation Enable/Disable)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionChanges pause/resume state of current schedule on CH1 of the MicroPeckerX device specified by Serial.
If Ena is MPX_LIN_SIM_ENA, running schedule is paused. If Ena is MPX_LIN_SIM_DIS, schedule execution resumes.
NoteValid only when LIN mode is master simulation mode.

MPXLINMasterInterrupt​

Performs interrupt transmission in LIN master simulation.

FormatER MPXLINMasterInterrupt(uint32_t Serial, StMPXLINMasterSimItem * MasterSimItem)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
StMPXLINMasterSimItem *MasterSimIteminPointer to LIN master simulation item structure
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionPerforms master simulation interrupt transmission on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is master simulation mode.

MPXLINSetSlaveSim​

Sets LIN slave simulation settings for all items.

FormatER MPXLINSetSlaveSim(uint32_t Serial, StMPXLINSlaveSim * SlaveSim)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
StMPXLINSlaveSim *SlaveSiminPointer to LIN master simulation list structure
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionSets LIN slave simulation settings for all items on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is slave simulation mode.

MPXLINSetSlaveItem​

Changes enable/disable of LIN slave simulation setting per item.

FormatER MPXLINSetSlaveItem(uint32_t Serial, uint8_t ResponseID, uint8_t Ena)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tResponseIDinTarget LIN ID
uint8_tEnainItem enable/disable
(see LIN Simulation Enable/Disable)
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionSets enable/disable for item of LIN ID specified by ResponseID on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is slave simulation mode.
This API changes only enable/disable by item. To change other settings, call MPXLINChangeSlaveItem.

MPXLINChangeSlaveItem​

Changes settings of specified LIN slave simulation item.

FormatER MPXLINChangeSlaveItem(uint32_t Serial, uint8_t ResponseID, StMPXLINSlaveSimItem * SlaveSimItem)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
uint8_tResponseIDinTarget LIN ID
StMPXLINSlaveSimItem *SlaveSimIteminPointer to LIN slave simulation item structure
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionChanges settings of item for LIN ID specified by ResponseID on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is slave simulation mode.

MPXLINSlaveWakeup​

Performs wakeup transmission in LIN slave simulation.

FormatER MPXLINSlaveWakeup(uint32_t Serial)
Argumentuint32_tSerialinSerial number of target MicroPeckerX device
Return valueERE_OKSuccess
E_PARAMParameter error
E_DEVICEDevice not found
E_COMMCommunication error
E_STATUSStatus error
E_TIMEOUTCommunication timeout
FunctionPerforms slave simulation wakeup transmission on CH1 of the MicroPeckerX device specified by Serial.
NoteValid only when LIN mode is slave simulation mode.