*The original first post above has been moved to below! Same conditions apply.*Note, Before I go any further, any software,postings,findings or information that I find and you use is at your own risk! This is all experimental software that will more then likely have bugs.
So Iv seen alot of threads and comments about finding good OBD2 software to use with an elm.. and well... So far the options are very limited! Alot of the current programs either a) cost money for a useless software or b)are free/cheap but dont work correctly.
Then finding an application that will present the manufacture specific codes is even harder to find, let alone finding one for Holden!
So the aim here is to develop a basic application to read holden commodores fault codes, including history and present codes. As well as identifying the cable and current details.
Some reading material for the OBD2 protocol:http://www.fastfieros.com/tech/vpw_comm ... otocol.htm
And the ELM327 datasheet:http://elmelectronics.com/DSheets/ELM327DS.pdf
So the first plan of action is making something successfully send a message to the elm327 device to check that the cable is present, and that communication is working.
Next will be to set the required conditions such as turning on headers,turn off echo,remove null bytes ect.
And lucky last, applying the above to successfully send a request eg 01 04 which is a mode 1 request for PID section 4.
For fault codes, we will be investigating mode 3 and 7. I *think* 3 is current codes and 7 are history.. (not 100% sure).
First up, connecting to the elm device, and checking that it is present.
The elm connection requirements are: baud rate to 38400, set to 8 bits, no parity bits,1 stop bit and set it to the correct line end mode (single carriage return character).
So thats easy enough to setup! Now we want to actually check that we have connected to an elm device, So now we will want to send "ATZ" which is the command to "reset" the ELM device, and the ELM devce will send over serial "ELM327 v1.5" (whatever version), which will end in a carriage return that software can pickup as the end or message.
The ELM will also spit out ">" after all commands, this signifies that device is idle and ready for a request.. so will need to add a function in to check for this after receiving a message to check that is the end of the potential message/s.
Currently, I am using this code to request info from the elm device to check if device is present:
- Code: Select all
Public Function DetectElmDeviceGetResponse(SentFrame As String)
Dim ReceivedFrame As String = ""
Dim Counts2Exit As Integer = 0
Do 'do until exited
'if there is something there.. read it!
ReceivedFrame = SerialPort1.ReadLine 'Read Message!
If ReceivedFrame <> SentFrame Then 'check if recieved frame matches sent.. ignore if so
If ReceivedFrame.Contains("SEARCHING...") Then 'ignore.. move onto next
ElseIf ReceivedFrame.Contains("NO DATA") Then 'ELM says no response.. fail! Shouldnt happen since gtting Elm info!
Return ReceivedFrame 'hopefully out response
Catch ex As TimeoutException 'if nothings available, timout after 1 second.
Counts2Exit += 1
If Counts2Exit = 4 Then 'fail after timeout 4times
SetRichTextBox_ThreadSafe("Timed Out!", RichTextBoxReceive)
SetRichTextBox_ThreadSafe("Timed out.. Searching again.." & Counts2Exit, RichTextBoxReceive)
The above code doesnt have any implementation to check for the elm device at idle (">"), and currently isnt picking up the elm device. I am hopefully getting a cable in the next couple days so I can properly debug the application to check why its missing the frame, although using a "elm327 emulator" works with the above code.
Have implemented a "check elm is idle" function to run after every request. Seems to work fine.
Application also works fine using various elm emulators and also a fake elm that Iv developed as well to run along with the program.
Unfortunately it hasnt worked with a "real" cable yet as tested by someone else. Im unsure why though.. not sure if it was because of a different elm interface? or if cables dodgy? Or possibly application doesnt work correctly on WinXP due to the .net 4 framework requirements.
Running program in a virtual machine should let me know if thats the case.
ELM cable is on the way anyways, be nice to make some progress without it though!