Safe_SDG_Consumer (FB)¶
FUNCTION_BLOCK Safe_SDG_Consumer
Safe_SDG_Consumer consumes unsafe J1939-76 SDG data provided by a J1939SafetyStd.Unsafe_SDG_Receiver.
For an overview of general data flow see the library main documentation and the J1939 Safety example.project.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnableBOOLFALSE
Enable SDG consumption.The inputs S_PGN, S_usiSrcAddr, S_tSCT and S_tSRVT are sampled with a rising edge.S_dwPGNDWORD0
Parameter Group Number (PGN).
S_tTransmissionRateTIMETIME#0ms
Transmission rate of sent SDG data.
S_usiSrcAddrUSINT0
Source Address.
S_tSCTTIMETIME#0ms
Safety Cycle Time (SCT). SCT is the period of time that transpires between reception of successive SDM instances of the same Safety Data Group series.The maximum SCT for an SDG shall be based upon the SDG timing basis for the SAE J1939 PG of the SDM.For SDG timing basis less than or equal to 200 ms the maximum SCT is 150 percent of the SDG timing basis.For SDG timing basis greater than 200 ms the maximum SCT is the SDG timing basis plus 100 ms.S_tSRVTTIMETIME#0ms
Safety-Relevant Validation Time (SRVT). SRVT is the time transpired between SHM reception and corresponding SDM reception of the same Safety Data Group instance.The maximum SRVT for an SDG shall be based upon the SDG timing basis for the SAE J1939 PG of the SDM.For SDG timing basis less than or equal to 200 ms the maximum SRVT is 50 percent of the SDG timing basis.For SDG timing basis greater than 200 ms the maximum SRVT is 100 ms.SDGUREFERENCE TO J1939SafetyItf.SAFETY_DATA_GROUP_UNSAFE
Unsafe SDG data to consume.
Output
S_xBusyBOOLFALSE
In operation.
S_xErrorBOOLFALSE
Error occured.
S_eErrorIDERROR.NO_ERROR
Error identification.
S_udiSDGcntUDINT0
Number of consumed SDG.
S_abyDataARRAY [0..7] OF SAFEBYTE
Transmitted SDG data.Initial the data field is set to the “not available” value 16#FF.S_usiDataLengthSAFEUSINT (0..8)
0
Length of transmitted SDG data.