Barst  2.0
A server that controls lab hardware.
cbw.h
1 /*************************************************************************
2  *
3  * Name: CBW.H
4  *
5  * C/C++ Windows header for Measurement Computing Universal Library
6  *
7  * (c) Copyright 1996-2014, Measurement Computing Corp.
8  * All rights reserved.
9  *
10  * This header file should be included in all C/C++ programs that will
11  * call the Measurement Computing Universal Library from Windows.
12  *
13  *
14  **************************************************************************/
15 
16 #if !defined (NT_DRIVER) && !defined (WIN95_DRIVER)
17 #include <windows.h>
18 #include <time.h>
19 #endif
20 
21 
22 /* Current Revision Number */
23 #define CURRENTREVNUM 6.3
24 
25 /* System error code */
26 #define NOERRORS 0 /* No error occurred */
27 #define BADBOARD 1 /* Invalid board number specified */
28 #define DEADDIGITALDEV 2 /* Digital I/O device is not responding */
29 #define DEADCOUNTERDEV 3 /* Counter I/O device is not responding */
30 #define DEADDADEV 4 /* D/A is not responding */
31 #define DEADADDEV 5 /* A/D is not responding */
32 #define NOTDIGITALCONF 6 /* Specified board does not have digital I/O */
33 #define NOTCOUNTERCONF 7 /* Specified board does not have a counter */
34 #define NOTDACONF 8 /* Specified board is does not have D/A */
35 #define NOTADCONF 9 /* Specified board does not have A/D */
36 #define NOTMUXCONF 10 /* Specified board does not have thermocouple inputs */
37 #define BADPORTNUM 11 /* Invalid port number specified */
38 #define BADCOUNTERDEVNUM 12 /* Invalid counter device */
39 #define BADDADEVNUM 13 /* Invalid D/A device */
40 #define BADSAMPLEMODE 14 /* Invalid sampling mode option specified */
41 #define BADINT 15 /* Board configured for invalid interrupt level */
42 #define BADADCHAN 16 /* Invalid A/D channel Specified */
43 #define BADCOUNT 17 /* Invalid count specified */
44 #define BADCNTRCONFIG 18 /* invalid counter configuration specified */
45 #define BADDAVAL 19 /* Invalid D/A output value specified */
46 #define BADDACHAN 20 /* Invalid D/A channel specified */
47 #define ALREADYACTIVE 22 /* A background process is already in progress */
48 #define PAGEOVERRUN 23 /* DMA transfer crossed page boundary, may have gaps in data */
49 #define BADRATE 24 /* Inavlid sampling rate specified */
50 #define COMPATMODE 25 /* Board switches set for "compatible" mode */
51 #define TRIGSTATE 26 /* Incorrect intial trigger state D0 must=TTL low) */
52 #define ADSTATUSHUNG 27 /* A/D is not responding */
53 #define TOOFEW 28 /* Too few samples before trigger occurred */
54 #define OVERRUN 29 /* Data lost due to overrun, rate too high */
55 #define BADRANGE 30 /* Invalid range specified */
56 #define NOPROGGAIN 31 /* Board does not have programmable gain */
57 #define BADFILENAME 32 /* Not a legal DOS filename */
58 #define DISKISFULL 33 /* Couldn't complete, disk is full */
59 #define COMPATWARN 34 /* Board is in compatible mode, so DMA will be used */
60 #define BADPOINTER 35 /* Invalid pointer (NULL) */
61 #define TOOMANYGAINS 36 /* Too many gains */
62 #define RATEWARNING 37 /* Rate may be too high for interrupt I/O */
63 #define CONVERTDMA 38 /* CONVERTDATA cannot be used with DMA I/O */
64 #define DTCONNECTERR 39 /* Board doesn't have DT Connect */
65 #define FORECONTINUOUS 40 /* CONTINUOUS can only be used with BACKGROUND */
66 #define BADBOARDTYPE 41 /* This function can not be used with this board */
67 #define WRONGDIGCONFIG 42 /* Digital I/O is configured incorrectly */
68 #define NOTCONFIGURABLE 43 /* Digital port is not configurable */
69 #define BADPORTCONFIG 44 /* Invalid port configuration specified */
70 #define BADFIRSTPOINT 45 /* First point argument is not valid */
71 #define ENDOFFILE 46 /* Attempted to read past end of file */
72 #define NOT8254CTR 47 /* This board does not have an 8254 counter */
73 #define NOT9513CTR 48 /* This board does not have a 9513 counter */
74 #define BADTRIGTYPE 49 /* Invalid trigger type */
75 #define BADTRIGVALUE 50 /* Invalid trigger value */
76 #define BADOPTION 52 /* Invalid option specified for this function */
77 #define BADPRETRIGCOUNT 53 /* Invalid pre-trigger count sepcified */
78 #define BADDIVIDER 55 /* Invalid fout divider value */
79 #define BADSOURCE 56 /* Invalid source value */
80 #define BADCOMPARE 57 /* Invalid compare value */
81 #define BADTIMEOFDAY 58 /* Invalid time of day value */
82 #define BADGATEINTERVAL 59 /* Invalid gate interval value */
83 #define BADGATECNTRL 60 /* Invalid gate control value */
84 #define BADCOUNTEREDGE 61 /* Invalid counter edge value */
85 #define BADSPCLGATE 62 /* Invalid special gate value */
86 #define BADRELOAD 63 /* Invalid reload value */
87 #define BADRECYCLEFLAG 64 /* Invalid recycle flag value */
88 #define BADBCDFLAG 65 /* Invalid BCD flag value */
89 #define BADDIRECTION 66 /* Invalid count direction value */
90 #define BADOUTCONTROL 67 /* Invalid output control value */
91 #define BADBITNUMBER 68 /* Invalid bit number */
92 #define NONEENABLED 69 /* None of the counter channels are enabled */
93 #define BADCTRCONTROL 70 /* Element of control array not ENABLED/DISABLED */
94 #define BADEXPCHAN 71 /* Invalid EXP channel */
95 #define WRONGADRANGE 72 /* Wrong A/D range selected for cbtherm */
96 #define OUTOFRANGE 73 /* Temperature input is out of range */
97 #define BADTEMPSCALE 74 /* Invalid temperate scale */
98 #define BADERRCODE 75 /* Invalid error code specified */
99 #define NOQUEUE 76 /* Specified board does not have chan/gain queue */
100 #define CONTINUOUSCOUNT 77 /* CONTINUOUS can not be used with this count value */
101 #define UNDERRUN 78 /* D/A FIFO hit empty while doing output */
102 #define BADMEMMODE 79 /* Invalid memory mode specified */
103 #define FREQOVERRUN 80 /* Measured frequency too high for gating interval */
104 #define NOCJCCHAN 81 /* Board does not have CJC chan configured */
105 #define BADCHIPNUM 82 /* Invalid chip number used with cbC9513Init */
106 #define DIGNOTENABLED 83 /* Digital I/O not enabled */
107 #define CONVERT16BITS 84 /* CONVERT option not allowed with 16 bit A/D */
108 #define NOMEMBOARD 85 /* EXTMEMORY option requires memory board */
109 #define DTACTIVE 86 /* Memory I/O while DT Active */
110 #define NOTMEMCONF 87 /* Specified board is not a memory board */
111 #define ODDCHAN 88 /* First chan in queue can not be odd */
112 #define CTRNOINIT 89 /* Counter was not initialized */
113 #define NOT8536CTR 90 /* Specified counter is not an 8536 */
114 #define FREERUNNING 91 /* A/D sampling is not timed */
115 #define INTERRUPTED 92 /* Operation interrupted with CTRL-C */
116 #define NOSELECTORS 93 /* Selector could not be allocated */
117 #define NOBURSTMODE 94 /* Burst mode is not supported on this board */
118 #define NOTWINDOWSFUNC 95 /* This function not available in Windows lib */
119 #define NOTSIMULCONF 96 /* Not configured for simultaneous update */
120 #define EVENODDMISMATCH 97 /* Even channel in odd slot in the queue */
121 #define M1RATEWARNING 98 /* DAS16/M1 sample rate too fast */
122 #define NOTRS485 99 /* Board is not an RS-485 board */
123 #define NOTDOSFUNC 100 /* This function not avaliable in DOS */
124 #define RANGEMISMATCH 101 /* Unipolar and Bipolar can not be used together in A/D que */
125 #define CLOCKTOOSLOW 102 /* Sample rate too fast for clock jumper setting */
126 #define BADCALFACTORS 103 /* Cal factors were out of expected range of values */
127 #define BADCONFIGTYPE 104 /* Invalid configuration type information requested */
128 #define BADCONFIGITEM 105 /* Invalid configuration item specified */
129 #define NOPCMCIABOARD 106 /* Can't acces PCMCIA board */
130 #define NOBACKGROUND 107 /* Board does not support background I/O */
131 #define STRINGTOOSHORT 108 /* String passed to cbGetBoardName is to short */
132 #define CONVERTEXTMEM 109 /* Convert data option not allowed with external memory */
133 #define BADEUADD 110 /* e_ToEngUnits addition error */
134 #define DAS16JRRATEWARNING 111 /* use 10 MHz clock for rates > 125KHz */
135 #define DAS08TOOLOWRATE 112 /* DAS08 rate set too low for AInScan warning */
136 #define AMBIGSENSORONGP 114 /* more than one sensor type defined for EXP-GP */
137 #define NOSENSORTYPEONGP 115 /* no sensor type defined for EXP-GP */
138 #define NOCONVERSIONNEEDED 116 /* 12 bit board without chan tags - converted in ISR */
139 #define NOEXTCONTINUOUS 117 /* External memory cannot be used in CONTINUOUS mode */
140 #define INVALIDPRETRIGCONVERT 118 /* cbAConvertPretrigData was called after failure in cbAPretrig */
141 #define BADCTRREG 119 /* bad arg to CLoad for 9513 */
142 #define BADTRIGTHRESHOLD 120 /* Invalid trigger threshold specified in cbSetTrigger */
143 #define BADPCMSLOTREF 121 /* No PCM card in specified slot */
144 #define AMBIGPCMSLOTREF 122 /* More than one MCC PCM card in slot */
145 #define BADSENSORTYPE 123 /* Bad sensor type selected in Instacal */
146 #define DELBOARDNOTEXIST 124 /* tried to delete board number which doesn't exist */
147 #define NOBOARDNAMEFILE 125 /* board name file not found */
148 #define CFGFILENOTFOUND 126 /* configuration file not found */
149 #define NOVDDINSTALLED 127 /* CBUL.386 device driver not installed */
150 #define NOWINDOWSMEMORY 128 /* No Windows memory available */
151 #define OUTOFDOSMEMORY 129 /* ISR data struct alloc failure */
152 #define OBSOLETEOPTION 130 /* Obsolete option for cbGetConfig/cbSetConfig */
153 #define NOPCMREGKEY 131 /* No registry entry for this PCMCIA board */
154 #define NOCBUL32SYS 132 /* CBUL32.SYS device driver is not loaded */
155 #define NODMAMEMORY 133 /* No DMA buffer available to device driver */
156 #define IRQNOTAVAILABLE 134 /* IRQ in being used by another device */
157 #define NOT7266CTR 135 /* This board does not have an LS7266 counter */
158 #define BADQUADRATURE 136 /* Invalid quadrature specified */
159 #define BADCOUNTMODE 137 /* Invalid counting mode specified */
160 #define BADENCODING 138 /* Invalid data encoding specified */
161 #define BADINDEXMODE 139 /* Invalid index mode specified */
162 #define BADINVERTINDEX 140 /* Invalid invert index specified */
163 #define BADFLAGPINS 141 /* Invalid flag pins specified */
164 #define NOCTRSTATUS 142 /* This board does not support cbCStatus() */
165 #define NOGATEALLOWED 143 /* Gating and indexing not allowed simultaneously */
166 #define NOINDEXALLOWED 144 /* Indexing not allowed in non-quadratue mode */
167 #define OPENCONNECTION 145 /* Temperature input has open connection */
168 #define BMCONTINUOUSCOUNT 146 /* Count must be integer multiple of packetsize for recycle mode. */
169 #define BADCALLBACKFUNC 147 /* Invalid pointer to callback function passed as arg */
170 #define MBUSINUSE 148 /* MetraBus in use */
171 #define MBUSNOCTLR 149 /* MetraBus I/O card has no configured controller card */
172 #define BADEVENTTYPE 150 /* Invalid event type specified for this board. */
173 #define ALREADYENABLED 151 /* An event handler has already been enabled for this event type */
174 #define BADEVENTSIZE 152 /* Invalid event count specified. */
175 #define CANTINSTALLEVENT 153 /* Unable to install event handler */
176 #define BADBUFFERSIZE 154 /* Buffer is too small for operation */
177 #define BADAIMODE 155 /* Invalid analog input mode(RSE, NRSE, or DIFF) */
178 #define BADSIGNAL 156 /* Invalid signal type specified. */
179 #define BADCONNECTION 157 /* Invalid connection specified. */
180 #define BADINDEX 158 /* Invalid index specified, or reached end of internal connection list. */
181 #define NOCONNECTION 159 /* No connection is assigned to specified signal. */
182 #define BADBURSTIOCOUNT 160 /* Count cannot be greater than the FIFO size for BURSTIO mode. */
183 #define DEADDEV 161 /* Device has stopped responding. Please check connections. */
184 
185 #define INVALIDACCESS 163 /* Invalid access or privilege for specified operation */
186 #define UNAVAILABLE 164 /* Device unavailable at time of request. Please repeat operation. */
187 #define NOTREADY 165 /* Device is not ready to send data. Please repeat operation. */
188 #define BITUSEDFORALARM 169 /* The specified bit is used for alarm. */
189 #define PORTUSEDFORALARM 170 /* One or more bits on the specified port are used for alarm. */
190 #define PACEROVERRUN 171 /* Pacer overrun, external clock rate too fast. */
191 #define BADCHANTYPE 172 /* Invalid channel type specified. */
192 #define BADTRIGSENSE 173 /* Invalid trigger sensitivity specified. */
193 #define BADTRIGCHAN 174 /* Invalid trigger channel specified. */
194 #define BADTRIGLEVEL 175 /* Invalid trigger level specified. */
195 #define NOPRETRIGMODE 176 /* Pre-trigger mode is not supported for the specified trigger type. */
196 #define BADDEBOUNCETIME 177 /* Invalid debounce time specified. */
197 #define BADDEBOUNCETRIGMODE 178 /* Invalid debounce trigger mode specified. */
198 #define BADMAPPEDCOUNTER 179 /* Invalid mapped counter specified. */
199 #define BADCOUNTERMODE 180 /* This function can not be used with the current mode of the specified counter. */
200 #define BADTCCHANMODE 181 /* Single-Ended mode can not be used for temperature input. */
201 #define BADFREQUENCY 182 /* Invalid frequency specified. */
202 #define BADEVENTPARAM 183 /* Invalid event parameter specified. */
203 #define NONETIFC 184 /* No interface devices were found with required PAN ID and/or RF Channel. */
204 #define DEADNETIFC 185 /* The interface device(s) with required PAN ID and RF Channel has failed. Please check connection. */
205 #define NOREMOTEACK 186 /* The remote device is not responding to commands and queries. Please check device. */
206 #define INPUTTIMEOUT 187 /* The device acknowledged the operation, but has not completed before the timeout. */
207 #define MISMATCHSETPOINTCOUNT 188 /* Number of Setpoints not equal to number of channels with setpoint flag set */
208 #define INVALIDSETPOINTLEVEL 189 /* Setpoint Level is outside channel range */
209 #define INVALIDSETPOINTOUTPUTTYPE 190 /* Setpoint Output Type is invalid*/
210 #define INVALIDSETPOINTOUTPUTVALUE 191 /* Setpoint Output Value is outside channel range */
211 #define INVALIDSETPOINTLIMITS 192 /* Setpoint Comparison limit B greater than Limit A */
212 #define STRINGTOOLONG 193 /* The string entered is too long for the operation and/or device. */
213 #define INVALIDLOGIN 194 /* The account name and/or password entered is incorrect. */
214 #define SESSIONINUSE 195 /* The device session is already in use. */
215 #define NOEXTPOWER 196 /* External power is not connected. */
216 #define BADDUTYCYCLE 197 /* Invalid duty cycle specified. */
217 #define BADINITIALDELAY 199 /* Invalid initial delay specified */
218 #define NOTEDSSENSOR 1000 /* No TEDS sensor was detected on the specified channel. */
219 #define INVALIDTEDSSENSOR 1001 /* Connected TEDS sensor to the specified channel is not supported */
220 #define CALIBRATIONFAILED 1002 /* Calibration failed */
221 #define BITUSEDFORTERMINALCOUNTSTATUS 1003 /* The specified bit is used for terminal count stauts. */
222 #define PORTUSEDFORTERMINALCOUNTSTATUS 1004 /* One or more bits on the specified port are used for terminal count stauts. */
223 #define BADEXCITATION 1005 /* Invalid excitation specified */
224 #define BADBRIDGETYPE 1006 /* Invalid bridge type specified */
225 #define BADLOADVAL 1007 /* Invalid load value specified */
226 #define BADTICKSIZE 1008 /* Invalid tick size specified */
227 #define BADTRIGEVENT 1015 /* Invalid trigger event specified */
228 
229 
230 #define AIFUNCTION 1 /* Analog Input Function */
231 #define AOFUNCTION 2 /* Analog Output Function */
232 #define DIFUNCTION 3 /* Digital Input Function */
233 #define DOFUNCTION 4 /* Digital Output Function */
234 #define CTRFUNCTION 5 /* Counter Function */
235 #define DAQIFUNCTION 6 /* Daq Input Function */
236 #define DAQOFUNCTION 7 /* Daq Output Function */
237 
238 /* Calibration coefficient types */
239 #define COARSE_GAIN 0x01
240 #define COARSE_OFFSET 0x02
241 #define FINE_GAIN 0x04
242 #define FINE_OFFSET 0x08
243 #define GAIN COARSE_GAIN
244 #define OFFSET COARSE_OFFSET
245 
246 /******************************************************************
247 ;*
248 ;* **** ATTENTION ALL DEVELOPERS ****
249 ;*
250 ;* When adding error codes, first determine if these are errors
251 ;* that can be caused by the user or if they will never happen
252 ;* in normal operation unless there is a bug.
253 ;*
254 ;* Only if they are user error should you put them in the list
255 ;* above. In that case be sure to give them a name that means
256 ;* something from the user's point of view - rather than from the
257 ;* programmer. For example NO_VDD_INSTALLED rather than
258 ;* DEVICE_CALL_FAILED.
259 ;*
260 ;* Do not add any errors to the section above without getting
261 ;* agreement by the dept. so that all user header files and header
262 ;* files for other versions of the library can be updates together.
263 ;*
264 ;* If it's an internal error, then be sure to add it to the
265 ;* correct section below.
266 ;*
267 ;********************************************************************/
268 
269 /* Internal errors returned by 16 bit library */
270 #define INTERNALERR 200 /* 200-299 Internal library error */
271 #define CANT_LOCK_DMA_BUF 201 /* DMA buffer could not be locked */
272 #define DMA_IN_USE 202 /* DMA already controlled by another VxD */
273 #define BAD_MEM_HANDLE 203 /* Invalid Windows memory handle */
274 #define NO_ENHANCED_MODE 204 /* Windows Enhance mode is not running */
275 #define MEMBOARDPROGERROR 211 /* Program error getting memory board source */
276 
277 /* Internal errors returned by 32 bit library */
278 #define INTERNAL32_ERR 300 /* 300-399 32 bit library internal errors */
279 #define NO_MEMORY_FOR_BUFFER 301 /* 32 bit - default buffer allocation when no user buffer used with file */
280 #define WIN95_CANNOT_SETUP_ISR_DATA 302 /* 32 bit - failure on INIT_ISR_DATA IOCTL call */
281 #define WIN31_CANNOT_SETUP_ISR_DATA 303 /* 32 bit - failure on INIT_ISR_DATA IOCTL call */
282 #define CFG_FILE_READ_FAILURE 304 /* 32 bit - error reading board configuration file */
283 #define CFG_FILE_WRITE_FAILURE 305 /* 32 bit - error writing board configuration file */
284 #define CREATE_BOARD_FAILURE 306 /* 32 bit - failed to create board */
285 #define DEVELOPMENT_OPTION 307 /* 32 bit - Config Option item used in development only */
286 #define CFGFILE_CANT_OPEN 308 /* 32 bit - cannot open configuration file. */
287 #define CFGFILE_BAD_ID 309 /* 32 bit - incorrect file id. */
288 #define CFGFILE_BAD_REV 310 /* 32 bit - incorrect file version. */
289 #define CFGFILE_NOINSERT 311 /*; */
290 #define CFGFILE_NOREPLACE 312 /*; */
291 #define BIT_NOT_ZERO 313 /*; */
292 #define BIT_NOT_ONE 314 /*; */
293 #define BAD_CTRL_REG 315 /* No control register at this location. */
294 #define BAD_OUTP_REG 316 /* No output register at this location. */
295 #define BAD_RDBK_REG 317 /* No read back register at this location. */
296 #define NO_CTRL_REG 318 /* No control register on this board. */
297 #define NO_OUTP_REG 319 /* No control register on this board. */
298 #define NO_RDBK_REG 320 /* No control register on this board. */
299 #define CTRL_REG_FAIL 321 /* internal ctrl reg test failed. */
300 #define OUTP_REG_FAIL 322 /* internal output reg test failed. */
301 #define RDBK_REG_FAIL 323 /* internal read back reg test failed. */
302 #define FUNCTION_NOT_IMPLEMENTED 324
303 #define BAD_RTD_CONVERSION 325 /* Overflow in RTD calculation */
304 #define NO_PCI_BIOS 326 /* PCI BIOS not present in the PC */
305 #define BAD_PCI_INDEX 327 /* Invalid PCI board index passed to PCI BIOS */
306 #define NO_PCI_BOARD 328 /* Can't detact specified PCI board */
307 #define PCI_ASSIGN_FAILED 329 /* PCI resource assignment failed */
308 #define PCI_NO_ADDRESS 330 /* No PCI address returned */
309 #define PCI_NO_IRQ 331 /* No PCI IRQ returned */
310 #define CANT_INIT_ISR_INFO 332 /* IOCTL call failed on VDD_API_INIT_ISR_INFO */
311 #define CANT_PASS_USER_BUFFER 333 /* IOCTL call failed on VDD_API_PASS_USER_BUFFER */
312 #define CANT_INSTALL_INT 334 /* IOCTL call failed on VDD_API_INSTALL_INT */
313 #define CANT_UNINSTALL_INT 335 /* IOCTL call failed on VDD_API_UNINSTALL_INT */
314 #define CANT_START_DMA 336 /* IOCTL call failed on VDD_API_START_DMA */
315 #define CANT_GET_STATUS 337 /* IOCTL call failed on VDD_API_GET_STATUS */
316 #define CANT_GET_PRINT_PORT 338 /* IOCTL call failed on VDD_API_GET_PRINT_PORT */
317 #define CANT_MAP_PCM_CIS 339 /* IOCTL call failed on VDD_API_MAP_PCM_CIS */
318 #define CANT_GET_PCM_CFG 340 /* IOCTL call failed on VDD_API_GET_PCM_CFG */
319 #define CANT_GET_PCM_CCSR 341 /* IOCTL call failed on VDD_API_GET_PCM_CCSR */
320 #define CANT_GET_PCI_INFO 342 /* IOCTL call failed on VDD_API_GET_PCI_INFO */
321 #define NO_USB_BOARD 343 /* Can't detect specified USB board */
322 #define NOMOREFILES 344 /* No more files in the directory */
323 #define BADFILENUMBER 345 /* Invalid file number */
324 #define INVALIDSTRUCTSIZE 346 /* Invalid structure size */
325 #define LOSSOFDATA 347 /* EOF marker not found, possible loss of data */
326 #define INVALIDBINARYFILE 348 /* File is not a valid MCC binary file */
327 #define INVALIDDELIMITER 349 /* Invlid delimiter specified for CSV file */
328 
329 /* DOS errors are remapped by adding DOS_ERR_OFFSET to them */
330 #define DOS_ERR_OFFSET 500
331 
332 /* These are the commonly occurring remapped DOS error codes */
333 #define DOSBADFUNC 501
334 #define DOSFILENOTFOUND 502
335 #define DOSPATHNOTFOUND 503
336 #define DOSNOHANDLES 504
337 #define DOSACCESSDENIED 505
338 #define DOSINVALIDHANDLE 506
339 #define DOSNOMEMORY 507
340 #define DOSBADDRIVE 515
341 #define DOSTOOMANYFILES 518
342 #define DOSWRITEPROTECT 519
343 #define DOSDRIVENOTREADY 521
344 #define DOSSEEKERROR 525
345 #define DOSWRITEFAULT 529
346 #define DOSREADFAULT 530
347 #define DOSGENERALFAULT 531
348 
349 /* Windows internal error codes */
350 #define WIN_CANNOT_ENABLE_INT 603
351 #define WIN_CANNOT_DISABLE_INT 605
352 #define WIN_CANT_PAGE_LOCK_BUFFER 606
353 #define NO_PCM_CARD 630
354 
355 /* Maximum length of error string */
356 #define ERRSTRLEN 256
357 
358 /* Maximum length of board name */
359 #define BOARDNAMELEN 25
360 
361 /* Status values */
362 #define IDLE 0
363 #define RUNNING 1
364 
365 
366 /* Option Flags */
367 #define FOREGROUND 0x0000 /* Run in foreground, don't return till done */
368 #define BACKGROUND 0x0001 /* Run in background, return immediately */
369 
370 #define SINGLEEXEC 0x0000 /* One execution */
371 #define CONTINUOUS 0x0002 /* Run continuously until cbstop() called */
372 
373 #define TIMED 0x0000 /* Time conversions with internal clock */
374 #define EXTCLOCK 0x0004 /* Time conversions with external clock */
375 
376 #define NOCONVERTDATA 0x0000 /* Return raw data */
377 #define CONVERTDATA 0x0008 /* Return converted A/D data */
378 
379 #define NODTCONNECT 0x0000 /* Disable DT Connect */
380 #define DTCONNECT 0x0010 /* Enable DT Connect */
381 #define SCALEDATA 0x0010 /* Scale scan data to engineering units */
382 
383 #define DEFAULTIO 0x0000 /* Use whatever makes sense for board */
384 #define SINGLEIO 0x0020 /* Interrupt per A/D conversion */
385 #define DMAIO 0x0040 /* DMA transfer */
386 #define BLOCKIO 0x0060 /* Interrupt per block of conversions */
387 #define BURSTIO 0x10000 /* Transfer upon scan completion */
388 #define RETRIGMODE 0x20000 /* Re-arm trigger upon acquiring trigger count samples */
389 #define NONSTREAMEDIO 0x040000 /* Non-streamed D/A output */
390 #define ADCCLOCKTRIG 0x080000 /* Output operation is triggered on ADC clock */
391 #define ADCCLOCK 0x100000 /* Output operation is paced by ADC clock */
392 #define HIGHRESRATE 0x200000 /* Use high resolution rate */
393 #define SHUNTCAL 0x400000 /* Enable Shunt Calibration */
394 
395 #define BYTEXFER 0x0000 /* Digital IN/OUT a byte at a time */
396 #define WORDXFER 0x0100 /* Digital IN/OUT a word at a time */
397 
398 #define INDIVIDUAL 0x0000 /* Individual D/A output */
399 #define SIMULTANEOUS 0x0200 /* Simultaneous D/A output */
400 
401 #define FILTER 0x0000 /* Filter thermocouple inputs */
402 #define NOFILTER 0x0400 /* Disable filtering for thermocouple */
403 
404 #define NORMMEMORY 0x0000 /* Return data to data array */
405 #define EXTMEMORY 0x0800 /* Send data to memory board ia DT-Connect */
406 
407 #define BURSTMODE 0x1000 /* Enable burst mode */
408 
409 #define NOTODINTS 0x2000 /* Disbale time-of-day interrupts */
410 
411 #define EXTTRIGGER 0x4000 /* A/D is triggered externally */
412 
413 #define NOCALIBRATEDATA 0x8000 /* Return uncalibrated PCM data */
414 #define CALIBRATEDATA 0x0000 /* Return calibrated PCM A/D data */
415 
416 #define CTR16BIT 0x0000 /* Return 16-bit counter data */
417 #define CTR32BIT 0x0100 /* Return 32-bit counter data */
418 #define CTR48BIT 0x0200 /* Return 48-bit counter data */
419 #define CTR64BIT 0x0400 /* Return 64-bit counter data */
420 #define NOCLEAR 0x0800 /* Disables clearing counters when scan starts */
421 
422 
423 #define ENABLED 1
424 #define DISABLED 0
425 
426 #define UPDATEIMMEDIATE 0
427 #define UPDATEONCOMMAND 1
428 
429 /* Arguments that are used in a particular function call should be set
430  to NOTUSED */
431 #define NOTUSED -1
432 
433 
434 /* types of error reporting */
435 #define DONTPRINT 0
436 #define PRINTWARNINGS 1
437 #define PRINTFATAL 2
438 #define PRINTALL 3
439 
440 /* types of error handling */
441 #define DONTSTOP 0
442 #define STOPFATAL 1
443 #define STOPALL 2
444 
445 /* channel types */
446 #define ANALOG 0 // Analog channel
447 #define DIGITAL8 1 // 8-bit digital port
448 #define DIGITAL16 2 // 16-bit digital port
449 #define CTR16 3 // 16-bit counter
450 #define CTR32LOW 4 // Lower 16-bits of 32-bit counter
451 #define CTR32HIGH 5 // Upper 16-bits of 32-bit counter
452 #define CJC 6 // CJC channel
453 #define TC 7 // Thermocouple channel
454 #define ANALOG_SE 8 // Analog channel, singel-ended mode
455 #define ANALOG_DIFF 9 // Analog channel, Differential mode
456 #define SETPOINTSTATUS 10 // Setpoint status channel
457 #define CTRBANK0 11 // Bank 0 of counter
458 #define CTRBANK1 12 // Bank 1 of counter
459 #define CTRBANK2 13 // Bank 2 of counter
460 #define CTRBANK3 14 // Bank 3 of counter
461 #define PADZERO 15 // Dummy channel. Fills the corresponding data elements with zero
462 
463 /* channel type flags*/
464 #define SETPOINT_ENABLE 0x100 // Enable setpoint detection
465 
466 /* setpoint flags*/
467 #define SF_EQUAL_LIMITA 0x00 // Channel = LimitA value
468 #define SF_LESSTHAN_LIMITA 0x01 // Channel < LimitA value
469 #define SF_INSIDE_LIMITS 0x02 // Channel Inside LimitA and LimitB (LimitA < Channel < LimitB)
470 #define SF_GREATERTHAN_LIMITB 0x03 // Channel > LimitB
471 #define SF_OUTSIDE_LIMITS 0x04 // Channel Outside LimitA and LimitB (LimitA < Channel or Channel > LimitB)
472 #define SF_HYSTERESIS 0x05 // Use As Hysteresis
473 #define SF_UPDATEON_TRUEONLY 0x00 // Latch output condition (output = output1 for duration of acquisition)
474 #define SF_UPDATEON_TRUEANDFALSE 0x08 // Do not latch output condition (output = output1 when criteria met else output = output2)
475 
476 /* Setpoint output channels */
477 #define SO_NONE 0 // No Output
478 #define SO_DIGITALPORT 1 // Output to digital Port
479 #define SO_FIRSTPORTC 1 // Output to first PortC
480 #define SO_DAC0 2 // Output to DAC0
481 #define SO_DAC1 3 // Output to DAC1
482 #define SO_DAC2 4 // Output to DAC2
483 #define SO_DAC3 5 // Output to DAC3
484 #define SO_TMR0 6 // Output to TMR0
485 #define SO_TMR1 7 // Output to TMR1
486 
487 /* cbDaqSetTrigger trigger sources */
488 #define TRIG_IMMEDIATE 0
489 #define TRIG_EXTTTL 1
490 #define TRIG_ANALOG_HW 2
491 #define TRIG_ANALOG_SW 3
492 #define TRIG_DIGPATTERN 4
493 #define TRIG_COUNTER 5
494 #define TRIG_SCANCOUNT 6
495 
496 /* cbDaqSetTrigger trigger sensitivities */
497 #define RISING_EDGE 0
498 #define FALLING_EDGE 1
499 #define ABOVE_LEVEL 2
500 #define BELOW_LEVEL 3
501 #define EQ_LEVEL 4
502 #define NE_LEVEL 5
503 #define HIGH_LEVEL 6
504 #define LOW_LEVEL 7
505 
506 /* trigger events */
507 #define START_EVENT 0
508 #define STOP_EVENT 1
509 
510 /* settling time settings */
511 #define SETTLE_DEFAULT 0
512 #define SETTLE_1us 1
513 #define SETTLE_5us 2
514 #define SETTLE_10us 3
515 #define SETTLE_1ms 4
516 
517 /* Types of digital input ports */
518 #define DIGITALOUT 1
519 #define DIGITALIN 2
520 
521 /* DT Modes for cbMemSetDTMode() */
522 #define DTIN 0
523 #define DTOUT 2
524 
525 #define FROMHERE -1 /* read/write from current position */
526 #define GETFIRST -2 /* Get first item in list */
527 #define GETNEXT -3 /* Get next item in list */
528 
529 /* Temperature scales */
530 #define CELSIUS 0
531 #define FAHRENHEIT 1
532 #define KELVIN 2
533 #define VOLTS 4 /* special scale for DAS-TC boards */
534 #define NOSCALE 5
535 
536 /* Default option */
537 #define DEFAULTOPTION 0x0000
538 
539 
540 /* Types of digital I/O Ports */
541 #define AUXPORT 1
542 #define FIRSTPORTA 10
543 #define FIRSTPORTB 11
544 #define FIRSTPORTCL 12
545 #define FIRSTPORTC 12
546 #define FIRSTPORTCH 13
547 #define SECONDPORTA 14
548 #define SECONDPORTB 15
549 #define SECONDPORTCL 16
550 #define SECONDPORTCH 17
551 #define THIRDPORTA 18
552 #define THIRDPORTB 19
553 #define THIRDPORTCL 20
554 #define THIRDPORTCH 21
555 #define FOURTHPORTA 22
556 #define FOURTHPORTB 23
557 #define FOURTHPORTCL 24
558 #define FOURTHPORTCH 25
559 #define FIFTHPORTA 26
560 #define FIFTHPORTB 27
561 #define FIFTHPORTCL 28
562 #define FIFTHPORTCH 29
563 #define SIXTHPORTA 30
564 #define SIXTHPORTB 31
565 #define SIXTHPORTCL 32
566 #define SIXTHPORTCH 33
567 #define SEVENTHPORTA 34
568 #define SEVENTHPORTB 35
569 #define SEVENTHPORTCL 36
570 #define SEVENTHPORTCH 37
571 #define EIGHTHPORTA 38
572 #define EIGHTHPORTB 39
573 #define EIGHTHPORTCL 40
574 #define EIGHTHPORTCH 41
575 
576 /* Selectable analog input modes */
577 #define RSE 0x1000 /* Referenced Single-Ended */
578 #define NRSE 0x2000 /* Non-Referenced Single-Ended */
579 #define DIFF 0x4000 /* Differential */
580 
581 
582 /* Selectable A/D Ranges codes */
583 #define BIP60VOLTS 20 /* -60 to 60 Volts */
584 #define BIP30VOLTS 23
585 #define BIP20VOLTS 15 /* -20 to +20 Volts */
586 #define BIP15VOLTS 21 /* -15 to +15 Volts */
587 #define BIP10VOLTS 1 /* -10 to +10 Volts */
588 #define BIP5VOLTS 0 /* -5 to +5 Volts */
589 #define BIP4VOLTS 16 /* -4 to + 4 Volts */
590 #define BIP2PT5VOLTS 2 /* -2.5 to +2.5 Volts */
591 #define BIP2VOLTS 14 /* -2.0 to +2.0 Volts */
592 #define BIP1PT25VOLTS 3 /* -1.25 to +1.25 Volts */
593 #define BIP1VOLTS 4 /* -1 to +1 Volts */
594 #define BIPPT625VOLTS 5 /* -.625 to +.625 Volts */
595 #define BIPPT5VOLTS 6 /* -.5 to +.5 Volts */
596 #define BIPPT25VOLTS 12 /* -0.25 to +0.25 Volts */
597 #define BIPPT2VOLTS 13 /* -0.2 to +0.2 Volts */
598 #define BIPPT1VOLTS 7 /* -.1 to +.1 Volts */
599 #define BIPPT05VOLTS 8 /* -.05 to +.05 Volts */
600 #define BIPPT01VOLTS 9 /* -.01 to +.01 Volts */
601 #define BIPPT005VOLTS 10 /* -.005 to +.005 Volts */
602 #define BIP1PT67VOLTS 11 /* -1.67 to +1.67 Volts */
603 #define BIPPT312VOLTS 17 /* -0.312 to +0.312 Volts */
604 #define BIPPT156VOLTS 18 /* -0.156 to +0.156 Volts */
605 #define BIPPT125VOLTS 22 /* -0.125 to +0.125 Volts */
606 #define BIPPT078VOLTS 19 /* -0.078 to +0.078 Volts */
607 
608 
609 #define UNI10VOLTS 100 /* 0 to 10 Volts*/
610 #define UNI5VOLTS 101 /* 0 to 5 Volts */
611 #define UNI4VOLTS 114 /* 0 to 4 Volts */
612 #define UNI2PT5VOLTS 102 /* 0 to 2.5 Volts */
613 #define UNI2VOLTS 103 /* 0 to 2 Volts */
614 #define UNI1PT67VOLTS 109 /* 0 to 1.67 Volts */
615 #define UNI1PT25VOLTS 104 /* 0 to 1.25 Volts */
616 #define UNI1VOLTS 105 /* 0 to 1 Volt */
617 #define UNIPT5VOLTS 110 /* 0 to .5 Volt */
618 #define UNIPT25VOLTS 111 /* 0 to 0.25 Volt */
619 #define UNIPT2VOLTS 112 /* 0 to .2 Volt */
620 #define UNIPT1VOLTS 106 /* 0 to .1 Volt */
621 #define UNIPT05VOLTS 113 /* 0 to .05 Volt */
622 #define UNIPT02VOLTS 108 /* 0 to .02 Volt*/
623 #define UNIPT01VOLTS 107 /* 0 to .01 Volt*/
624 
625 #define MA4TO20 200 /* 4 to 20 ma */
626 #define MA2TO10 201 /* 2 to 10 ma */
627 #define MA1TO5 202 /* 1 to 5 ma */
628 #define MAPT5TO2PT5 203 /* .5 to 2.5 ma */
629 #define MA0TO20 204 /* 0 to 20 ma */
630 #define BIPPT025AMPS 205 /* -0.025 to 0.025 ma */
631 
632 #define UNIPOLAR 300
633 #define BIPOLAR 301
634 
635 #define BIPPT025VOLTSPERVOLT 400 /* -0.025 to +0.025 V/V */
636 
637 /* Types of D/A */
638 #define ADDA1 0
639 #define ADDA2 1
640 
641 /* 8536 counter output 1 control */
642 #define NOTLINKED 0
643 #define GATECTR2 1
644 #define TRIGCTR2 2
645 #define INCTR2 3
646 
647 /* 8536 trigger types */
648 #define HW_START_TRIG 0
649 #define HW_RETRIG 1
650 #define SW_START_TRIG 2
651 
652 /* Types of 8254 counter configurations */
653 #define HIGHONLASTCOUNT 0
654 #define ONESHOT 1
655 #define RATEGENERATOR 2
656 #define SQUAREWAVE 3
657 #define SOFTWARESTROBE 4
658 #define HARDWARESTROBE 5
659 
660 /* Where to reload from for 9513 counters */
661 #define LOADREG 0
662 #define LOADANDHOLDREG 1
663 
664 /* Counter recycle modes for 9513 and 8536 */
665 #define ONETIME 0
666 #define RECYCLE 1
667 
668 /* Direction of counting for 9513 counters */
669 #define COUNTDOWN 0
670 #define COUNTUP 1
671 
672 /* Types of count detection for 9513 counters */
673 #define POSITIVEEDGE 0
674 #define NEGATIVEEDGE 1
675 
676 /* Counter output control */
677 #define ALWAYSLOW 0 /* 9513 */
678 #define HIGHPULSEONTC 1 /* 9513 and 8536 */
679 #define TOGGLEONTC 2 /* 9513 and 8536 */
680 #define DISCONNECTED 4 /* 9513 */
681 #define LOWPULSEONTC 5 /* 9513 */
682 #define HIGHUNTILTC 6 /* 8536 */
683 
684 /* 9513 Counter input sources */
685 #define TCPREVCTR 0
686 #define CTRINPUT1 1
687 #define CTRINPUT2 2
688 #define CTRINPUT3 3
689 #define CTRINPUT4 4
690 #define CTRINPUT5 5
691 #define GATE1 6
692 #define GATE2 7
693 #define GATE3 8
694 #define GATE4 9
695 #define GATE5 10
696 #define FREQ1 11
697 #define FREQ2 12
698 #define FREQ3 13
699 #define FREQ4 14
700 #define FREQ5 15
701 #define CTRINPUT6 101
702 #define CTRINPUT7 102
703 #define CTRINPUT8 103
704 #define CTRINPUT9 104
705 #define CTRINPUT10 105
706 #define GATE6 106
707 #define GATE7 107
708 #define GATE8 108
709 #define GATE9 109
710 #define GATE10 110
711 #define FREQ6 111
712 #define FREQ7 112
713 #define FREQ8 113
714 #define FREQ9 114
715 #define FREQ10 115
716 #define CTRINPUT11 201
717 #define CTRINPUT12 202
718 #define CTRINPUT13 203
719 #define CTRINPUT14 204
720 #define CTRINPUT15 205
721 #define GATE11 206
722 #define GATE12 207
723 #define GATE13 208
724 #define GATE14 209
725 #define GATE15 210
726 #define FREQ11 211
727 #define FREQ12 212
728 #define FREQ13 213
729 #define FREQ14 214
730 #define FREQ15 215
731 #define CTRINPUT16 301
732 #define CTRINPUT17 302
733 #define CTRINPUT18 303
734 #define CTRINPUT19 304
735 #define CTRINPUT20 305
736 #define GATE16 306
737 #define GATE17 307
738 #define GATE18 308
739 #define GATE19 309
740 #define GATE20 310
741 #define FREQ16 311
742 #define FREQ17 312
743 #define FREQ18 313
744 #define FREQ19 314
745 #define FREQ20 315
746 
747 /* Counter load registers */
748 #define LOADREG0 0
749 #define LOADREG1 1
750 #define LOADREG2 2
751 #define LOADREG3 3
752 #define LOADREG4 4
753 #define LOADREG5 5
754 #define LOADREG6 6
755 #define LOADREG7 7
756 #define LOADREG8 8
757 #define LOADREG9 9
758 #define LOADREG10 10
759 #define LOADREG11 11
760 #define LOADREG12 12
761 #define LOADREG13 13
762 #define LOADREG14 14
763 #define LOADREG15 15
764 #define LOADREG16 16
765 #define LOADREG17 17
766 #define LOADREG18 18
767 #define LOADREG19 19
768 #define LOADREG20 20
769 
770 /* 9513 Counter registers */
771 #define HOLDREG1 101
772 #define HOLDREG2 102
773 #define HOLDREG3 103
774 #define HOLDREG4 104
775 #define HOLDREG5 105
776 #define HOLDREG6 106
777 #define HOLDREG7 107
778 #define HOLDREG8 108
779 #define HOLDREG9 109
780 #define HOLDREG10 110
781 #define HOLDREG11 111
782 #define HOLDREG12 112
783 #define HOLDREG13 113
784 #define HOLDREG14 114
785 #define HOLDREG15 115
786 #define HOLDREG16 116
787 #define HOLDREG17 117
788 #define HOLDREG18 118
789 #define HOLDREG19 119
790 #define HOLDREG20 120
791 
792 #define ALARM1CHIP1 201
793 #define ALARM2CHIP1 202
794 #define ALARM1CHIP2 301
795 #define ALARM2CHIP2 302
796 #define ALARM1CHIP3 401
797 #define ALARM2CHIP3 402
798 #define ALARM1CHIP4 501
799 #define ALARM2CHIP4 502
800 
801 
802 /* LS7266 Counter registers */
803 #define COUNT1 601
804 #define COUNT2 602
805 #define COUNT3 603
806 #define COUNT4 604
807 
808 #define PRESET1 701
809 #define PRESET2 702
810 #define PRESET3 703
811 #define PRESET4 704
812 
813 #define PRESCALER1 801
814 #define PRESCALER2 802
815 #define PRESCALER3 803
816 #define PRESCALER4 804
817 
818 #define MINLIMITREG0 900
819 #define MINLIMITREG1 901
820 #define MINLIMITREG2 902
821 #define MINLIMITREG3 903
822 #define MINLIMITREG4 904
823 #define MINLIMITREG5 905
824 #define MINLIMITREG6 906
825 #define MINLIMITREG7 907
826 
827 #define MAXLIMITREG0 1000
828 #define MAXLIMITREG1 1001
829 #define MAXLIMITREG2 1002
830 #define MAXLIMITREG3 1003
831 #define MAXLIMITREG4 1004
832 #define MAXLIMITREG5 1005
833 #define MAXLIMITREG6 1006
834 #define MAXLIMITREG7 1007
835 
836 #define OUTPUTVAL0REG0 1100
837 #define OUTPUTVAL0REG1 1101
838 #define OUTPUTVAL0REG2 1102
839 #define OUTPUTVAL0REG3 1103
840 #define OUTPUTVAL0REG4 1104
841 #define OUTPUTVAL0REG5 1105
842 #define OUTPUTVAL0REG6 1106
843 #define OUTPUTVAL0REG7 1107
844 
845 #define OUTPUTVAL1REG0 1200
846 #define OUTPUTVAL1REG1 1201
847 #define OUTPUTVAL1REG2 1202
848 #define OUTPUTVAL1REG3 1203
849 #define OUTPUTVAL1REG4 1204
850 #define OUTPUTVAL1REG5 1205
851 #define OUTPUTVAL1REG6 1206
852 #define OUTPUTVAL1REG7 1207
853 
854 /* Counter Gate Control */
855 #define NOGATE 0
856 #define AHLTCPREVCTR 1
857 #define AHLNEXTGATE 2
858 #define AHLPREVGATE 3
859 #define AHLGATE 4
860 #define ALLGATE 5
861 #define AHEGATE 6
862 #define ALEGATE 7
863 
864 /* 7266 Counter Quadrature values */
865 #define NO_QUAD 0
866 #define X1_QUAD 1
867 #define X2_QUAD 2
868 #define X4_QUAD 4
869 
870 /* 7266 Counter Counting Modes */
871 #define NORMAL_MODE 0
872 #define RANGE_LIMIT 1
873 #define NO_RECYCLE 2
874 #define MODULO_N 3
875 
876 /* 7266 Counter encodings */
877 #define BCD_ENCODING 1
878 #define BINARY_ENCODING 2
879 
880 /* 7266 Counter Index Modes */
881 #define INDEX_DISABLED 0
882 #define LOAD_CTR 1
883 #define LOAD_OUT_LATCH 2
884 #define RESET_CTR 3
885 
886 /* 7266 Counter Flag Pins */
887 #define CARRY_BORROW 1
888 #define COMPARE_BORROW 2
889 #define CARRYBORROW_UPDOWN 3
890 #define INDEX_ERROR 4
891 
892 /* Counter status bits */
893 #define C_UNDERFLOW 0x0001
894 #define C_OVERFLOW 0x0002
895 #define C_COMPARE 0x0004
896 #define C_SIGN 0x0008
897 #define C_ERROR 0x0010
898 #define C_UP_DOWN 0x0020
899 #define C_INDEX 0x0040
900 
901 /* Scan counter mode constants */
902 #define TOTALIZE 0x0000
903 #define CLEAR_ON_READ 0x0001
904 #define ROLLOVER 0x0000
905 #define STOP_AT_MAX 0x0002
906 #define DECREMENT_OFF 0x0000
907 #define DECREMENT_ON 0x0020
908 #define BIT_16 0x0000
909 #define BIT_32 0x0004
910 #define BIT_48 0x10000
911 #define GATING_OFF 0x0000
912 #define GATING_ON 0x0010
913 #define LATCH_ON_SOS 0x0000
914 #define LATCH_ON_MAP 0x0008
915 #define UPDOWN_OFF 0x0000
916 #define UPDOWN_ON 0x1000
917 #define RANGE_LIMIT_OFF 0x0000
918 #define RANGE_LIMIT_ON 0x2000
919 #define NO_RECYCLE_OFF 0x0000
920 #define NO_RECYCLE_ON 0x4000
921 #define MODULO_N_OFF 0x0000
922 #define MODULO_N_ON 0x8000
923 #define COUNT_DOWN_OFF 0x00000
924 #define COUNT_DOWN_ON 0x10000
925 #define INVERT_GATE 0x20000
926 #define GATE_CONTROLS_DIR 0x40000
927 #define GATE_CLEARS_CTR 0x80000
928 #define GATE_TRIG_SRC 0x100000
929 #define OUTPUT_ON 0x200000
930 #define OUTPUT_INITIAL_STATE_LOW 0x000000
931 #define OUTPUT_INITIAL_STATE_HIGH 0x400000
932 
933 #define PERIOD 0x0200
934 #define PERIOD_MODE_X1 0x0000
935 #define PERIOD_MODE_X10 0x0001
936 #define PERIOD_MODE_X100 0x0002
937 #define PERIOD_MODE_X1000 0x0003
938 #define PERIOD_MODE_BIT_16 0x0000
939 #define PERIOD_MODE_BIT_32 0x0004
940 #define PERIOD_MODE_BIT_48 0x10000
941 #define PERIOD_MODE_GATING_ON 0x0010
942 #define PERIOD_MODE_INVERT_GATE 0x20000
943 
944 #define PULSEWIDTH 0x0300
945 #define PULSEWIDTH_MODE_BIT_16 0x0000
946 #define PULSEWIDTH_MODE_BIT_32 0x0004
947 #define PULSEWIDTH_MODE_BIT_48 0x10000
948 #define PULSEWIDTH_MODE_GATING_ON 0x0010
949 #define PULSEWIDTH_MODE_INVERT_GATE 0x20000
950 
951 #define TIMING 0x0400
952 #define TIMING_MODE_BIT_16 0x0000
953 #define TIMING_MODE_BIT_32 0x0004
954 #define TIMING_MODE_BIT_48 0x10000
955 #define TIMING_MODE_INVERT_GATE 0x20000
956 
957 #define ENCODER 0x0500
958 #define ENCODER_MODE_X1 0x0000
959 #define ENCODER_MODE_X2 0x0001
960 #define ENCODER_MODE_X4 0x0002
961 #define ENCODER_MODE_BIT_16 0x0000
962 #define ENCODER_MODE_BIT_32 0x0004
963 #define ENCODER_MODE_BIT_48 0x10000
964 #define ENCODER_MODE_LATCH_ON_Z 0x0008
965 #define ENCODER_MODE_CLEAR_ON_Z_OFF 0x0000
966 #define ENCODER_MODE_CLEAR_ON_Z_ON 0x0020
967 #define ENCODER_MODE_RANGE_LIMIT_OFF 0x0000
968 #define ENCODER_MODE_RANGE_LIMIT_ON 0x2000
969 #define ENCODER_MODE_NO_RECYCLE_OFF 0x0000
970 #define ENCODER_MODE_NO_RECYCLE_ON 0x4000
971 #define ENCODER_MODE_MODULO_N_OFF 0x0000
972 #define ENCODER_MODE_MODULO_N_ON 0x8000
973 
974 // obsolete encoder mode constants, use preferred constants above.
975 #define LATCH_ON_Z 0x0008
976 #define CLEAR_ON_Z_OFF 0x0000
977 #define CLEAR_ON_Z_ON 0x0020
978 
979 
980 /* 25xx series counter debounce time constants */
981 #define CTR_DEBOUNCE500ns 0
982 #define CTR_DEBOUNCE1500ns 1
983 #define CTR_DEBOUNCE3500ns 2
984 #define CTR_DEBOUNCE7500ns 3
985 #define CTR_DEBOUNCE15500ns 4
986 #define CTR_DEBOUNCE31500ns 5
987 #define CTR_DEBOUNCE63500ns 6
988 #define CTR_DEBOUNCE127500ns 7
989 #define CTR_DEBOUNCE100us 8
990 #define CTR_DEBOUNCE300us 9
991 #define CTR_DEBOUNCE700us 10
992 #define CTR_DEBOUNCE1500us 11
993 #define CTR_DEBOUNCE3100us 12
994 #define CTR_DEBOUNCE6300us 13
995 #define CTR_DEBOUNCE12700us 14
996 #define CTR_DEBOUNCE25500us 15
997 #define CTR_DEBOUNCE_NONE 16
998 
999 /* 25xx series counter debounce trigger constants */
1000 #define CTR_TRIGGER_AFTER_STABLE 0
1001 #define CTR_TRIGGER_BEFORE_STABLE 1
1002 
1003 /* 25xx series counter edge detection constants */
1004 #define CTR_RISING_EDGE 0
1005 #define CTR_FALLING_EDGE 1
1006 
1007 /* 25xx series counter tick size constants */
1008 #define CTR_TICK20PT83ns 0
1009 #define CTR_TICK208PT3ns 1
1010 #define CTR_TICK2083PT3ns 2
1011 #define CTR_TICK20833PT3ns 3
1012 
1013 /* Types of triggers */
1014 #define TRIGABOVE 0
1015 #define TRIGBELOW 1
1016 #define GATE_NEG_HYS 2
1017 #define GATE_POS_HYS 3
1018 #define GATE_ABOVE 4
1019 #define GATE_BELOW 5
1020 #define GATE_IN_WINDOW 6
1021 #define GATE_OUT_WINDOW 7
1022 #define GATE_HIGH 8
1023 #define GATE_LOW 9
1024 #define TRIG_HIGH 10
1025 #define TRIG_LOW 11
1026 #define TRIG_POS_EDGE 12
1027 #define TRIG_NEG_EDGE 13
1028 #define TRIG_RISING 14
1029 #define TRIG_FALLING 15
1030 
1031 /* Timer idle state */
1032 #define IDLE_LOW 0
1033 #define IDLE_HIGH 1
1034 
1035 /* Signal I/O Configuration Parameters */
1036 /* --Connections */
1037 #define AUXIN0 0x01
1038 #define AUXIN1 0x02
1039 #define AUXIN2 0x04
1040 #define AUXIN3 0x08
1041 #define AUXIN4 0x10
1042 #define AUXIN5 0x20
1043 #define AUXOUT0 0x0100
1044 #define AUXOUT1 0x0200
1045 #define AUXOUT2 0x0400
1046 
1047 #define DS_CONNECTOR 0x01000
1048 
1049 #define MAX_CONNECTIONS 4 /* maximum number connections per output signal type */
1050 
1051 
1052 /* --Signal Types */
1053 #define ADC_CONVERT 0x0001
1054 #define ADC_GATE 0x0002
1055 #define ADC_START_TRIG 0x0004
1056 #define ADC_STOP_TRIG 0x0008
1057 #define ADC_TB_SRC 0x0010
1058 #define ADC_SCANCLK 0x0020
1059 #define ADC_SSH 0x0040
1060 #define ADC_STARTSCAN 0x0080
1061 #define ADC_SCAN_STOP 0x0100
1062 
1063 #define DAC_UPDATE 0x0200
1064 #define DAC_TB_SRC 0x0400
1065 #define DAC_START_TRIG 0x0800
1066 
1067 #define SYNC_CLK 0x1000
1068 
1069 #define CTR1_CLK 0x2000
1070 #define CTR2_CLK 0x4000
1071 
1072 #define DGND 0x8000
1073 
1074 /* -- Signal Direction */
1075 #define SIGNAL_IN 2
1076 #define SIGNAL_OUT 4
1077 
1078 /* -- Signal Polarity */
1079 #define INVERTED 1
1080 #define NONINVERTED 0
1081 
1082 
1083 /* Types of configuration information */
1084 #define GLOBALINFO 1
1085 #define BOARDINFO 2
1086 #define DIGITALINFO 3
1087 #define COUNTERINFO 4
1088 #define EXPANSIONINFO 5
1089 #define MISCINFO 6
1090 #define EXPINFOARRAY 7
1091 #define MEMINFO 8
1092 
1093 /* Types of global configuration information */
1094 #define GIVERSION 36 /* Config file format version number */
1095 #define GINUMBOARDS 38 /* Maximum number of boards */
1096 #define GINUMEXPBOARDS 40 /* Maximum number of expansion boards */
1097 
1098 /* Types of board configuration information */
1099 #define BIBASEADR 0 /* Base Address */
1100 #define BIBOARDTYPE 1 /* Board Type (0x101 - 0x7FFF) */
1101 #define BIINTLEVEL 2 /* Interrupt level */
1102 #define BIDMACHAN 3 /* DMA channel */
1103 #define BIINITIALIZED 4 /* TRUE or FALSE */
1104 #define BICLOCK 5 /* Clock freq (1, 10 or bus) */
1105 #define BIRANGE 6 /* Switch selectable range */
1106 #define BINUMADCHANS 7 /* Number of A/D channels */
1107 #define BIUSESEXPS 8 /* Supports expansion boards TRUE/FALSE */
1108 #define BIDINUMDEVS 9 /* Number of digital devices */
1109 #define BIDIDEVNUM 10 /* Index into digital information */
1110 #define BICINUMDEVS 11 /* Number of counter devices */
1111 #define BICIDEVNUM 12 /* Index into counter information */
1112 #define BINUMDACHANS 13 /* Number of D/A channels */
1113 #define BIWAITSTATE 14 /* Wait state enabled TRUE/FALSE */
1114 #define BINUMIOPORTS 15 /* I/O address space used by board */
1115 #define BIPARENTBOARD 16 /* Board number of parent board */
1116 #define BIDTBOARD 17 /* Board number of connected DT board */
1117 #define BINUMEXPS 18 /* Number of EXP boards installed */
1118 
1119 /* NEW CONFIG ITEMS for 32 bit library */
1120 #define BINOITEM 99 /* NO-OP return no data and returns DEVELOPMENT_OPTION error code */
1121 #define BIDACSAMPLEHOLD 100 /* DAC sample and hold jumper state */
1122 #define BIDIOENABLE 101 /* DIO enable */
1123 #define BI330OPMODE 102 /* DAS16-330 operation mode (ENHANCED/COMPATIBLE) */
1124 #define BI9513CHIPNSRC 103 /* 9513 HD CTR source (DevNo = ctr no.)*/
1125 #define BICTR0SRC 104 /* CTR 0 source */
1126 #define BICTR1SRC 105 /* CTR 1 source */
1127 #define BICTR2SRC 106 /* CTR 2 source */
1128 #define BIPACERCTR0SRC 107 /* Pacer CTR 0 source */
1129 #define BIDAC0VREF 108 /* DAC 0 voltage reference */
1130 #define BIDAC1VREF 109 /* DAC 1 voltage reference */
1131 #define BIINTP2LEVEL 110 /* P2 interrupt for CTR10 and CTR20HD */
1132 #define BIWAITSTATEP2 111 /* Wait state 2 */
1133 #define BIADPOLARITY 112 /* DAS1600 Polarity state(UNI/BI) */
1134 #define BITRIGEDGE 113 /* DAS1600 trigger edge(RISING/FALLING) */
1135 #define BIDACRANGE 114 /* DAC Range (DevNo is channel) */
1136 #define BIDACUPDATE 115 /* DAC Update (INDIVIDUAL/SIMULTANEOUS) (DevNo) */
1137 #define BIDACINSTALLED 116 /* DAC Installed */
1138 #define BIADCFG 117 /* AD Config (SE/DIFF) (DevNo) */
1139 #define BIADINPUTMODE 118 /* AD Input Mode (Voltage/Current) */
1140 #define BIDACPOLARITY 119 /* DAC Startup state (UNI/BI) */
1141 #define BITEMPMODE 120 /* DAS-TEMP Mode (NORMAL/CALIBRATE) */
1142 #define BITEMPREJFREQ 121 /* DAS-TEMP reject frequency */
1143 #define BIDISOFILTER 122 /* DISO48 line filter (EN/DIS) (DevNo) */
1144 #define BIINT32SRC 123 /* INT32 Intr Src */
1145 #define BIINT32PRIORITY 124 /* INT32 Intr Priority */
1146 #define BIMEMSIZE 125 /* MEGA-FIFO module size */
1147 #define BIMEMCOUNT 126 /* MEGA-FIFO # of modules */
1148 #define BIPRNPORT 127 /* PPIO series printer port */
1149 #define BIPRNDELAY 128 /* PPIO series printer port delay */
1150 #define BIPPIODIO 129 /* PPIO digital line I/O state */
1151 #define BICTR3SRC 130 /* CTR 3 source */
1152 #define BICTR4SRC 131 /* CTR 4 source */
1153 #define BICTR5SRC 132 /* CTR 5 source */
1154 #define BICTRINTSRC 133 /* PCM-D24/CTR3 interrupt source */
1155 #define BICTRLINKING 134 /* PCM-D24/CTR3 ctr linking */
1156 #define BISBX0BOARDNUM 135 /* SBX #0 board number */
1157 #define BISBX0ADDRESS 136 /* SBX #0 address */
1158 #define BISBX0DMACHAN 137 /* SBX #0 DMA channel */
1159 #define BISBX0INTLEVEL0 138 /* SBX #0 Int Level 0 */
1160 #define BISBX0INTLEVEL1 139 /* SBX #0 Int Level 1 */
1161 #define BISBX1BOARDNUM 140 /* SBX #0 board number */
1162 #define BISBX1ADDRESS 141 /* SBX #0 address */
1163 #define BISBX1DMACHAN 142 /* SBX #0 DMA channel */
1164 #define BISBX1INTLEVEL0 143 /* SBX #0 Int Level 0 */
1165 #define BISBX1INTLEVEL1 144 /* SBX #0 Int Level 1 */
1166 #define BISBXBUSWIDTH 145 /* SBX Bus width */
1167 #define BICALFACTOR1 146 /* DAS08/Jr Cal factor */
1168 #define BICALFACTOR2 147 /* DAS08/Jr Cal factor */
1169 #define BIDACTRIG 148 /* PCI-DAS1602 Dac trig edge */
1170 #define BICHANCFG 149 /* 801/802 chan config (devno =ch) */
1171 #define BIPROTOCOL 150 /* 422 protocol */
1172 #define BICOMADDR2 151 /* dual 422 2nd address */
1173 #define BICTSRTS1 152 /* dual 422 cts/rts1 */
1174 #define BICTSRTS2 153 /* dual 422 cts/rts2 */
1175 #define BICTRLLINES 154 /* pcm com 422 ctrl lines */
1176 #define BIWAITSTATEP1 155 /* Wait state P1 */
1177 #define BIINTP1LEVEL 156 /* P1 interrupt for CTR10 and CTR20HD */
1178 #define BICTR6SRC 157 /* CTR 6 source */
1179 #define BICTR7SRC 158 /* CTR 7 source */
1180 #define BICTR8SRC 159 /* CTR 8 source */
1181 #define BICTR9SRC 160 /* CTR 9 source */
1182 #define BICTR10SRC 161 /* CTR 10 source */
1183 #define BICTR11SRC 162 /* CTR 11 source */
1184 #define BICTR12SRC 163 /* CTR 12 source */
1185 #define BICTR13SRC 164 /* CTR 13 source */
1186 #define BICTR14SRC 165 /* CTR 14 source */
1187 #define BITCGLOBALAVG 166 /* DASTC global average */
1188 #define BITCCJCSTATE 167 /* DASTC CJC State(=ON or OFF) */
1189 #define BITCCHANRANGE 168 /* DASTC Channel Gain */
1190 #define BITCCHANTYPE 169 /* DASTC Channel thermocouple type */
1191 #define BITCFWVERSION 170 /* DASTC Firmware Version */
1192 #define BIFWVERSION BITCFWVERSION /* Firmware Version */
1193 #define BIPHACFG 180 /* Quad PhaseA config (devNo =ch) */
1194 #define BIPHBCFG 190 /* Quad PhaseB config (devNo =ch) */
1195 #define BIINDEXCFG 200 /* Quad Index Ref config (devNo =ch) */
1196 #define BISLOTNUM 201 /* PCI/PCM card slot number */
1197 #define BIAIWAVETYPE 202 /* analog input wave type (for demo board) */
1198 #define BIPWRUPSTATE 203 /* DDA06 pwr up state jumper */
1199 #define BIIRQCONNECT 204 /* DAS08 pin6 to 24 jumper */
1200 #define BITRIGPOLARITY 205 /* PCM DAS16xx Trig Polarity */
1201 #define BICTLRNUM 206 /* MetraBus controller board number */
1202 #define BIPWRJMPR 207 /* MetraBus controller board Pwr jumper */
1203 #define BINUMTEMPCHANS 208 /* Number of Temperature channels */
1204 #define BIADTRIGSRC 209 /* Analog trigger source */
1205 #define BIBNCSRC 210 /* BNC source */
1206 #define BIBNCTHRESHOLD 211 /* BNC Threshold 2.5V or 0.0V */
1207 #define BIBURSTMODE 212 /* Board supports BURSTMODE */
1208 #define BIDITHERON 213 /* A/D Dithering enabled */
1209 #define BISERIALNUM 214 /* Serial Number for USB boards */
1210 #define BIDACUPDATEMODE 215 /* Update immediately or upon AOUPDATE command */
1211 #define BIDACUPDATECMD 216 /* Issue D/A UPDATE command */
1212 #define BIDACSTARTUP 217 /* Store last value written for startup */
1213 #define BIADTRIGCOUNT 219 /* Number of samples to acquire per trigger in retrigger mode */
1214 #define BIADFIFOSIZE 220 /* Set FIFO override size for retrigger mode */
1215 #define BIADSOURCE 221 /* Set source to internal reference or external connector(-1) */
1216 #define BICALOUTPUT 222 /* CAL output pin setting */
1217 #define BISRCADPACER 223 /* Source A/D Pacer output */
1218 #define BIMFGSERIALNUM 224 /* Manufacturers 8-byte serial number */
1219 #define BIPCIREVID 225 /* Revision Number stored in PCI header */
1220 #define BIDIALARMMASK 230
1221 
1222 #define BINETIOTIMEOUT 247
1223 
1224 #define BISYNCMODE 251 /* Sync mode */
1225 
1226 #define BIDIDEBOUNCESTATE 255 /* Digital inputs reset state */
1227 #define BIDIDEBOUNCETIME 256 /* Digital inputs debounce Time */
1228 
1229 #define BIPANID 258
1230 #define BIRFCHANNEL 259
1231 
1232 #define BIRSS 261
1233 #define BINODEID 262
1234 #define BIDEVNOTES 263
1235 
1236 #define BIADCSETTLETIME 270
1237 
1238 #define BIFACTORYID 272
1239 #define BIHTTPPORT 273
1240 #define BIHIDELOGINDLG 274
1241 #define BIDACTRIGCOUNT 284 /* Number of samples to generate per trigger in retrigger mode */
1242 #define BIADTIMINGMODE 285
1243 #define BIRTDCHANTYPE 286
1244 
1245 #define BIADRES 291
1246 #define BIDACRES 292
1247 
1248 #define BIADXFERMODE 306
1249 
1250 
1251 /* Type of digital device information */
1252 #define DIBASEADR 0 /* Base address */
1253 #define DIINITIALIZED 1 /* TRUE or FALSE */
1254 #define DIDEVTYPE 2 /* AUXPORT or xPORTA - CH */
1255 #define DIMASK 3 /* Bit mask for this port */
1256 #define DIREADWRITE 4 /* Read required before write */
1257 #define DICONFIG 5 /* Current configuration */
1258 #define DINUMBITS 6 /* Number of bits in port */
1259 #define DICURVAL 7 /* Current value of outputs */
1260 #define DIINMASK 8 /* Input bit mask for port */
1261 #define DIOUTMASK 9 /* Output bit mask for port */
1262 
1263 /* Types of counter device information */
1264 #define CIBASEADR 0 /* Base address */
1265 #define CIINITIALIZED 1 /* TRUE or FALSE */
1266 #define CICTRTYPE 2 /* Counter type 8254, 9513 or 8536 */
1267 #define CICTRNUM 3 /* Which counter on chip */
1268 #define CICONFIGBYTE 4 /* Configuration byte */
1269 
1270 /* Types of expansion board information */
1271 #define XIBOARDTYPE 0 /* Board type */
1272 #define XIMUX_AD_CHAN1 1 /* 0 - 7 */
1273 #define XIMUX_AD_CHAN2 2 /* 0 - 7 or NOTUSED */
1274 #define XIRANGE1 3 /* Range (gain) of low 16 chans */
1275 #define XIRANGE2 4 /* Range (gain) of high 16 chans */
1276 #define XICJCCHAN 5 /* TYPE_8254_CTR or TYPE_9513_CTR */
1277 #define XITHERMTYPE 6 /* TYPEJ, TYPEK, TYPET, TYPEE, TYPER, or TYPES*/
1278 #define XINUMEXPCHANS 7 /* Number of expansion channels on board*/
1279 #define XIPARENTBOARD 8 /* Board number of parent A/D board*/
1280 #define XISPARE0 9 /* 16 words of misc options */
1281 
1282 #define XI5VOLTSOURCE 100 /* ICAL DATA - 5 volt source */
1283 #define XICHANCONFIG 101 /* exp Data - chan config 2/4 or 3-wire devNo=chan */
1284 #define XIVSOURCE 102 /* ICAL DATA - voltage source*/
1285 #define XIVSELECT 103 /* ICAL Data - voltage select*/
1286 #define XICHGAIN 104 /* exp Data - individual ch gain */
1287 #define XIGND 105 /* ICAL DATA - exp grounding */
1288 #define XIVADCHAN 106 /* ICAL DATA - Vexe A/D chan */
1289 #define XIRESISTANCE 107 /* exp Data - resistance @0 (devNo =ch) */
1290 #define XIFACGAIN 108 /* ICAL DATA - RTD factory gain */
1291 #define XICUSTOMGAIN 109 /* ICAL DATA - RTD custom gain */
1292 #define XICHCUSTOM 110 /* ICAL DATA - RTD custom gain setting*/
1293 #define XIIEXE 111 /* ICAL DATA - RTD Iexe */
1294 
1295 /* Types of memory board information */
1296 #define MIBASEADR 100 /* mem data - base address */
1297 #define MIINTLEVEL 101 /* mem data - intr level */
1298 #define MIMEMSIZE 102 /* MEGA-FIFO module size */
1299 #define MIMEMCOUNT 103 /* MEGA-FIFO # of modules */
1300 
1301 
1302 
1303 /* Types of events */
1304 #define ON_SCAN_ERROR 0x0001
1305 #define ON_EXTERNAL_INTERRUPT 0x0002
1306 #define ON_PRETRIGGER 0x0004
1307 #define ON_DATA_AVAILABLE 0x0008
1308 #define ON_END_OF_AI_SCAN 0x0010
1309 #define ON_END_OF_AO_SCAN 0x0020
1310 #define ON_CHANGE_DI 0x0040
1311 #define ALL_EVENT_TYPES 0xffff
1312 
1313 #define NUM_EVENT_TYPES 6
1314 #define MAX_NUM_EVENT_TYPES 32
1315 
1316 #define SCAN_ERROR_IDX 0
1317 #define EXTERNAL_INTERRUPT_IDX 1
1318 #define PRETRIGGER_IDX 2
1319 #define DATA_AVAILABLE_IDX 3
1320 #define END_OF_AI_IDX 4
1321 #define END_OF_AO_IDX 5
1322 
1323 /* ON_EXTERNAL_INTERRUPT event parameters*/
1324 #define LATCH_DI 1
1325 #define LATCH_DO 2
1326 
1327 
1328 // time zone constants
1329 #define TIMEZONE_LOCAL 0
1330 #define TIMEZONE_GMT 1
1331 
1332 
1333 // time format constants
1334 #define TIMEFORMAT_12HOUR 0
1335 #define TIMEFORMAT_24HOUR 1
1336 
1337 
1338 // delimiter constants
1339 #define DELIMITER_COMMA 0
1340 #define DELIMITER_SEMICOLON 1
1341 #define DELIMITER_SPACE 2
1342 #define DELIMITER_TAB 3
1343 
1344 
1345 // AI channel units in binary file
1346 #define UNITS_TEMPERATURE 0
1347 #define UNITS_RAW 1
1348 
1349 // Transfer Mode
1350 #define XFER_KERNEL 0
1351 #define XFER_USER 1
1352 
1353 
1354 #ifndef USHORT
1355  typedef unsigned short USHORT;
1356 #endif
1357 
1358 #define EXTCCONV __stdcall
1359 
1360 
1361 
1362 /*
1363  * Universal Library Function Prototypes.
1364  * 3 flavors: WIN32, WIN16, LabWindows/CVI
1365  *
1366  */
1367 
1368 #if !defined (NT_DRIVER) && ! defined (WIN95_DRIVER)
1369 
1370 #if defined (__cplusplus)
1371  extern "C"
1372  {
1373 #endif
1374 
1375 #if defined (_WIN32)
1376  /* Win32 prototypes */
1377 
1378 #ifdef EVENTCALLBACK
1379 #undef EVENTCALLBACK
1380 #endif
1381 
1382  typedef void (__stdcall *EVENTCALLBACK)(int, unsigned, unsigned, void*);
1383 
1384  int EXTCCONV cbACalibrateData (int BoardNum, long NumPoints, int Gain,
1385  USHORT *ADData);
1386  int EXTCCONV cbGetRevision (float *RevNum, float *VxDRevNum);
1387  int EXTCCONV cbLoadConfig(char *CfgFileName);
1388  int EXTCCONV cbSaveConfig(char *CfgFileName);
1389  int EXTCCONV cbAConvertData (int BoardNum, long NumPoints, USHORT *ADData,
1390  USHORT *ChanTags);
1391  int EXTCCONV cbAConvertPretrigData (int BoardNum, long PreTrigCount,
1392  long TotalCount, USHORT *ADData,
1393  USHORT *ChanTags);
1394  int EXTCCONV cbAIn (int BoardNum, int Chan, int Gain, USHORT *DataValue);
1395  int EXTCCONV cbAIn32 (int BoardNum, int Chan, int Gain, ULONG *DataValue, int Options);
1396  int EXTCCONV cbAInScan (int BoardNum, int LowChan, int HighChan, long Count,
1397  long *Rate, int Gain, HGLOBAL MemHandle,
1398  int Options);
1399  int EXTCCONV cbALoadQueue (int BoardNum, short *ChanArray, short *GainArray,
1400  int NumChans);
1401  int EXTCCONV cbAOut (int BoardNum, int Chan, int Gain, USHORT DataValue);
1402  int EXTCCONV cbAOutScan (int BoardNum, int LowChan, int HighChan,
1403  long Count, long *Rate, int Gain,
1404  HGLOBAL MemHandle, int Options);
1405  int EXTCCONV cbAPretrig (int BoardNum, int LowChan, int HighChan,
1406  long *PreTrigCount, long *TotalCount, long *Rate,
1407  int Gain, HGLOBAL MemHandle, int Options);
1408  int EXTCCONV cbATrig (int BoardNum, int Chan, int TrigType,
1409  USHORT TrigValue, int Gain, USHORT *DataValue);
1410  int EXTCCONV cbC7266Config (int BoardNum, int CounterNum, int Quadrature,
1411  int CountingMode, int DataEncoding, int IndexMode,
1412  int InvertIndex, int FlagPins, int GateEnable);
1413  int EXTCCONV cbC8254Config (int BoardNum, int CounterNum, int Config);
1414  int EXTCCONV cbC8536Config (int BoardNum, int CounterNum, int OutputControl,
1415  int RecycleMode, int TrigType);
1416  int EXTCCONV cbC9513Config (int BoardNum, int CounterNum, int GateControl,
1417  int CounterEdge, int CountSource,
1418  int SpecialGate, int Reload, int RecycleMode,
1419  int BCDMode, int CountDirection,
1420  int OutputControl);
1421  int EXTCCONV cbC8536Init (int BoardNum, int ChipNum, int Ctr1Output);
1422  int EXTCCONV cbC9513Init (int BoardNum, int ChipNum, int FOutDivider,
1423  int FOutSource, int Compare1, int Compare2,
1424  int TimeOfDay);
1425  int EXTCCONV cbCFreqIn (int BoardNum, int SigSource, int GateInterval,
1426  USHORT *Count, long *Freq);
1427  int EXTCCONV cbCIn (int BoardNum, int CounterNum, USHORT *Count);
1428  int EXTCCONV cbCIn32 (int BoardNum, int CounterNum, ULONG *Count);
1429  int EXTCCONV cbCIn64 (int BoardNum, int CounterNum, ULONGLONG *Count);
1430  int EXTCCONV cbCLoad (int BoardNum, int RegNum, unsigned int LoadValue);
1431  int EXTCCONV cbCLoad32 (int BoardNum, int RegNum, ULONG LoadValue);
1432  int EXTCCONV cbCLoad64 (int BoardNum, int RegNum, ULONGLONG LoadValue);
1433  int EXTCCONV cbCStatus (int BoardNum, int CounterNum, ULONG *StatusBits);
1434  int EXTCCONV cbCStoreOnInt (int BoardNum, int IntCount, short *CntrControl,
1435  HGLOBAL MemHandle);
1436  int EXTCCONV cbCInScan(int BoardNum, int FirstCtr,int LastCtr, LONG Count,
1437  LONG *Rate, HGLOBAL MemHandle, ULONG Options);
1438  int EXTCCONV cbCConfigScan(int BoardNum, int CounterNum, int Mode,int DebounceTime,
1439  int DebounceMode, int EdgeDetection,
1440  int TickSize, int MappedChannel);
1441  int EXTCCONV cbCClear (int BoardNum, int CounterNum);
1442  int EXTCCONV cbTimerOutStart (int BoardNum, int TimerNum, double *Frequency);
1443  int EXTCCONV cbTimerOutStop (int BoardNum, int TimerNum);
1444  int EXTCCONV cbPulseOutStart (int BoardNum, int TimerNum, double *Frequency, double *DutyCycle, unsigned int PulseCount, double *InitialDelay, int IdleState, int Options);
1445  int EXTCCONV cbPulseOutStop (int BoardNum, int TimerNum);
1446  int EXTCCONV cbDBitIn (int BoardNum, int PortType, int BitNum,
1447  USHORT *BitValue);
1448  int EXTCCONV cbDBitOut (int BoardNum, int PortType, int BitNum, USHORT BitValue);
1449  int EXTCCONV cbDConfigPort (int BoardNum, int PortNum, int Direction);
1450  int EXTCCONV cbDConfigBit (int BoardNum, int PortNum, int BitNum, int Direction);
1451  int EXTCCONV cbDIn (int BoardNum, int PortNum, USHORT *DataValue);
1452  int EXTCCONV cbDInScan (int BoardNum, int PortNum, long Count, long *Rate,
1453  HGLOBAL MemHandle, int Options);
1454  int EXTCCONV cbDOut(int BoardNum, int PortNum, USHORT DataValue);
1455  int EXTCCONV cbDOutScan (int BoardNum, int PortNum, long Count, long *Rate,
1456  HGLOBAL MemHandle, int Options);
1457  int EXTCCONV cbErrHandling (int ErrReporting, int ErrHandling);
1458  int EXTCCONV cbFileAInScan (int BoardNum, int LowChan, int HighChan,
1459  long Count, long *Rate, int Gain,
1460  char *FileName, int Options);
1461  int EXTCCONV cbFileGetInfo (char *FileName, short *LowChan, short *HighChan,
1462  long *PreTrigCount, long *TotalCount,
1463  long *Rate, int *Gain);
1464  int EXTCCONV cbFilePretrig (int BoardNum, int LowChan, int HighChan,
1465  long *PreTrigCount, long *TotalCount,
1466  long *Rate, int Gain, char *FileName,
1467  int Options);
1468  int EXTCCONV cbFileRead (char *FileName, long FirstPoint, long *NumPoints,
1469  USHORT *DataBuffer);
1470  int EXTCCONV cbFlashLED(int BoardNum);
1471  int EXTCCONV cbGetErrMsg (int ErrCode, char *ErrMsg);
1472  int EXTCCONV cbGetIOStatus (int BoardNum, short *Status, long *CurCount,
1473  long *CurIndex,int FunctionType);
1474  int EXTCCONV cbRS485 (int BoardNum, int Transmit, int Receive);
1475  int EXTCCONV cbStopIOBackground (int BoardNum, int FunctionType);
1476  int EXTCCONV cbTIn (int BoardNum, int Chan, int Scale, float *TempValue,
1477  int Options);
1478  int EXTCCONV cbTInScan (int BoardNum, int LowChan, int HighChan, int Scale,
1479  float *DataBuffer, int Options);
1480  int EXTCCONV cbMemSetDTMode (int BoardNum, int Mode);
1481  int EXTCCONV cbMemReset (int BoardNum);
1482  int EXTCCONV cbMemRead (int BoardNum, USHORT *DataBuffer, long FirstPoint,
1483  long Count);
1484  int EXTCCONV cbMemWrite (int BoardNum, USHORT *DataBuffer,long FirstPoint,
1485  long Count);
1486  int EXTCCONV cbMemReadPretrig (int BoardNum, USHORT *DataBuffer,
1487  long FirstPoint, long Count);
1488  int EXTCCONV cbWinBufToArray (HGLOBAL MemHandle, USHORT *DataArray,
1489  long StartPt, long Count);
1490  int EXTCCONV cbWinBufToArray32 (HGLOBAL MemHandle, ULONG *DataArray,
1491  long StartPt, long Count);
1492 
1493  int EXTCCONV cbWinBufToArray64 (HGLOBAL MemHandle, ULONGLONG *DataArray,
1494  long StartPt, long Count);
1495 
1496  HGLOBAL EXTCCONV cbScaledWinBufAlloc (long NumPoints);
1497  int EXTCCONV cbScaledWinBufToArray (HGLOBAL MemHandle, double *DataArray,
1498  long StartPt, long Count);
1499 
1500  int EXTCCONV cbWinArrayToBuf (USHORT *DataArray, HGLOBAL MemHandle,
1501  long StartPt, long Count);
1502  int EXTCCONV cbScaledWinArrayToBuf (double *DataArray, HGLOBAL MemHandle,
1503  long StartPt, long Count);
1504 
1505  HGLOBAL EXTCCONV cbWinBufAlloc (long NumPoints);
1506  HGLOBAL EXTCCONV cbWinBufAlloc32 (long NumPoints);
1507  HGLOBAL EXTCCONV cbWinBufAlloc64 (long NumPoints);
1508  int EXTCCONV cbWinBufFree (HGLOBAL MemHandle);
1509  int EXTCCONV cbInByte (int BoardNum, int PortNum);
1510  int EXTCCONV cbOutByte (int BoardNum, int PortNum, int PortVal);
1511  int EXTCCONV cbInWord (int BoardNum, int PortNum);
1512  int EXTCCONV cbOutWord (int BoardNum, int PortNum, int PortVal);
1513 
1514  int EXTCCONV cbGetConfig (int InfoType, int BoardNum, int DevNum,
1515  int ConfigItem, int *ConfigVal);
1516  int EXTCCONV cbGetConfigString (int InfoType, int BoardNum, int DevNum,
1517  int ConfigItem, char* ConfigVal, int* maxConfigLen);
1518 
1519  int EXTCCONV cbSetConfig (int InfoType, int BoardNum, int DevNum,
1520  int ConfigItem, int ConfigVal);
1521  int EXTCCONV cbSetConfigString (int InfoType, int BoardNum, int DevNum,
1522  int ConfigItem, char* ConfigVal, int* configLen);
1523 
1524  int EXTCCONV cbToEngUnits (int BoardNum, int Range, USHORT DataVal,
1525  float *EngUnits);
1526  int EXTCCONV cbToEngUnits32 (int BoardNum, int Range, ULONG DataVal,
1527  double *EngUnits);
1528  int EXTCCONV cbFromEngUnits (int BoardNum, int Range, float EngUnits,
1529  USHORT *DataVal);
1530  int EXTCCONV cbGetBoardName (int BoardNum, char *BoardName);
1531  int EXTCCONV cbDeclareRevision(float *RevNum);
1532  int EXTCCONV cbSetTrigger (int BoardNum, int TrigType, USHORT LowThreshold,
1533  USHORT HighThreshold);
1534 
1535  int EXTCCONV cbEnableEvent(int BoardNum, unsigned EventType, unsigned Count,
1536  EVENTCALLBACK CallbackFunc, void *UserData);
1537 
1538  int EXTCCONV cbDisableEvent(int BoardNum, unsigned EventType);
1539  int EXTCCONV cbSelectSignal(int BoardNum, int Direction, int Signal, int Connection, int Polarity);
1540  int EXTCCONV cbGetSignal(int BoardNum, int Direction, int Signal, int Index, int* Connection, int* Polarity);
1541 
1542  int EXTCCONV cbSetCalCoeff(int BoardNum, int FunctionType, int Channel, int Range, int Item, int Value, int Store);
1543  int EXTCCONV cbGetCalCoeff(int BoardNum, int FunctionType, int Channel, int Range, int Item, int* Value);
1544 
1545 
1546  // Get log file name
1547 
1548  // store the preferences
1549  int EXTCCONV cbLogSetPreferences(int timeFormat, int timeZone, int units);
1550 
1551  // get the preferences
1552  int EXTCCONV cbLogGetPreferences(int* timeFormat, int* timeZone, int* units);
1553 
1554  // Get log file name
1555  int EXTCCONV cbLogGetFileName(int fileNumber, char* path, char* filename);
1556 
1557  // Get info for log file
1558  int EXTCCONV cbLogGetFileInfo(char* filename, int* version, int* fileSize);
1559 
1560  // Get sample info for log file
1561  int EXTCCONV cbLogGetSampleInfo(char* filename, int* sampleInterval, int* sampleCount,
1562  int* startDate, int* startTime);
1563 
1564  // Get the AI channel count for log file
1565  int EXTCCONV cbLogGetAIChannelCount(char* filename, int* aiCount);
1566 
1567  // Get AI info for log file
1568  int EXTCCONV cbLogGetAIInfo(char* filename, int* channelNumbers, int* units);
1569 
1570  // Get CJC info for log file
1571  int EXTCCONV cbLogGetCJCInfo(char* filename, int* cjcCount);
1572 
1573  // Get DIO info for log file
1574  int EXTCCONV cbLogGetDIOInfo(char* filename, int* dioCount);
1575 
1576  // read the time tags to an array
1577  int EXTCCONV cbLogReadTimeTags(char* filename, int startSample, int count, int* dateTags, int*timeTags);
1578 
1579  // read the analog data to an array
1580  int EXTCCONV cbLogReadAIChannels(char* filename, int startSample, int count, float* analog);
1581 
1582  // read the CJC data to an array
1583  int EXTCCONV cbLogReadCJCChannels(char* filename, int startSample, int count, float* cjc);
1584 
1585  // read the DIO data to an array
1586  int EXTCCONV cbLogReadDIOChannels(char* filename, int startSample, int count, int* dio);
1587 
1588  // convert the log file to a .TXT or .CSV file
1589  int EXTCCONV cbLogConvertFile(char* srcFilename, char* destFilename, int startSample, int count, int delimiter);
1590 
1591  int EXTCCONV cbDaqInScan(int BoardNum, short *ChanArray, short *ChanTypeArray, short *GainArray, int ChanCount, long *Rate,
1592  long *PretrigCount, long *TotalCount, HGLOBAL MemHandle, int Options);
1593  int EXTCCONV cbDaqSetTrigger(int BoardNum, int TrigSource, int TrigSense, int TrigChan, int ChanType,
1594  int Gain, float Level, float Variance, int TrigEvent);
1595  int EXTCCONV cbDaqSetSetpoints (int BoardNum, float *LimitAArray, float *LimitBArray, float *Reserved, int *SetpointFlagsArray,
1596  int *SetpointOutputArray, float *Output1Array, float *Output2Array, float *OutputMask1Array,
1597  float *OutputMask2Array, int SetpointCount);
1598 
1599  int EXTCCONV cbDaqOutScan(int BoardNum, short *ChanArray, short *ChanTypeArray, short *GainArray, int ChanCount, long *Rate,
1600  long Count, HGLOBAL MemHandle, int Options);
1601  int EXTCCONV cbGetTCValues(int BoardNum, short *ChanArray, short *ChanTypeArray, int ChanCount, HGLOBAL MemHandle, int FirstPoint,
1602  long Count, int Scale, float *TempValArray);
1603 
1604  int EXTCCONV cbVIn (int BoardNum, int Chan, int Gain, float *DataValue, int Options);
1605  int EXTCCONV cbVIn32 (int BoardNum, int Chan, int Gain, double *DataValue, int Options);
1606  int EXTCCONV cbVOut (int BoardNum, int Chan, int Gain, float DataValue, int Options);
1607 
1608  int EXTCCONV cbDeviceLogin(int BoardNum, char* AccountName, char* Password);
1609  int EXTCCONV cbDeviceLogout(int BoardNum);
1610 
1611  int EXTCCONV cbTEDSRead(int BoardNum, int Chan, BYTE* DataBuffer, long *Count, int Options);
1612 
1613 //****************************************************************************
1614 // Legacy Function Prototypes: to revert to legacy calls, un-comment the
1615 // prototypes immediately below.
1616 //
1617 // int EXTCCONV cbGetStatus (int BoardNum, short *Status, long *CurCount, long *CurIndex);
1618 // int EXTCCONV cbStopBackground (int BoardNum);
1619 //
1620 // Remove the following if using the above legacy function prototypes.
1621 #define cbGetStatus cbGetIOStatus
1622 #define cbStopBackground cbStopIOBackground
1623 //****************************************************************************
1624 
1625 #endif /* if defined (_WIN32) */
1626 
1627 #if defined (__cplusplus)
1628  }
1629 #endif
1630 
1631 #endif /* ifndef NT_DRIVER */