#include "j2534_v0404.h"

long PassThruSetProgrammingVoltage(unsigned long DeviceID, unsigned long PinNumber, unsigned long Voltage);

Output a programmable voltage on the specified J1962 connector pin. Only one pin can have a specified voltage applied at a time. The only exception: it is permissible to program pin 15 for SHORT_TO_GROUND, and another pin to a voltage level.
When switching pins, the user application must disable the first voltage (VOLTAGE_OFF option) before enabling the second. The user application protect against applying any incorrect voltage levels. A current in excess of 200mA will damage CarDAQ; do not ground the FEPS line while energized, even briefly.

DeviceID  - Vehicle interface identifier.
PinNumber  - The J1962 connector pin to which the PassThru device will apply the specified voltage.
Voltage  - The voltage value (in millivolts) that will be applied to the specified pin. CarDAQ supports a programmed voltage range of 5000mV to 20000mV with a tolerance of 100 millivolts. The voltage change slope has a maximum settling time of 1 millisecond.


unsigned long Flags = 0;
unsigned long ChannelID;
unsigned long DeviceID;
unsigned long PinNumber;

PassThruOpen(NULL, &DeviceID);

PinNumber = 15;
PassThruSetProgrammingVoltage(DeviceID, PinNumber, SHORT_TO_GROUND);