1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

How can I log the J2534 calls my application makes for debugging?

PDF Print E-mail

The Openport 2.0 J2534 DLL has debugging options which are settable via an IOCTL call that provide debug output for every subsequent J2534 call that is made. You can turn this debugging on by making the following J2534 call:

#include "j2534_tactrix.h"
#include "j2534.h"
// the following are defined in the above header
// #define TX_IOCTL_BASE                            0x70000
// #define TX_IOCTL_SET_DLL_DEBUG_FLAGS            (TX_IOCTL_BASE+1)
// #define TX_IOCTL_DLL_DEBUG_FLAG_J2534_CALLS                       0x00000001

void main()
{
J2534 j2534;
j2534.init();
unsigned int flags = TX_IOCTL_DLL_DEBUG_FLAG_J2534_CALLS;
j2534.PassThruIoctl(0,TX_IOCTL_SET_DLL_DEBUG_FLAGS,(void*)flags,NULL);

// now use the J2534 DLL as you wish (open, connect, etc.)
}

Once the debugging is turned on, you can capture the output in any Windows debugger or dbgview. Notice that this call can be made as soon as the DLL is loaded, before connecting to any device, allowing you to log even the opening and closing of the device. Keep in mind that the debug output can significantly slow the throughput of the DLL - do not leave the debugging on all of the time.