Functions > di_get_acq_header

Syntax 

The di_get_acq_header function allows you to retrieve header information (sample rate, number of channels, etc.) from WinDaq Acquisition software while it is running.

Syntax 

CODASHDR far * di_get_acq_header(void);

Parameters

none

Return Value

The di_get_acq_header function returns a far pointer to the CODAS header structure (allocated by WinDaq waveform recording software), or NULL if the structure is not available.

Dependencies

A running WinDaq application.

Remarks

This function is used in conjunction with WinDaq waveform recording software to access header file information (e.g., sample rate, number of channels, etc.) Complete header file details can be found online at http://www.dataq.com/support/techinfo/ff.htm. For example, suppose you wanted to write an application that would intercept the data from WinDaq’s data buffer and apply a moving average to it. You would call di_get_acq_header to find out the sampling rate, number of enabled channels, etc

If the programming language you are using accepts Windows™ messages (such as C or C++), you can register the messages “WindaqUpdate” and “WindaqExit”, which will notify you whenever WinDaq waveform recording settings (sample rate, channels, etc.) change. The example segment of code shows how this can be implemented.

Sample Code

#include "200sdk.h"

.

.

.

UINT wm_WindaqUpdate;

UINT wm_WindaqExit;

int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)

{ CODASHDR far * lpCODASHDR;

.

.

.

wm_WindaqUpdate=RegisterWindowMessage("WindaqUpdate");

wm_WindaqExit=RegisterWindowMessage("WindaqExit");

.

.

.

lpCODASHDR=di_get_acq_header();

/* Now you can set up your app according to WINDAQ */

}

LONG FAR PASCAL WndProc(HWND hWnd, WORD Message, WORD wParam, LONG lParam)

{ CODASHDR far * lpCODASHDR;

.

.

.

if (Message==wm_WindaqUpdate){

/* WINDAQ/x00 changes its setting */

lpCODASHDR=di_get_acq_header();

/* Now you can change settings of your app according to WINDAQ*/

.

.

.

};

if (Message==wm_WindaqExit){

/* WINDAQ quits */

};

}

 

Copyright © DATAQ Instruments, Inc.