Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggered 6533 Output in C++

long status = 0;

int group = 1;
int groupSize = 1;
int port = 1;
int dir = 1;

int config = 1;
int reqSource = 0;
int timebase = 4;


int startTrig = 1;
int startPol = 0;

int count = 2;

unsigned long remaining;

if(signal.value != 0)
{
status = DIG_Grp_Config(address, group, groupSize, port, dir); //SET for 0 = A

//status = DIG_Grp_Mode(address, group, protocol, edge, 0, 1, 0);

status = DIG_Block_PG_Config(address,group,config,reqSource,timebase,signal.value,0); //Set the pulse width to the signal value

//status = DIG_Trigger_Config(address, group,startTrig,startPol,0,0,0,0,0);

statusPXI6533[0] = pow(2.0,double(signal.startWord));

status = DIG_Block_Out(address, group, &statusPXI6533[0],count);

//status = DIG_Out_Grp(address, 1, signal.value);

remaining = 1;
while(remaining != 0)
{
DIG_Block_Check(address,1,&remaining);
}

DIG_Block_Clear(address, 1);

signal.value = 0;

}
0 Kudos
Message 1 of 3
(3,268 Views)
I accidently posted my code before I posted my question. What I am trying to do is generate a pulse on a pin when the ACK line goes high. I tried to follow the example on page 2-24 of the user manual but it doesn't seem to be working. I KNOW THAT IN THE POSTED CODE THE DIG_Trigger_Config LINE IS COMMENTED OUT. The code works fine with trigger line commented out, i.e. it generates a pulse on the correct pin for the correct amount of time. When the DIG_Trigger_Config line is added the correct pin goes high and it stays high even though the trigger never goes high and the pulse time has passed. Please let me know if you have any suggestions. Thanks Joe
0 Kudos
Message 2 of 3
(3,265 Views)
Hello Joe_Codder

I noticed that you have commented out the line in your program that sets the generation mode. The trigger function that you are referring to is only available in Pattern Generation mode. For more information about each function, you can go the Tadionnal NI-DAQ function reference by going to Start->National Instruments->NI-DAQ on your Windows machine.
Hope this helps.

Serges L.
0 Kudos
Message 3 of 3
(3,253 Views)