Building Win32 ADCs

The sample makefile supplied DP4ADC.MAK should be used either directly or as a template for your own. Remember that the auxuser.c module supplied is an empty source code template for you to add your own code. You may wish to rename this file for your own purposes. If you do this, do not link the auxuser.obj file supplied otherwise you will get multiply defined symbols.

To build the example AUXDEBUG program, use the following command line:

NMAKE -F DP4ADC.MAK AUXDEBUG.W32

Viewing Diagnostics with ERRLOG

On Win32 platforms the debug output from AUXDEBUG (and many other DP4 programs) is generated using special printf() statements, which are normally displayed in the DP4 error logging program ERRLOG.W32 . (The printf() used by the Windows AUXDEBUG program is implemented in syslibt.dll and linked in from syslibt.lib rather than from the normal C library. So this library must be linked before libc.lib.)

If you want to use ERRLOG, add/modify the following sections of your datafit.ini file:

[system]
load_errlog=1
[errlog]
debug_echo=1

You can configure ERRLOG's functionality by editing the lines in the [errlog] section. For example set debug_echo=0 to suppress the real-time window display. The other entries in this section control diagnostics from various DP4 libraries or programs.

It is also possible to output printf() to a special console window. Each DP4 process will have its own console window which will receive its diagnostics. (This works on all Win32 platforms, and is not NT specific as was stated in an earlier version of this document)

To do this add/modify the following section in your datafit.ini file:

[win32]
debug_console=1

On Window Nt and 2000 You must also ensure that the service startup parameters have the 'Allow service to interact with desktop' option enabled (using the 'Startup' button in the Service control panel).

You can use errlog diagnostics in any DP4 program on win32 platforms. Simply follow the same procedure of using printf() for diagnostics, and link with syslibt.lib before libc.lib. Please note that floating point output is not currently implemented in this version of printf().