I've just installed my board DIO-96 and can't seem to toggle the state of a line to 0 and measure the result. The DIG_Out_Line function and DIG_In_Line functions are both executed, but the line state winds up as 1 no matter what the argument to DIG_Out_Line is. The board is definitely installed because my program has it returning a hexadecimal base address-- The IO is just messed up. Perhaps I'm configuring the port wrong? Here's my code (I've cut some
irrelevant parts out):
-----------------------------------------------
#include "c:\Program Files\National Instruments\NI-DAQ\Include\nidaq.h"
#include "c:\Program Files\National Instruments\NI-DAQ\Include\nidaqcns.h"
#include "c:\Program Files\National Instruments\NI-DAQ
\Include\nidaqex.h"
#include "iostream.h"
#include "malloc.h"
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include
#include
void main(void)
{
int deviceNumber= 1;
int portNumber= 6;
int mode= 0;
int dir= 3;
int lineNumber= 0;
short lineState= 0;
short* addr= &lineState;
FILE* OUTFILE= fopen("output.txt", "wb");
int status = DIG_Prt_Config (deviceNumber, portNumber, mode, dir);
status = DIG_Out_Line (deviceNumber, portNumber, lineNumber, lineState);
status = DIG_In_Line (deviceNumber, portNumber, lineNumber, addr);
status = Get_DAQ_Device_Info (deviceNumber, ND_BASE_ADDRESS, infoValue);
cout<<"The base address is "<<<"and the final output state of the line is "<<<"\n";
}
-----------------------------------------------
So what is going on here?