07-11-2023 12:11 PM
Hello, I'm new to this software, and I still have some basic questions.
I want to perform a simple read of a Digital Input, but my code is not working.
Can you help me?
Here's the code below.
Thank you in advance.
//----------------------------Defined in Header file
07-12-2023 05:11 AM - edited 07-12-2023 05:13 AM
I would double check the channel definition: that quotation mark in the middle of the channel name seems not correct.
The golden rule in these cases is not to limit yourself to "it does not work" but go a bit further verifying the return code from the functions; I see you are extensively using DAQmxErrChk macro: in case of error this macro jumps to Error: label where you can decode 'error' variable using some code like this (taken from a sample program shipped with DAQMx):
if( DAQmxFailed(error) ) {
DAQmxGetExtendedErrorInfo(errBuff,2048);
MessagePopup("DAQmx Error",errBuff);
}