本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
診斷故障碼使用案例
重要
某些 AWS IoT FleetWise 功能的存取目前已封鎖。如需詳細資訊,請參閱AWSAWS IoT FleetWise 中的區域和功能可用性。
下列使用案例假設 DTC_QUERY
函數已在示範指令碼
定期擷取
以設定的間隔擷取 DTC 集合。
下列範例是具有針對所有 ECUs Vehicle.DTC_INFO
的狀態遮罩之所有 DTCs 定期擷取訊號的行銷活動。為 收集的資料有條件Vehicle.DTC_INFO
。
{
"compression": "SNAPPY",
"spoolingMode": "TO_DISK",
"signalsToFetch": [
{
"fullyQualifiedName": "Vehicle.ECU1.DTC_INFO",
"signalFetchConfig": {
"timeBased": {
// The FleetWise Edge Agent will query the UDS module for all DTCs every five seconds.
"executionFrequencyMs": 5000
}
},
"actions": [
// Every five seconds, this action is called and its output is stored in the
// signal history buffer of Vehicle.DTC_INFO
"custom_function(\"DTC_QUERY\", -1, 2, -1)"
]
}
],
"signalsToCollect": [
{
"name": "Vehicle.ECU1.DTC_INFO"
}
],
"collectionScheme": {
"conditionBasedCollectionScheme": {
"conditionLanguageVersion": 1,
// Whenever a new DTC is filled into the signal, the data is ingested.
"expression": "!isNull($variable.`Vehicle.ECU1.DTC_INFO`)",
"minimumTriggerIntervalMs": 1000,
// Make sure that data is ingested only when there are new DTCs.
"triggerMode": "RISING_EDGE"
}
},
"dataDestinationConfigs": [
{
"s3Config":
{
"bucketArn": "bucket-arn",
"dataFormat": "PARQUET",
"prefix": "campaign-name",
"storageCompressionFormat": "GZIP"
}
}
]
}
條件驅動型擷取
符合條件時擷取 DTC 集合。例如,當 CAN 訊號為 時Vehicle.Ignition == 1
,請擷取和上傳 DTC 資料。
下列範例行銷活動具有 的條件驅動訊號擷取Vehicle.ECU1.DTC_INFO
,以檢查 DTC ("AAA123") 是否正在等待recordNumber 1 用於 ECU-1。此行銷活動具有以時間為基礎的資料收集和上傳。
{
"compression": "SNAPPY",
"spoolingMode": "TO_DISK",
"signalsToFetch": [
{
"fullyQualifiedName": "Vehicle.ECU1.DTC_INFO",
"signalFetchConfig": {
"conditionBased": {
// The action will only run when the ignition is on.
"conditionExpression": "$variable.`Vehicle.Ignition` == 1",
"triggerMode": "ALWAYS"
}
},
// The UDS module is only requested for the specific ECU address and the specific DTC Number/Status.
"actions": ["custom_function(\"DTC_QUERY\", 1, 2, 8, \"0xAAA123\")"]
}
],
"signalsToCollect": [
{
"name": "Vehicle.ECU1.DTC_INFO"
},
{
"name": "Vehicle.Ignition"
}
],
"collectionScheme": {
"timeBasedCollectionScheme": {
"periodMs": 10000
}
},
"dataDestinationConfigs": [
{
"s3Config":
{
"bucketArn": "bucket-arn",
"dataFormat": "PARQUET",
"prefix": "campaign-name",
"storageCompressionFormat": "GZIP"
}
}
]
}
隨需擷取
擷取機群的特定 DTC。
對於隨需使用案例,您可以使用與定期擷取中定義的相同行銷活動。使用 AWS IoT FleetWise 主控台或執行下列 CLI 命令,在行銷活動部署後立即暫停行銷活動,即可實現隨需效果。
-
以命令名稱取代
command-name
。
aws iotfleetwise update-campaign \ --name
campaign-name
\ --action APPROVE
然後,在 DTC 資料送達後暫停行銷活動。
aws iotfleetwise update-campaign \ --name
campaign-name
\ --action SUSPEND
您可以再次繼續行銷活動以進行 DTC 資料擷取。
aws iotfleetwise update-campaign \ --name
campaign-name
\ --action RESUME