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
xEnable
BOOL
FALSE
Enable SDG consumption.The inputs S_PGN, S_usiSrcAddr, S_tSCT and S_tSRVT are sampled with a rising edge.S_dwPGN
DWORD
0
Parameter Group Number (PGN).
S_tTransmissionRate
TIME
TIME#0ms
Transmission rate of sent SDG data.
S_usiSrcAddr
USINT
0
Source Address.
S_tSCT
TIME
TIME#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_tSRVT
TIME
TIME#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.SDGU
REFERENCE TO J1939SafetyItf.SAFETY_DATA_GROUP_UNSAFE
Unsafe SDG data to consume.
Output
S_xBusy
BOOL
FALSE
In operation.
S_xError
BOOL
FALSE
Error occured.
S_eErrorID
ERROR.NO_ERROR
Error identification.
S_udiSDGcnt
UDINT
0
Number of consumed SDG.
S_abyData
ARRAY [0..7] OF SAFEBYTE
Transmitted SDG data.Initial the data field is set to the “not available” value 16#FF.S_usiDataLength
SAFEUSINT (0..8)
0
Length of transmitted SDG data.