Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
09-12-2004, 12:36 PM
|
#16
|
|
Variable Bitrate
Join Date: Apr 2004
Location: Puerto Rico
Vehicle: 2000 Honda S2000
Posts: 302
|
Quote: Originally Posted by god_of_cpu
I'm currently using the scantool.net one, it should work with anything that uses the ELM chip though. However, the plugin interface is actually written so that the calling application writes to this single interface and multiple plugins can then be used. I've only written the one for the ELM interface, but ideally more plugins could be written for the different interfaces and the calling applications wouldn't have to change.
The ELM is proving too slow to be really usable for me though, I plan on eventually buying a CAN based one and writing the plugin for it.
How do you know if your car supports CAN? I have a 2000 honda s2000. i have read that the 2002 models have it, im not sure if mine does.
And where can you get a CAN reader?
__________________
Carputer: 2.8Ghz P4, 512 RAM, 120gb HDD, WIFI, TV tuner, CDRW/DVDROM, Slot load DVD in front.
Screen: Lilliput 7" touchscreen (Custom made Carbon Fiber Screen Enclosure)
S2000 Carputer
|
|
|
09-12-2004, 12:39 PM
|
#17
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
Quote: Originally Posted by darkhalo
How do you know if your car supports CAN? I have a 2000 honda s2000. i have read that the 2002 models have it, im not sure if mine does.
And where can you get a CAN reader?
Probably best to speak to a scantool supplier. The company I bought my ELM one made me check the wiring on FOcus, as mid 03's switched to CAN - sadly mine was a little too early
|
|
|
09-12-2004, 12:40 PM
|
#18
|
|
Variable Bitrate
Join Date: Apr 2004
Location: Puerto Rico
Vehicle: 2000 Honda S2000
Posts: 302
|
thanks for the info 
__________________
Carputer: 2.8Ghz P4, 512 RAM, 120gb HDD, WIFI, TV tuner, CDRW/DVDROM, Slot load DVD in front.
Screen: Lilliput 7" touchscreen (Custom made Carbon Fiber Screen Enclosure)
S2000 Carputer
|
|
|
09-12-2004, 01:07 PM
|
#19
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Here are the enumerations and the structure for the OBD packet they will need to be converted to thier VB equivilent. They are in C++. There are also helper functions defined in these files. You do not necessarily need to use any of the helper functions, you'll just need the enums and structs. The helper functions do things like return a single value given the packet and the OBD PID that generated it or return the type suffix string for a PID i.e. "mph" for the vechicle speed PID. These functions will be exported by the ELM plugin, but it is not a requirment for the plugin to export them so you might want to port over the functions you'll use to VB rather then using importing them.
I will have an OBD II data faker plugin that generates random data values that should help with building a program off the plugin and the actual OBD II plugin for the ELM device up later today.
Last edited by god_of_cpu : 09-12-2004 at 01:51 PM.
|
|
|
09-12-2004, 02:08 PM
|
#20
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
Thanks, had a look through and all looks straightforward. The faker plugin will be invaluable too! Cannot wait!
|
|
|
09-12-2004, 11:56 PM
|
#21
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Its up. Just download the OBD II SDK it includes the binary forms of the dlls and the source for them as well as a c++ demonstration program. All the documentation is in the form of comments.
Although, the plugin has been verified working, I didn't get a chance to extensively test the ELM plugin yet, but I will be doing so over the next week. The interface for the plugins shouldn't change but i'll probably updating the implementation as I find bugs.
https://filebox.vt.edu/users/cholbro..._Developer.htm
|
|
|
09-13-2004, 05:25 AM
|
#22
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
thanks so much. I'll be playing with it today.
|
|
|
09-13-2004, 10:25 AM
|
#23
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
Am I missing something obvious here?
I can get it to show the configuration dialogue, and have added the contants, and added in and corrected the VB API code you posted above.
It's not however showing the version information etc, it says the PID I am looking for is not supported, and dies when I try and retrieve the MPH PID.
By the way, in the contants section, because VB won't let me add a HEX value as a constant, I added it as it's decimal equivalent. I don't know if that matters?
I've attached what I've been playing with today, basically just a VB6 translation of the C++ test application
|
|
|
09-13-2004, 10:48 AM
|
#24
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
The conversion looks good from what I can tell and it shouldn't matter if you put the constants in as decimal or hex as long as thier the same.
The faker plugin should never return that a PID isn's supported since it supports everything.
Can you post the compiled version of your program so I can run it and debug the dll?
|
|
|
09-13-2004, 11:11 AM
|
#25
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Ok, I looked at your source code some more and found why your having some problems.
The reason why you can't get the version or the program name is because you are not allocating memroy for the returned strings first. In vb to allocate space for the strings you simply need to create a string of the maximum length of the string that can be returned, then you'll need to trim the string to its actual length since VB doesn't do null terminated strings. I didn't account for this in the dll, but I will update all the text returning functions to return the length of valid charters copied i.e.:
Code:
szPlugInName =Space(15)
'Note currently GetModuleName is a sub, it will have to be updated before this code will work
iNumCopied = API_OBDII_GetModuleName szPlugInName, 15
Debug.Print Left$(szPlugInName, iNumCopied)
For now it should work if you just do the space thing before you call the text returning functions, but you may have some garbage charcters following the returned string.
I'll post new dlls with updated functions when I get home from work today.
Last edited by god_of_cpu : 09-13-2004 at 11:18 AM.
|
|
|
09-13-2004, 11:17 AM
|
#26
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Another problem is that you are also not allocating data for the packet before calling API_OBDII_Mode1_GetPacket.
You should add this stuff to your .bas file first:
Code:
Public Const API_OBDII_NUMHEADERBYTES = 3
Public Const API_OBDII_NUMDATABYTES = 7
Type API_OBDII_MSGPACKET
m_dwTimeRecieved As Long
m_iNumDataBytes As Byte
m_Header(API_OBDII_NUMHEADERBYTES) as Byte
m_Data(API_OBDII_NUMDATABYTES) as Byte
End Type
Then you should declare lpMsgPacket as API_OBDII_MSGPACKET rather then longi.e.
Code:
Dim lpMsgPacket As API_OBDII_MSGPACKET
Also change the API_OBDII_Mode1_GetPacket declaration to reflect this and pass it in ByRef.
Code:
Public Declare Sub API_OBDII_Mode1_GetPacket Lib "OBDIIFaker.dll" (ByVal lpUser As Long, ByVal eOBDPID As Long, ByRef lpMsgPacket As API_OBDII_MSGPACKET)
To interpret the data in the packets you'll have to use the helper functions or port them to your own in VB.
This is why your program was crashing.
Last edited by god_of_cpu : 09-13-2004 at 11:45 AM.
|
|
|
09-13-2004, 11:55 AM
|
#27
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Quote: Originally Posted by stevieg
It's not however showing the version information etc, it says the PID I am looking for is not supported
API_OBDII_Mode1_IsPIDSupported returns a C BOOL which is actually a long and is NOT the same a VB Boolean varible. You should be comparing the returned value of API_OBDII_Mode1_IsPIDSupported or any of the other functions that return a C BOOL to 0 or 1. i.e.:
Code:
Private Const cFALSE As Long = 0
Private Const cTRUE As Long = 1
' check if the vehice speed PID is supported
If API_OBDII_Mode1_IsPIDSupported(m_lpUser, eOBDPIDVehicleSpeed) = cFALSE Then
lstData.AddItem "ERROR: Vehicle Speed is not supported"
End If
Also, you dont need the OBDII. before all your dll functions calls. I used a class to store all the imported functions in C++, but this probably just complicates things for you in VB.
|
|
|
09-13-2004, 03:37 PM
|
#28
|
|
See me in my wet t-shirt.
Join Date: Aug 2003
Location: Warwickshire, UK
Vehicle: Ford Focus MP3
Posts: 1,909
|
I've made those changes you suggest and it's working (except for the name,comment,version etc)
I've posted it with a compiled exe if you need it to debug with, I'll now set about converting the conversion functions.
Thanks
|
|
|
09-13-2004, 07:10 PM
|
#29
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Do the name / comment / version not work just cause your waiting for me to update the dll or cause theres still another problem?
I'll have the updated dlll up in an hour or two.
|
|
|
09-13-2004, 07:26 PM
|
#30
|
|
Raw Wave
Join Date: Jan 2004
Location: SilverSpring Maryland
Vehicle: 2003/Infiniti/G35 Sport Coupe
Posts: 2,951
|
Its updated, you can download it from the same place as before. I also added a version number to the main readme.txt I'll increment this when changes are made.
You will need to change the name / comment / version function declarations so that they return Longs
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:58 PM.
|
|