我用的是NI PCI6251,不接任何线缆,运行National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values\Write Dig Chan和National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Read Dig Chan这两个例子,其实我是想理解读/写数字通道的操作,按我的理解,Write Dig Chan程序调用DAQmxWriteDigitalLines写uInt8 data[8]={1,1,1,1,1,1,1,1};到"Dev1/port0/line0:7"后,port0的所有位(0~7)都置为1,那么DAQmxReadDigitalLines从"Dev1/port0/line0:7"读到的也应该都是1,但实际读出来的是:
Data acquired, channel 0: 0x0
Data acquired, channel 1: 0x0
Data acquired, channel 2: 0x0
Data acquired, channel 3: 0x0
Data acquired, channel 4: 0x0
Data acquired, channel 5: 0x0
Data acquired, channel 6: 0x0
Data acquired, channel 7: 0x0
这我就有点想不通了,难道程序退出后,数字通道的各脚不保持状态?
硬件方面我不懂,不知我的理解有没有问题,请指教,谢谢!