I'm working on a software using NI6533 and Ni-Daqmx I must get continuously data on 32 bits(port 0-3) and I want to send data on the control line not used(port5). I build 2 tasks: - 1 to read data each 0.5s - 1 to write data on demand
here is a summary of my code: // continuous acquisition i_res = DAQmxCreateTask("Tache Acquisition Dev2",&AcqDev2TaskHandle); if(i_res == 0) i_res = DAQmxCreateDIChan(AcqDev2TaskHandle, "Dev2/port0_32", "Start Dev2", DAQmx_Val_ChanForAllLines); if(i_res == 0)
i_res = DAQmxCfgSampClkTiming (AcqDev2TaskHandle, "OnboardClock",
2, DAQmx_Val_Rising, DAQmx_Val_ContSamps,
ONE_SAMPLE_PER_CHANEL); if(i_res == 0) { i_res = DAQmxSetBufferAttribute(AcqDev2TaskHandle, DAQmx_Buf_Input_BufSize, 10000); }
My problem: I read data correctly until I write data on port 5! After
a first call of the writing function, I can always read but when I call
the write function for the second time, my read function returns always
0 as buffer read!!! The Ni-DAQmx functions do not return any error.