02-26-2020 03:51 AM
I have problem with open-collector measurement.
I use Windows 10, NI-DAQmx 19.6, Visual Studio 2013 C++, cDAQ-9178 and NI-9361.
The NI 9361 provides a 5 V pull-up, but it seems to be always zero.
DAQmxCreateTask("", &taskHandle);
int32 start = 0;
DAQmxCreateCICountEdgesChan(taskHandle, "Dev1/ctr0", "", DAQmx_Val_Rising, start , DAQmx_Val_CountUp);
DAQmxSetCICountEdgesTermCfg(taskHandle, "Dev1/ctr0", DAQmx_Val_RSE);
DAQmxSetCICountEdgesCountDirLogicLvlBehavior(taskHandle, "Dev1/ctr0", DAQmx_Val_LogicLevelPullUp);
printf("End of program, press Enter key to quit\n");
getchar();
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
While this sample is running and I measure counter 0 voltage between PFI0 (pin 9, DI+) and COM (pin 36), it is zero.
What is wrong ?
03-03-2020 08:20 PM
Did you find this code somewhere or did you write yourself?
You have the task created and settings set but there doesn't seem to be a command to start the task.
03-04-2020 03:34 AM
Thank you for your response , before printf("End of program...") I have DAQmxStartTask(taskHandle);
(sorry, my mistake).
This is one of sample codes, which i have modified.
DAQmxGetCICountEdgesCountDirLogicLvlBehavior - function returns DAQmx_Val_LogicLevelPullUp, which is correct, but 5 V is missing.
Zardas
03-05-2020 08:13 PM
What do you have the +5V wired to? Could you share your wiring diagram?