Page 1 of 2
Question about J2534..
Posted: Wed May 27, 2020 12:40 am
by ironduke
Hi everyone, I've been reading up on some of the older posts, and I have started working with c# on my own with the Elm327, gotten some things to work and enjoying learning as I go, but I think I wanted to start figuring out how to connect to my gm MDI and I am kind of lost..
I figured before I got too lost down the wrong rabbit hole that I would try and work with some code PCM hammer uses for J2534 connections but I don't quite know where to begin..
If anyone has enough spare time could they point me somewhere that will show/explain how to do what I am trying to do??
in c# I can talk to a serial port and send AT commands and messages,etc..I think I've gotten fairly decent at it but the MDI is so much better at it, I know it's already been done by others, this is something for me to goof around with..
PCM hammer is talking to a different ECU over a different data line,I understand it's all different, all I want is to figure out how to use the dll?? file correctly and how I use it to talk to the MDI.. I thought I would be using the J2534 dll that is installed with the gm mdi manager program but it doesn't look like it??
github as a bunch of examples that just aren't helping me a whole lot, figured if I used the PCM hammer code then when I get stuck I can post a question or 2 here for help...
So far I've just written command line code, no fancy gui yet, that is also on the list of things to try/do...
Thanks in advance for any tips and suggestions... This is spare time stuff, no great need or rush.. Starting to warm up and we're lessening corona restrictions in our area so I may end up with no spare time soon anyways but I thought I would throw it out there..
Re: Question about J2534..
Posted: Mon Jun 01, 2020 7:21 pm
by antus
The J2534 interface is from C, so there is a binary DLL in pcmhammer which you will find in the repo which was written and is owned by Envyous customs (Tazzi). PCMHammer loads and makes calls in to that DLL, an that DLL calls the MDI DLL. You may be able to call the original MDI DLL directly Im not sure. Have a look at where pcmhammer digs in to the registry to find out what J2534 interfaces are installed and follow it from there. Being a C interface its a bit different to a serial port and the ELM protocol. You can find the J2534 spec which is very detailed, probably to the point where its very hard to make sense of, but its there if you want the gnarly details.
viewtopic.php?f=4&t=3424#p40016
https://github.com/LegacyNsfw/PcmHacks/ ... ms/Devices
Re: Question about J2534..
Posted: Tue Jun 02, 2020 5:20 am
by ironduke
Thanks for the suggestions Antus, I had tried looking at the PCMhammer code, missed the dll somehow though.. I wish I could open the dll so I could see the code, lol.. I did find the J2534Device.cs file that uses the dll and it does show me how it's used.. I had read that post you linked too, but they started talking over my head right off the bat, lol..
I already started playing around with code from
https://github.com/BrianHumlicek/J2534-Sharp though.. Playing with that now.. I might try swapping over since I'm not that far in, just thought if I did get stuck this forum is where I'd go for help anyways so if I can start with something you guys already use I'd be better off..
I'm not very good at C or C#, I got soft of halfway decent at using Arduino and processing and a lot is similar but the differences can be quite frustrating sometimes, lol..
Thanks again..
Is anyone else at this learning stage here as well?? Any interest in it?? I know this forum isn't about computer programming but it's programming for the sake of vehicle communications, lol..
Re: Question about J2534..
Posted: Tue Jun 02, 2020 9:10 am
by Tazzi
Learning through examples and from the SAE datasheet is the way to go. Like Antus said, it can be a little bit hard to follow depending on your level of understanding of C.
Re: Question about J2534..
Posted: Tue Jun 02, 2020 10:15 am
by antus
ironduke wrote:Is anyone else at this learning stage here as well?? Any interest in it?? I know this forum isn't about computer programming but it's programming for the sake of vehicle communications, lol..
I wouldnt say its not about programming. My day job is software development, and my hobby is cars so thats the sort of stuff I'm in to. Happy to help and talk about it where I can. There is a lot of software in cars and programming discussions are welcome

Re: Question about J2534..
Posted: Thu Jun 11, 2020 6:09 pm
by kostia111
Re: Question about J2534..
Posted: Tue Jul 14, 2020 1:06 am
by ironduke
ok.. I tried to make something, tell me what you think..
It's a brute force program for the E38 ECU using a GM MDI.. It may work with other J2534 devices, but I have nothing to test with and I did not write the dll that I am using..
Hopefully I gave appropriate credit to the author
https://github.com/BrianHumlicek/J2534-Sharp << this is what I used for MDI communication..
Check it out, hopefully it works for everyone as it's supposed to.. I think I need to publish it for people to get the direct executable? or build it yourself I guess?? let me know how that works if ya can.. Thanks..
https://github.com/IronDuke123/E38_brute_force
Re: Question about J2534..
Posted: Mon Mar 22, 2021 12:40 pm
by ironduke
Been working on something simple to help out the guys in the shop.. This new techline connect is being a pain in the ass at times.. When you want something simple it can be a real big PITA..
I am putting some code together to just scan for codes in every module and be able to clear them as well.. kind of a state of health when you pull the car in and a clear codes after you put it all back together type of thing.. Any interest here for something like that?? I have most of the module Id's done and working on the code descriptions.. So far it's just command line, still need to set up a printer interface and ability to save it all as a text file.. I wrote my own dll for the module ID's and codes because putting them all in this one program made it slow editing wise, lol.. Tried XML files but got pissed off and gave up.. dll works jus fine.. not as easy to update but not horrible..
Unless I expand it this will work only on vehices(GM only) that have single wire CAN(pin 1) and High speed CAN(6&14).. This means 2007ish to 2019, and some 2020's, something for 21's changed for sure..
Re: Question about J2534..
Posted: Tue Mar 23, 2021 2:54 am
by Gampy
The Envyous Customs J2534.dll included with PcmHammer is just a Interop Marshaling wrapper correct ??
Re: Question about J2534..
Posted: Tue Mar 23, 2021 3:52 pm
by Tazzi
Gampy wrote:The Envyous Customs J2534.dll included with PcmHammer is just a Interop Marshaling wrapper correct ??
Basically yes, it does the hard work of converting types to pointers ect along with dealing with the nitty gritty stuff. And allows using the core functions in a simplistic way.