// TAMS USB Switch Controller Example
// Change the pulse time of a switch.


#include <stdio.h>

#include "tamsSC.h"

main ()

{
	tHANDLE	handle;

	if (INVALID_HANDLE_VALUE == (handle = tamsSCstart (""))) {
		fprintf (stderr, tamsSCerror ());
		exit (1);
	}

	// Pulse Time is the number of milliseconds that the switch needs current in order to latch.
	// See the switch datasheet.  
	// Agilent 18xx and 87xx switches use 15mS.

	// 15mS is the default for the TAMS USB Switch Controller.

	
	// Set the pulse time on switch 4 to 20mS.
	
	tamsSCsetpulseTime (handle, SWITCH_4, 20);

	// Optionally:  with error checking.

	if (FAIL == tamsSCsetpulseTime (handle, SWITCH_4, 20))
		fprintf (stderr, tamsSCerror ());

}