OBD2 How can I check that ignition is turned off
I've connected to OBDKey and obtained data. I want immediately close my program when the vehicle is powered down(ignition turned off) How can I check开发者_StackOverflow that ignition is turned off?
What about using the RPM value from the engine controller to determine that the engine has stopped running? With OBDKey, use the 010C\r
command. this will be 41 0C 00 00
if the engine is not running or NO DATA
if the ECU has already shut down.
If you're using an ELM327
chipset, you can use the ATIGN
command which will response ON
or OFF
.
In practice, I'm not sure whether this command is actually useful. For socket-powered OBD2 devices, it looks like they always report ON
when they are powered. See also ELM327 ATIGN always returns 'ON'.
精彩评论