National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference Config_DAQ_Event_Message
NI-DAQ FRM for PC Compatibles 2-80
©
National Instruments Corporation
For the parameters that are ignored, set them to 0.
For DAQEvent = 1, DAQTrigVal0 must be greater than zero. If you are using DMA with
double buffers or a pretrigger data acquisition, DAQTrigVal0 must be an even divisor of the
buffer size in scans.
For DAQEvent = 1 on an analog output channel, DAQTrigVal0 must always be an even
divisor of the buffer size or a multiple of it.
handle is the handle to the window you want to receive a Windows message in when
DAQEvent happens. If handle is 0, no Windows messages are sent.
message is a message you define. When DAQEvent happens, NI-DAQ passes message back
to you. message can be any value.
callbackAddr is the address of the user callback function. NI-DAQ calls this function when
DAQEvent occurs. If you do not want to use a callback function, set callbackAddr to 0.
Using This Function
This function notifies your application when DAQEvent occurs. Using DAQEvents
eliminates continuous polling of asynchronous operations through NI-DAQ functions.
For example, if you have a double-buffered DAQ application, instead of calling
DAQ_DB_HalfReady continuously, you can call Config_DAQ_Event_Message and set
DAQEvent to 1 and DAQTrigVal0 to be one-half your buffer size in units of scans. Then,
NI-DAQ notifies your application when it is time to call
DAQ_DB_Transfer. The same
concept applies to digital input/output block functions and analog output functions.
To define a message, call
Config_DAQ_Event_Message before starting your DAQ process.
You can associate more than one message to the same device by calling
Config_DAQ_Event_Message as many times as you need to.
After you define a message, it remains active until you call
Init_DA_Brds or
Config_DAQ_Event_Message to remove messages. To remove a specific message, call
Config_DAQ_Event_Message with mode set to 2. When removing a specific message,
make sure to provide all the information defining the message, such as chanStr
(SCXIchassisID, moduleSlot, chanType, chan), DAQEvent, DAQTrigVal0,
DAQTrigVal1, trigSkipCount, preTrigScans, postTrigScans, handle, message, and
callbackAddr.
To remove all messages associated with the device, call
Config_DAQ_Event_Message with
mode set to zero and with all other arguments except deviceNumber set to zero.