DM2_Read (FB) ¶ FUNCTION_BLOCK DM2_Read EXTENDS DM1_Read This function block reads DM2 messages from a given device ( itfSourceECU ) as long as xEnable is TRUE . In principal a DM2 message contains lamp information and all previously active diagnostic trouble codes ( DTC ). Following information is provided by this function block: Lamp information for following lamps: Malfunction Indicator Lamp(MIL) Red Stop Lamp (RSL) Amber Warning Lamp (AWL) Protect Lamp Number of previously active DTCs(output: udiDTCCount ) Information about if DM2 message was received in the current PLC cycle ( xReceived ). For detailed information about received DTC data one or more DTC Handlers can be connected with this function block (optionally). For example: DTCBufferWriter : Writes DTC data to a given memory buffer DTCLogger : Writes DTC data to the PLC log. InOut: Scope Name Type Initial Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input itfSourceECU IJ1939RemoteECU ECU which sends this message DM1_Read Output itfDTCHandlerList IDTCHandlerList THIS^ mainly for graphical programming: output for optional connection to DTC Handler DM1_Read udiDTCCount UDINT Contains number of received Diagnostic Trouble Codes. DM1_Read MalfunctionIndicatorLamp LAMP_INFO Malfunction Indicator Lamp: Lamp to indicate when there is an emission related trouble code active. DM1_Read RedStopLamp LAMP_INFO Red Stop Lamp: Lamp to indicate a problem that is severe enough to warrant stopping the vehicle. DM1_Read AmberWarningLamp LAMP_INFO Amber Warning Lamp: Lamp to indicate a problem with the vehicle system but the vehicle does not need to be stopped immediately. DM1_Read ProtectLamp LAMP_INFO Protect Lamp: Lamp to indicate a problem with a vehicle system that is most likely not electronic subsystem related (e.g. Coolant Temperature has exceeded its defined range.) DM1_Read xReceived BOOL If a DM message was received xReceived is TRUE for one cycle. DM1_Read eError ERROR detailed error information if xError is TRUE DM1_Read
DTC Processing (DTC Handler) ¶ DTCBufferWriter (FunctionBlock) DTCLogger (FunctionBlock)
DTCBufferWriter (FB) ¶ FUNCTION_BLOCK DTCBufferWriter EXTENDS DTCHandlerBase This function block can be connected to a DM1_Read or DM2_Read function block. As long as xEnable is TRUE it receives DTCs and writes it to a memory buffer provided by pDTCBuffer . If a complete diagnostic message was received output xReceived becomes TRUE for one cycle and pDTCBuffer contains received DTCs. If buffer is too small DTCs can be lost (see output udiDTCLostCount ). Note Output values and Data in pDTCBuffer is only valid as long as xReceived is TRUE (for one cycle). InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input itfDTCHandlerList IDTCHandlerList DMx_Read instance DTCHandlerBase Output eError ERROR detailed error information if xError is TRUE DTCHandlerBase Input pDTCBuffer POINTER TO DTC Pointer to ARRAY OF DTC . If xReceived is TRUE buffer contains received DTC information. Note: Data is only valid as long as xReceived is TRUE . udiDTCBufferCount UDINT Number of DTCs fitting into pDTCBuffer Output udiDTCReceiveCount UDINT Number of DTCs written to pDTCBuffer . Only valid if xReceived is TRUE . udiDTCLostCount UDINT Number of dismissed DTCs. If greater 0 buffer is too small. xReceived BOOL TRUE for one cycle if a diagnostic message was received. pDTCBuffer contains DTC information.
DTCLogger (FB) ¶ FUNCTION_BLOCK DTCLogger EXTENDS DTCHandlerBase This function block can be connected to a DM1_Read or DM2_Read function block. As long as xEnable is TRUE it receives DTCs and writes it to the plc logger. InOut: Scope Name Type Initial Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input itfDTCHandlerList IDTCHandlerList DMx_Read instance DTCHandlerBase Output eError ERROR detailed error information if xError is TRUE DTCHandlerBase Input hLogger SysTypes.RTS_IEC_HANDLE CmpLog.LOG_STD_LOGGER Handle to the logger. Default: CmpLog.LOG_STD_LOGGER
DM1_Write (FB) ¶ FUNCTION_BLOCK DM1_Write EXTENDS CBM.ETrig IMPLEMENTS IDTCProviderList This function block sends a DM1 messages from a given local ECU ( itfSourceECU ). A DM1 message contains lamp information and currently active diagnostic trouble codes ( DTC ). Following information is sent by this function block: Lamp information for following lamps: Malfunction Indicator Lamp(MIL) Red Stop Lamp (RSL) Amber Warning Lamp (AWL) Protect Lamp All enabled diagnostic trouble codes connected to output itfDTCProviderList (see DTCProvider function block). InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Action starts Falling edge: Resets outputs If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values ( xDone , xError ) are present at the outputs for exactly one cycle. ETrig Output xDone BOOL TRUE : Action successfully completed ETrig xBusy BOOL TRUE : Function block active ETrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error ETrig Input itfSourceECU IJ1939LocalECU Local ECU which should be the sender of the diagnostic message. MalfunctionIndicatorLamp LAMP_INFO Malfunction Indicator Lamp: Lamp to indicate when there is an emission related trouble code active. RedStopLamp LAMP_INFO Red Stop Lamp: Lamp to indicate a problem that is severe enough to warrant stopping the vehicle. AmberWarningLamp LAMP_INFO Amber Warning Lamp: Lamp to indicate a problem with the vehicle system but the vehicle does not need to be stopped immediately. ProtectLamp LAMP_INFO Protect Lamp: Lamp to indicate a problem with a vehicle system that is most likely not electronic subsystem related (e.g. Coolant Temperature has exceeded its defined range.) Output itfDTCProviderList IDTCProviderList THIS^ mainly for graphical programming: output for connection to DTC provider function blocks eError ERROR detailed error information if xError is TRUE.
DM2_Write (FB) ¶ FUNCTION_BLOCK DM2_Write EXTENDS DM1_Write This function block sends a DM1 messages from a given local ECU ( itfSourceECU ). A DM2 message contains lamp information and previously active diagnostic trouble codes ( DTC ). Following information is sent by this function block: Lamp information for following lamps: Malfunction Indicator Lamp(MIL) Red Stop Lamp (RSL) Amber Warning Lamp (AWL) Protect Lamp All enabled diagnostic trouble codes connected to output itfDTCProviderList (see DTCProvider function block). InOut: Scope Name Type Initial Comment Inherited from Input xExecute BOOL Rising edge: Action starts Falling edge: Resets outputs If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values ( xDone , xError ) are present at the outputs for exactly one cycle. ETrig Output xDone BOOL TRUE : Action successfully completed ETrig xBusy BOOL TRUE : Function block active ETrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error ETrig Input itfSourceECU IJ1939LocalECU Local ECU which should be the sender of the diagnostic message. DM1_Write MalfunctionIndicatorLamp LAMP_INFO Malfunction Indicator Lamp: Lamp to indicate when there is an emission related trouble code active. DM1_Write RedStopLamp LAMP_INFO Red Stop Lamp: Lamp to indicate a problem that is severe enough to warrant stopping the vehicle. DM1_Write AmberWarningLamp LAMP_INFO Amber Warning Lamp: Lamp to indicate a problem with the vehicle system but the vehicle does not need to be stopped immediately. DM1_Write ProtectLamp LAMP_INFO Protect Lamp: Lamp to indicate a problem with a vehicle system that is most likely not electronic subsystem related (e.g. Coolant Temperature has exceeded its defined range.) DM1_Write Output itfDTCProviderList IDTCProviderList THIS^ mainly for graphical programming: output for connection to DTC provider function blocks DM1_Write eError ERROR detailed error information if xError is TRUE. DM1_Write
DTCProvider (FB) ¶ FUNCTION_BLOCK DTCProvider EXTENDS CBM.LTrig IMPLEMENTS IDTCProvider This function block is used in conjunction with DM1_Write or DM2_Write function blocks. It serves as data provider for diagnostic trouble codes. One or more DTCProvider can be connected to one DMx_Write function block. A DTC will be activated by setting xEnable to TRUE . InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Action starts FALSE : Action stops, outputs xDone , xBusy , xError are resetted LTrig Output xDone BOOL TRUE : Action successfully completed LTrig xBusy BOOL TRUE : Function block active LTrig xError BOOL TRUE : Error occurred, function block aborts action FALSE : No error LTrig Input itfDTCProviderList IDTCProviderList DMx_Write instance Data DTC DTC data Output eError ERROR detailed error information if xError is true.
J1939RemoteECU (FB) ¶ FUNCTION_BLOCK J1939RemoteECU EXTENDS J1939ECUBase IMPLEMENTS IJ1939RemoteECU Implements a remote ECU. Note This function block is not intended for being instantiated by applications. Instances will be created implicitly. Properties: CommunicationWatchdogTimeout Address , inherited from J1939ECUBase IsArbitraryAddressCapable , inherited from J1939ECUBase IsLocal , inherited from J1939ECUBase NAME , inherited from J1939ECUBase State , inherited from J1939ECUBase Methods: ChangeAddress Structure: ChangeAddress (Method) CommunicationWatchdogTimeout (Property)
J1939RemoteECU.ChangeAddress (METH) ¶ METHOD ChangeAddress : BOOL Changes the ECU address. InOut: Scope Name Type Comment Return ChangeAddress BOOL TRUE: ECU address change request initiated successfully Input byAddress BYTE new ECU address
J1939RemoteECU.CommunicationWatchdogTimeout (PROP) ¶ PROPERTY CommunicationWatchdogTimeout : UINT Communication Watchdog in milliseconds; = 0: communication watchdog disabled > 0: communication watchdog active. If there was no message received after n milliseconds, ECU state becomes ECUSTATE.NOT_AVAILABLE .