Discussion:
6533 (32-hs) Triggered Pattern Output Setup
(too old to reply)
joeyjoejoe
2008-05-29 21:10:07 UTC
Permalink
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
joeyjoejoe
2008-05-30 19:10:07 UTC
Permalink
hm, the attchament didn't work with my last post, here it is again, this is a working visual c++ project in which there is a single button which when pressed should load data into the buffer and then wait for an external trigger to send the data out. However what happens is that when the button is pressed the data is sent out instantly and the trigger has no effect. I changed the attached file's extension to .zip because this website won't let me upload it as what it is:  a .rar (winrar compressed) file. So you would have to rename it to .rar when you download it.


Hardware Triggered Stimulation.zip:
http://forums.ni.com/attachments/ni/70/8947/1/Hardware Triggered Stimulation.zip
joeyjoejoe
2008-05-30 22:40:06 UTC
Permalink
ok, I finally after two days of trying different things figured out how to make it work. It was a simple matter of switching the order of the DIG_Block_PG_Config     and the      DIG_Trigger_Config   Apparently the trigger config HAS TO come AFTER the block_pg config. This is probably due to interactions between the effects of the two functions and the fact that they each contain trigger-like mechanisms which can supersede each others effects. so here's the correct order:     iStatus = DIG_Block_PG_Config (deviceNumber, group, config, reqSource, timebaseForStim, reqIntervalForStim, externalGate);                iStatus = DIG_Trigger_Config (deviceNumber, group, 1, startPol, stopTrig, stopPol, ptsAfterStopTrig, pattern, patternMask);
Continue reading on narkive:
Search results for '6533 (32-hs) Triggered Pattern Output Setup' (Questions and Answers)
6
replies
examples of math trivias?
started 2006-12-04 18:54:22 UTC
mathematics
Loading...