joeyjoejoe
2008-05-29 21:10:07 UTC
hello, I'm having a problem. I'm working with VC++ and a 6533 (DIO 32-hs) nidaq card. I'd like to send out a short patterned output every time a trigger TTL signal is sent to the 6533 card. I've hooked up a TTL pulse generator to line 3 ( ACK1 StartTrig1) of the 6533. I have an output wire from line 10 (DIOA0) connected to my oscilloscope. I have working VC++ GUI code which will send a patterned output every time I press the 'ok' button. This code does not use any externally provided triggers, (int startTrig = 0). However, when I modified the code so that startTrig=1 (hardware trigger activated on +trigger line transition), this seems to have no effect and the program performs exactly the same, i.e. patterned output is sent out whenver I press the 'ok' button regardless of an external trigger being present or not. My code is below. I FIGURED THAT after I pressed 'ok' the 6533 would then wait for a external trigger input before sending the patterned output, but this is not the case, the 6533 outputs the pattern imediately when I press 'ok' (regardless of whether the external trigger wire is attached or not).###########################################################BLOCK BELOW OCCURS AT PROGRAM INITIALIZATION:############################################################# i16 iStatus = 0; i16 iRetVal = 0; i16 iIgnoreWarning = 0; int port = 0; //(with group = 2 and port = 0 uses port A and B) int dir = 1; //(1=output) int startTrig = 1; //(hardware start) int startPol = 0; //(n/a, but 0 = high) int stopTrig = 0; //(0 = software, 1 = hardware) int stopPol = 0; int ptsAfterStopTrig = 0; //(n/a) int pattern = 0; //(n/a) int patternMask = 0; //(n/a) int config = 2; //(enable pattern gen, i.e. no request latching) //int reqInterval = 10; //(2 - 65,535) int externalGate = 0; //(no other option) int groupSize = 2; //(2 ports) int reqSource = 0; int timebaseForStim = 1; //(-3=50ns, 1=1us, 3=100us, 4=1ms, 5=10ms, change this later) int reqIntervalForStim = 50; //multiply this by the timebaseForStim to get the usec per bit int usPerBit = 1 * reqIntervalForStim; //the 1 signifies the 1us that timebasForStim is set to (1 -> 1us)//------NIDAQ Initialization------ iStatus = DIG_Grp_C