#include #include #include #include static char ch; static NIVXI_STATUS Status; static UINT16 destination_trig, mode, source_trig; static INT16 controller; static int Map_SMB_to_trig, protocol, line; static INT32 timeout; void main () { Cls(); //clear STDIO window if ( InitVXIlibrary() ) //This function must be called to use VXI functions. { printf ("Unable to Initialize VXI library... exiting"); exit (0); } /* * Prompt the user for info regarding trigger line and protocol */ printf ("What line would you like to trigger? (0-7) >> "); scanf ("%d", &line); printf ("What protocol should be used? (options below)\n"); printf ("2 - Start\n3 - Stop\n4 - Sync\n5 - Semi-sync\n7 - Async\n>> "); scanf ("%d", &protocol); /* * To make a trigger, we will use the function, SrcTrig. The * parameters are: * * controller: specifies the logical address of the controller to use * line: specifies the Trigger line to source * protocol: specifies the protocol to use * timeout: specifies the timeout value in milliseconds */ controller = -1; //use default controller timeout = 1000; //timeout not used with protocols on UIR, //so setting it to 1 second. Status = SrcTrig (controller, line, protocol, timeout); if (Status) //error making trigger printf ("\nError making trigger.\n"); else //creation was successful printf ("\nTrigger created successfully.\n"); printf (""); getchar (); scanf ("%c", &ch); //wait for user to hit a key to quit CloseVXIlibrary(); //uninitialize VXI library }