Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I test / measure the NI DAQ 6527 board output

Hello everybody

How can I test / measure the NI DAQ 6527 board output ?

When I run the folowing code I cant see / measure the output on the 'Dev1/port5/line0:7' chanel.

If anyone knowns some method please help me, because on the selected 'Dev1/port5/line0' chanel I can't measure any voltage difference.

Thank you for any advise.

=========================================================================================

#include <unistd.h>
#include <stdio.h>
#include <NIDAQmx.h>

#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else

int main(void)
{
        int32       error=0;
        TaskHandle  taskHandle=0;
        uInt8       data[8]={1,0,0,0,0,0,0,0};
        char        errBuff[2048]={'\0'};

        int         i = 0;

        /*********************************************/
        // DAQmx Configure Code
        /*********************************************/
        DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
        DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port5/line0:7","",DAQmx_Val_ChanForAllLines));

        /*********************************************/
        // DAQmx Start Code
        /*********************************************/
        DAQmxErrChk (DAQmxStartTask(taskHandle));

        /*********************************************/
        // DAQmx Write Code
        /*********************************************/
        while(i++<60)
        {
        data[i%8] = !data[i%8];
        data[0] = 1;
        printf("Write ports sample No...[%d] - ", i);
        printf("data[");
        int j = 0;
        for(j=0; j<8;j++)
        {
          printf("%d ", data[j]);
        }
        printf("]\n");

        DAQmxErrChk (DAQmxWriteDigitalLines(taskHandle,1,1,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));
        printf("Write end \n");

        uInt32 data_r = 0;
        int32  read_r = 0;
        DAQmxErrChk (DAQmxReadDigitalU32(taskHandle,1,10.0,DAQmx_Val_GroupByChannel,&data_r,1,&read_r,NULL))
        printf("Data acquired: 0x%X\n",data_r);
        sleep(1);
        }

Error:
        if( DAQmxFailed(error) )
                DAQmxGetExtendedErrorInfo(errBuff,2048);
        if( taskHandle!=0 ) {
                /*********************************************/
                // DAQmx Stop Code
                /*********************************************/
                DAQmxStopTask(taskHandle);
                DAQmxClearTask(taskHandle);
        }
        if( DAQmxFailed(error) )
                printf("DAQmx Error: %s\n",errBuff);
        printf("End of program, press Enter key to quit\n");
        getchar();
        return 0;
}

0 Kudos
Message 1 of 4
(3,084 Views)
Please help me somebody whit an functional electric schema ...
0 Kudos
Message 2 of 4
(3,073 Views)
Hi hdarkspirit,

The PCI/PXI - 6527 is able to do Digital Inputs and Digital Switch Outputs. It is able to switch voltages of upto 60 VDC (30 Vrms AC) and currents of upto 120 mA. To be able to measure a digital output you would have to provide a voltage or current source. You can connect the source either in a Sourcing or Sinking configuration, depending on where you place your load. You can find the user manual here. Pages 3-10 to 3-12 talk about how to make the signal connections for a switch output. Appendix A has a all the specifications for this card including the On Resistance and Output Capacitance.

If you are programming in LabWindows CVI take a look at some of the Digital output examples that can be found in the Example Finder. You can find example programs written in C at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values. These example programs should give you a good idea on how to go about programming for Digital output.

Have a good one.

Malay D
Applications Engineer
National Instruments.

Message Edited by 50ohmTerminator on 10-09-2006 10:57 AM

Message Edited by 50ohmTerminator on 10-09-2006 11:01 AM

0 Kudos
Message 3 of 4
(3,060 Views)
Thanks.

The problem is solved with the help from an electrician engineers whitch undersand the electric schema.

At this moment evriting is ok.

THANKS.
0 Kudos
Message 4 of 4
(3,041 Views)