Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring message mapping & callbacks for PCI-DIO-96 & 24 under Ni-DAQ 6.9.x?

I am trying to develop with the PCI-DIO-96 & PCI-DIO-24 (PCI-6503) in MSVC++ w/ Ni-DAQ version 6.9.1f28. I am trying to use the message mapping but have been unsuccessful in getting it to work. I simply want a function to be called when a digital input goes high.
Here are some code snipits of how I have attempted to configure this:

nStatus = Config_DAQ_Event_Message(m_nBoardID,
1, // mode : add message
_T(szTemp), // str : how to specify bit & port?
// tried "DI0" & "DI0.0"
// for port A bit 0
0, // DAQEvent :
1, // DAQTrigVal0
0, // DAQTrigVal1
0, // trigSkipCount
0, // preTrigScans
0, // postTrigScans
this->m_hWnd , // h
andle
WM_NIDAQ_MSG1 , // message
NULL // callbackAddr
);

Also tried with the callback, changing the last 3 parameters to:
...
0,// handle
0,// message
(unsigned long)(&myCallback));// callbackAddr

I have also found documentation on a "DIG_Change_Message_Config" function. It is documented in:
"NI-DAQ™ Function Reference Manual for PC Compatibles
Version 6.6 Data Acquisition Software for the PC ... August 1999 Edition Part Number 321645E-01" but it is not in the nidaq.h file I am using.

Any ideas?

-Bock
0 Kudos
Message 1 of 4
(3,553 Views)
Hello;

I'm attaching an example code that does the trick. You can use this example as the start point for your development.
Hope this helps.
Filipe
0 Kudos
Message 2 of 4
(3,553 Views)
Filipe,
I did not see any reference to the functions I am having issues with in the example you attached. Am I missing something? Was the incorrect file attached?

It looks like the sample code you attached is also for a different family of DIO cards. I am developing with the PCI-6503 & PCI-DIO-96 and had specific questions regarding the Config_DAQ_Event_Message & DIG_Change_Message_Config library calls.

thanks for your help,
Bock
Message 3 of 4
(3,553 Views)
Doug,

Did you ever get an answer to your question, or manage to
figure it out on your own? I'm facing the exact same problem myself.

Also, is there a chance you work in Dearborn?

Thanks
0 Kudos
Message 4 of 4
(3,553 Views)