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 (C++), LIN Simulation (C#), LIN Simulation (VBA)
MPXLINGetLogExBuffer Overrun PresenceStMPXLINLogNONE/MON/SIMLIN Monitor (C++)
MPXLINSetStatusLIN Status-PARAM/SYNC/SIMLIN Master (C++), LIN Slave (C++)
MPXLINSetMasterSimLIN Frame TypeStMPXLINMasterSimPARAM/SYNCLIN Master (C++)
MPXLINSetMasterItemLIN Simulation Enable/Disable-SIMLIN Master (C++)
MPXLINChangeMasterItemLIN Frame TypeStMPXLINMasterSimItemSIMLIN Master (C++)
MPXLINSetMasterScheduleLIN Simulation Enable/Disable-PARAM/SYNC/SIMLIN Master (C++)
MPXLINChangeMasterScheduleAPI Return Values-PARAM/SYNC/SIMLIN Master (C++)
MPXLINPauseMasterScheduleLIN Simulation Enable/Disable-SIMLIN Master (C++)
MPXLINMasterInterruptLIN Frame TypeStMPXLINMasterSimItemSIMLIN Master (C++)
MPXLINSetSlaveSimLIN Frame TypeStMPXLINSlaveSimPARAM/SYNCLIN Slave (C++)
MPXLINSetSlaveItemLIN Simulation Enable/Disable-SIMLIN Slave (C++)
MPXLINChangeSlaveItemLIN Frame TypeStMPXLINSlaveSimItemSIMLIN Slave (C++)
MPXLINSlaveWakeupLIN Frame Type-SIMLIN Slave (C++)

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(unsigned long Serial, StMPXLINParam * Param)
Argumentunsigned longSerialinSerial 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(unsigned long Serial, StMPXLINLog * Log, unsigned short Num, unsigned short * Count, unsigned char * BufferOver)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
StMPXLINLog *Login/outLog structure array
unsigned shortNuminNumber of elements in log structure array
unsigned short *CountoutNumber of acquired logs
unsigned char *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.
NoteThis API is valid only in log acquisition API mode.
Caller must prepare destination structure array.

MPXLINSetStatus

Sets LIN status.

FormatER MPXLINSetStatus(unsigned long Serial, unsigned char Status)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charStatusinLIN 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(unsigned long Serial, unsigned char SchNo, StMPXLINMasterSim * MasterSim, unsigned char Num)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charSchNoinSchedule number (0 to 31)
StMPXLINMasterSim *MasterSiminPointer to LIN master simulation list structure
unsigned charNuminNumber 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(unsigned long Serial, unsigned char SchNo, unsigned char ItemNo, unsigned char Ena)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charSchNoinSchedule number (0 to 31)
unsigned charItemNoinItem number (0 to 63)
unsigned charEnainItem 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(unsigned long Serial, unsigned char SchNo, unsigned char ItemNo, StMPXLINMasterSimItem * MasterSimItem)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charSchNoinSchedule number (0 to 31)
unsigned charItemNoinItem 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(unsigned long Serial, unsigned char SchNo, unsigned char Ena, unsigned char OneTime)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charSchNoinSchedule number (0 to 31)
unsigned charEnainSchedule enable/disable (see LIN Simulation Enable/Disable)
unsigned charOneTimeinOne-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(unsigned long Serial, unsigned char SchNo)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charSchNoinSchedule 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(unsigned long Serial, unsigned char Ena)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charEnainSchedule 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(unsigned long Serial, StMPXLINMasterSimItem * MasterSimItem)
Argumentunsigned longSerialinSerial 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(unsigned long Serial, StMPXLINSlaveSim * SlaveSim)
Argumentunsigned longSerialinSerial 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(unsigned long Serial, unsigned char ResponseID, unsigned char Ena)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charResponseIDinTarget LIN ID
unsigned charEnainItem 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(unsigned long Serial, unsigned char ResponseID, StMPXLINSlaveSimItem * SlaveSimItem)
Argumentunsigned longSerialinSerial number of target MicroPeckerX device
unsigned charResponseIDinTarget 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(unsigned long Serial)
Argumentunsigned longSerialinSerial 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.