

Information in one place, instead of two. Number of samples or channels in your code, you will only need to change this Of the advantages for using it, however, are if you ever need to changed the Specified when you registered the event have been transferred to the buffer.įar as your other questions about the DAQmxGetTaskNumChans function, I do notīelieve you need to use this function if you already know the number of samples In your case your EveryNSamplesEventHandlerĭAQmxReadBinary16 function), will be fired as soon as the number of samples you Task have been transferred to the buffer. I have an analog input task, and I specify 1000 samples in the DAQmxRegisterEveryNSamplesEventįunction, and I create a callback function that performs a digital read, myĭigital read function will be fired as soon as 1000 samples of the analog input (see the NI-DAQmx C Reference Help for more

The DAQmxRegisterEveryNSamplesEvent registers a callbackįunction to receive an event when the specified number of samples is writtenįrom the device to the buffer or from the buffer to the device. It returns the number of samples which I also know what I am expecting.thanks for any help,Public Function EveryNSamplesEventHandler(ByVal taskhandle As Long, ByVal eventType As Long, ByVal numSamples As Long, ByVal callbackData As Long) As Long Dim numRead As Long Dim acqtype As Integer DAQm圎rrChk (DAQmxGetTaskNumChans(taskhandle, numChannels)) DAQm圎rrChk (DAQmxReadBinaryI16(taskhandle, numSamples, 10, DAQmx_Val_GroupByScanNumber, dataBuffer(0), numChannels * numSamples, numRead, ByVal 0)) Like I said I grabbed this from a sample but as I closely exam this I already know the value of numchannels so I don't think I need this function.I guess while I am asking I have the same question about the DAQmxGetTaskNumChans function when I am configuring my channels. Understand when my Read function actually happens.Ĭreate taskconfigure analog channelsstart taskwait for EveryNSamplesEventHandler to executeAlso do I need to use the DAQmxGetTaskNumChans before my READ function. I place my own codeĪfter my Read function and everything is working but I just don't Thinking that EveryNSamplesEventHandler fires after my acq hasĬompleted. My question is when does my DAQmxReadBinaryI16 function execute.
Ni componentworks datagraph manual#
I am writing up a manual that explains my code.
Ni componentworks datagraph code#
I found NI code samples that are working for me however I am not sure I understand in what order they are being executed. I have a working app that uses VB6 with NIDAQmx.
