Quantex GmbH
DE RU EN

PassThru Connect Creating a protocol connection

Description

The function establishes communication according to the specified protocol. The adapter supports two independent diagnostic lines. Each protocol is associated with its own line. Line 1 is connected to pins 6 and 14 of the OBD connector and only ISO15768 and CAN protocols can be connected to it. Line 2 is switched, and other protocols can be connected to it.  The lines are independent, simultaneous operation of two protocols is allowed. For example, ISO15765 and ISO14230 or ISO15765 and ISO15765_PS. The PS prefix means that the protocol can be switched to the terminals of the OBD connector.
Protocols ISO15765 and CAN as well as ISO15765_PS and CAN_PS can work on the same physical line at the same time. This means that you can initialize up to 4 protocols in one adapter at a time. The set speeds for each protocol pair should be the same. For example, ISO15765 and CAN with a speed of 500 Kbit on 6 and 14 pins of the OBD connector and ISO15765_PS and CAN_PS with a speed of 125 Kbit on 3 and 11 pins.

long PassThruConnect(unsigned long DeviceID, unsigned long ProtocolID, unsigned long Flags, unsigned long BaudRate, unsigned long *pChannelID)

Options

Returned error codes

Definition Description
STATUS_NOERROR Function completed successfully
ERR_DEVICE_NOT_CONNECTED No connection to adapter. Possible reasons: The adapter is turned off, there is no network, or the IP address is not set correctly.
ERR_INVALID_DEVICE_ID Set a non-existent adapter ID DeviceID
ERR_NOT_SUPPORTED SCI protocols on 04/04/16 are not yet supported by the adapter. This error also occurs if incompatible protocols are specified. For example, VPW and PWM are set simultaneously.
ERR_INVALID_PROTOCOL_ID A non-existent ProtocolID is specified.
ERR_NULL_PARAMETER The pDeviceID pointer is not specified.
ERR_INVALID_FLAGS A flag does not exist
ERR_INVALID_BAUDRATE Wrong exchange rate set
ERR_CHANNEL_IN_USE The channel is already in use. Defined by the J2534 standard.
Actually this error code will never appear. Since when calling the PassThruConnect command again, the PassThruDisconnect command will be automatically called and the channel will be reopened.
ERR_FAILED Defined by the J2534 standard. In the adapter, it is not used for this function.

Example

#include "j2534_lib.hpp"

unsigned long DeviceID;
long Ret;
unsigned long ChannelID;
unsigned long Flags = ISO9141_K_LINE_ONLY;

Ret = PassThruConnect(DeviceID, ISO14230, Flags, 10400, &ChannelID);
if (Ret != STATUS_NOERROR)
{	// Error handling
}