Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2042 lines
87 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: DRIVER.H
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of DRIVER.H
  13. //----------------------------------------------------------------------------
  14. /***************************************************************************
  15. Module Name: DRIVER.H
  16. Purpose: the declaration of functions, data structures, status codes,
  17. constants, and messages
  18. Version: 3.01
  19. Date: 04/16/1998
  20. Copyright (c) 1996 Advantech Corp. Ltd.
  21. All rights reserved.
  22. ****************************************************************************/
  23. #ifndef _INC_DRIVER
  24. #define _INC_DRIVER
  25. #include "OS.H"
  26. #ifdef _WIN31
  27. #define FLOAT float
  28. #define CHAR char
  29. #define USHORT unsigned short
  30. #define SHORT short
  31. #define ULONG unsigned long
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C"
  35. {
  36. #endif
  37. #define PUBLIC extern
  38. #define PRIVATE static
  39. /****************************************************************************
  40. Constant Definition
  41. ***************************************************************************/
  42. #define MaxDev 255 // max. # of devices
  43. #define MaxDevNameLen 64 // max lenght of device name
  44. #define MaxGroup 6
  45. #define MaxPort 3
  46. #define MaxErrMsgLen 80
  47. #define MAX_DEVICE_NAME_LEN 64
  48. #define MAX_DRIVER_NAME_LEN 16
  49. #define MAX_DAUGHTER_NUM 16 // Leon.jin mod 8 to 16
  50. #define MAX_DIO_PORT 48
  51. #define MAX_AO_RANGE 16 // leon.jin mod 8 to 16
  52. #define LOCAL 0
  53. #define REMOTE 1
  54. #define REMOTE1 REMOTE+1 // For PCL-818L JP7 = 5V
  55. #define REMOTE2 REMOTE1+1 // For PCL-818L JP7 = 10V
  56. #define NONPROG LOCAL
  57. #define PROG REMOTE
  58. #define INTERNAL 0
  59. #define EXTERNAL 1
  60. #define SINGLEENDED 0
  61. #define DIFFERENTIAL 1
  62. #define BIPOLAR 0
  63. #define UNIPOLAR 1
  64. #define PORTA 0
  65. #define PORTB 1
  66. #define PORTC 2
  67. #define INPORT 0
  68. #define OUTPORT 1
  69. /***************************************************************************
  70. Define board vendor ID
  71. **************************************************************************/
  72. #define AAC 0x0000 //Advantech
  73. #define MB 0x1000 //Keithley/MetraByte
  74. #define BB 0x2000 //Burr Brown
  75. #define GRAYHILL 0x3000 //Grayhill
  76. #define KGS 0x4000
  77. /****************************************************************************
  78. Define DAS I/O Board ID.
  79. ****************************************************************************/
  80. #define NONE 0x00 // not available
  81. //Advantech board ID
  82. #define BD_DEMO (AAC | 0x00) // demo board
  83. #define BD_PCL711 (AAC | 0x01) // PCL-711 board
  84. #define BD_PCL812 (AAC | 0x02) // PCL-812 board
  85. #define BD_PCL812PG (AAC | 0x03) // PCL-812PG board
  86. #define BD_PCL718 (AAC | 0x04) // PCL-718 board
  87. #define BD_PCL818 (AAC | 0x05) // PCL-818 board
  88. #define BD_PCL814 (AAC | 0x06) // PCL-814 board
  89. #define BD_PCL720 (AAC | 0x07) // PCL-722 board
  90. #define BD_PCL722 (AAC | 0x08) // PCL-720 board
  91. #define BD_PCL724 (AAC | 0x09) // PCL-724 board
  92. #define BD_AD4011 (AAC | 0x0a) // ADAM 4011 Module
  93. #define BD_AD4012 (AAC | 0x0b) // ADAM 4012 Module
  94. #define BD_AD4013 (AAC | 0x0c) // ADAM 4013 Module
  95. #define BD_AD4021 (AAC | 0x0d) // ADAM 4021 Module
  96. #define BD_AD4050 (AAC | 0x0e) // ADAM 4050 Module
  97. #define BD_AD4060 (AAC | 0x0f) // ADAM 4060 Module
  98. #define BD_PCL711B (AAC | 0x10) // PCL-711B
  99. #define BD_PCL818H (AAC | 0x11) // PCL-818H
  100. #define BD_PCL814B (AAC | 0x12) // PCL-814B
  101. #define BD_PCL816 (AAC | 0x13) // PCL-816
  102. #define BD_814_DIO_1 (AAC | 0x14) // PCL-816/814B 8255 DIO module
  103. #define BD_814_DA_1 (AAC | 0x15) // PCL-816/814B 12 bit D/A module
  104. #define BD_816_DA_1 (AAC | 0x16) // PCL-816/814B 16 bit D/A module
  105. #define BD_PCL830 (AAC | 0x17) // PCL-830 9513A Counter Card
  106. #define BD_PCL726 (AAC | 0x18) // PCL-726 D/A card
  107. #define BD_PCL727 (AAC | 0x19) // PCL-727 D/A card
  108. #define BD_PCL728 (AAC | 0x1a) // PCL-728 D/A card
  109. #define BD_AD4052 (AAC | 0x1b) // ADAM 4052 Module
  110. #define BD_AD4014D (AAC | 0x1c) // ADAM 4014D Module
  111. #define BD_AD4017 (AAC | 0x1d) // ADAM 4017 Module
  112. #define BD_AD4080D (AAC | 0x1e) // ADAM 4080D Module
  113. #define BD_PCL721 (AAC | 0x1f) // PCL-721 32-bit Digital in
  114. #define BD_PCL723 (AAC | 0x20) // PCL-723 24-bit Digital in
  115. #define BD_PCL818L (AAC | 0x21) // PCL-818L
  116. #define BD_PCL818HG (AAC | 0x22) // PCL-818HG
  117. #define BD_PCL1800 (AAC | 0x23) // PCL-1800
  118. #define BD_PAD71A (AAC | 0x24) // PCIA-71A
  119. #define BD_PAD71B (AAC | 0x25) // PCIA-71B
  120. #define BD_PCR420 (AAC | 0x26) // PCR-420
  121. #define BD_PCL731 (AAC | 0x27) // PCL-731 48-bit Digital I/O card
  122. #define BD_PCL730 (AAC | 0x28) // PCL-730 board
  123. #define BD_PCL813 (AAC | 0x29) // PCL-813 32-channel A/D card
  124. #define BD_PCL813B (AAC | 0x2a) // PCL-813B 32-channel A/D card
  125. #define BD_PCL818HD (AAC | 0x2b) // PCL-818HD
  126. #define BD_PCL725 (AAC | 0x2c) // PCL-725 digital I/O card
  127. #define BD_PCL732 (AAC | 0x2d) // PCL-732 high speed DIO card
  128. #define BD_AD4018 (AAC | 0x2e) // ADAM 4018 Module
  129. #define BD_814_TC_1 (AAC | 0x2f) // PCL-816/814B 16 bit TC module
  130. #define BD_PAD71C (AAC | 0x30) // PCIA-71C
  131. #define BD_AD4024 (AAC | 0x31) // ADAM 4024
  132. #define BD_AD5017 (AAC | 0x32) // ADAM 5017
  133. #define BD_AD5018 (AAC | 0x33) // ADAM 5018
  134. #define BD_AD5024 (AAC | 0x34) // ADAM 5024
  135. #define BD_AD5051 (AAC | 0x35) // ADAM 5051
  136. #define BD_AD5060 (AAC | 0x36) // ADAM 5060
  137. #define BD_PCM3718 (AAC | 0x37) // PCM-3718
  138. #define BD_PCM3724 (AAC | 0x38) // PCM-3724
  139. #define BD_MIC2718 (AAC | 0x39) // MIC-2718
  140. #define BD_MIC2728 (AAC | 0x3a) // MIC-2728
  141. #define BD_MIC2730 (AAC | 0x3b) // MIC-2730
  142. #define BD_MIC2732 (AAC | 0x3c) // MIC-2732
  143. #define BD_MIC2750 (AAC | 0x3d) // MIC-2750
  144. #define BD_MIC2752 (AAC | 0x3e) // MIC-2752
  145. #define BD_PCL733 (AAC | 0x3f) // PCL-733
  146. #define BD_PCL734 (AAC | 0x40) // PCL-734
  147. #define BD_PCL735 (AAC | 0x41) // PCL-735
  148. #define BD_AD4018M (AAC | 0x42) // ADAM 4018M Module
  149. #define BD_AD4080 (AAC | 0x43) // ADAM 4080 Module
  150. #define BD_PCL833 (AAC | 0x44) // PCL-833
  151. #define BD_PCA6157 (AAC | 0x45) // PCA-6157
  152. #define BD_PCA6149 (AAC | 0x46) // PCA-6149
  153. #define BD_PCA6147 (AAC | 0x47) // PCA-6147
  154. #define BD_PCA6137 (AAC | 0x48) // PCA-6137
  155. #define BD_PCA6145 (AAC | 0x49) // PCA-6145
  156. #define BD_PCA6144 (AAC | 0x4a) // PCA-6144
  157. #define BD_PCA6143 (AAC | 0x4b) // PCA-6143
  158. #define BD_PCA6134 (AAC | 0x4c) // PCA-6134
  159. #define BD_AD5056 (AAC | 0x4d) // ADAM 5056 for Device Net
  160. #define BD_DN5017 (AAC | 0x4e) // ADAM 5017 for Device Net
  161. #define BD_DN5018 (AAC | 0x4f) // ADAM 5018 for Device Net
  162. #define BD_DN5024 (AAC | 0x50) // ADAM 5024 for Device Net
  163. #define BD_DN5051 (AAC | 0x51) // ADAM 5051 for Device Net
  164. #define BD_DN5056 (AAC | 0x52) // ADAM 5056 for Device Net
  165. #define BD_DN5060 (AAC | 0x53) // ADAM 5060 for Device Net
  166. #define BD_PCL836 (AAC | 0x54) // PCL-836
  167. #define BD_PCL841 (AAC | 0x55) // PCL-841
  168. #define BD_DN5050 (AAC | 0x56) // ADAM 5050 for DeviceNet
  169. #define BD_DN5052 (AAC | 0x57) // ADAM 5052 for DeviceNet
  170. #define BD_AD5050 (AAC | 0x58) // ADAM 5050 for RS-485
  171. #define BD_AD5052 (AAC | 0x59) // ADAM 5052 for RS-485
  172. #define BD_PCM3730 (AAC | 0x5a) // PCM-3730
  173. #define BD_AD4011D (AAC | 0x5b) // ADAM 4011D
  174. #define BD_AD4016 (AAC | 0x5c) // ADAM 4016
  175. #define BD_AD4053 (AAC | 0x5d) // ADAM 4053
  176. #define BD_PCI1750 (AAC | 0x5e) // PCI-1750
  177. #define BD_PCI1751 (AAC | 0x5f) // PCI-1751
  178. #define BD_PCI1710 (AAC | 0x60) // PCI-1710
  179. #define BD_PCI1712 (AAC | 0x61) // PCI-1712
  180. #define BD_AD5068 (AAC | 0x62) // ADAM 5068
  181. #define BD_AD5013 (AAC | 0x63) // ADAM 5013
  182. #define BD_AD5017H (AAC | 0x64) // ADAM 5017H
  183. #define BD_AD5080 (AAC | 0x65) // ADAM 5080
  184. #define BD_MIC2760 (AAC | 0x66) // MIC-2760
  185. #define BD_PCI1710HG (AAC | 0x67) // PCI-1710HG
  186. #define BD_PCI1713 (AAC | 0x68) // PCI-1713
  187. #define BD_PCI1753 (AAC | 0x69) // PCI-1753
  188. #define BD_PCI1760 (AAC | 0x6a) // PCI-1760
  189. #define BD_PCI1720 (AAC | 0x6b) // PCI-1720
  190. #define BD_PCL752 (AAC | 0x6c) // PCL-772
  191. #define BD_PCM3718H (AAC | 0x6d) // PCM-3718H
  192. #define BD_PCM3718HG (AAC | 0x6e) // PCM-3718HG
  193. #define BD_DN5068 (AAC | 0x6f) // ADAM 5068 for Device Net
  194. #define BD_DN5013 (AAC | 0x70) // ADAM 5013 for Device Net
  195. #define BD_DN5017H (AAC | 0x71) // ADAM 5017H for Device Net
  196. #define BD_DN5080 (AAC | 0x72) // ADAM 5080 for Device Net (unavailable)
  197. #define BD_PCI1711 (AAC | 0x73) // PCI-1711
  198. #define BD_PCI1711L (AAC | 0x75) // PCI-1711
  199. #define BD_PCI1716 (AAC | 0x74) // PCI-1716
  200. #define BD_PCI1731 (AAC | 0x75) // PCI-1731
  201. #define BD_AD5051D (AAC | 0x76) // ADAM 5051D
  202. #define BD_AD5056D (AAC | 0x77) // ADAM 5056D
  203. #define BD_DN5051D (AAC | 0x78) // ADAM 5051D for Device Net
  204. #define BD_DN5056D (AAC | 0x79) // ADAM 5056D for Device Net
  205. #define BD_SIMULATE (AAC | 0x7a) // Simulate IO
  206. #define BD_PCI1754 (AAC | 0x7b) // PCI-1754
  207. #define BD_PCI1752 (AAC | 0x7c) // PCI-1752
  208. #define BD_PCI1756 (AAC | 0x7d) // PCI-1756
  209. #define BD_PCL839 (AAC | 0x7e) // PCL-839
  210. #define BD_PCM3725 (AAC | 0x7f) // PCM-3725
  211. #define BD_PCI1762 (AAC | 0x80) // PCI-1762
  212. #define BD_PCI1721 (AAC | 0x81) // PCI-1721
  213. #define BD_PCI1761 (AAC | 0x82) // PCI-1761
  214. #define BD_PCI1723 (AAC | 0x83) // PCI-1723
  215. #define BD_AD4019 (AAC | 0X84) // ADAM 4019 Module
  216. #define BD_AD5055 (AAC | 0X85) // ADAM 5055 Module
  217. #define BD_AD4015 (AAC | 0X86) // ADAM 4015 Module
  218. #define BD_PCI1730 (AAC | 0x87) // PCI-1730
  219. #define BD_PCI1733 (AAC | 0x88) // PCI-1733
  220. #define BD_PCI1734 (AAC | 0x89) // PCI-1734
  221. #define BD_MIC2750A (AAC | 0x8A) // MIC-2750A
  222. #define BD_MIC2718A (AAC | 0x8B) // MIC-2718A
  223. #define BD_AD4017P (AAC | 0X8c) // ADAM 4017P Module
  224. #define BD_AD4051 (AAC | 0X8d) // ADAM 4051 Module
  225. #define BD_AD4055 (AAC | 0X8e) // ADAM 4055 Module
  226. #define BD_AD4018P (AAC | 0x8f) // ADAM 4018P Module
  227. #define BD_PCI1710L (AAC | 0x90) // PCI-1710L
  228. #define BD_PCI1710HGL (AAC | 0x91) // PCI-1710HGL
  229. #define BD_MICRODAC (GRAYHILL | 0x1) // Grayhill MicroDAC Board ID
  230. #define BD_GIA10 (KGS | 0x01) // KGS GIA-10 module Board ID
  231. /*****************************************************************************
  232. Define Expansion Board ID.
  233. *****************************************************************************/
  234. #define AAC_EXP (AAC | 0x00000100) //Advantech expansion bits
  235. //define Advantech expansion board ID.
  236. #define BD_PCLD780 0x00000000 // PCLD-780
  237. #define BD_PCLD789 (AAC_EXP | 0x0) // PCLD-789
  238. #define BD_PCLD779 (AAC_EXP | 0x1) // PCLD-779
  239. #define BD_PCLD787 (AAC_EXP | 0x2) // PCLD-787
  240. #define BD_PCLD8115 (AAC_EXP | 0x3) // PCLD-8115
  241. #define BD_PCLD770 (AAC_EXP | 0x4) // PCLD-770
  242. #define BD_PCLD788 (AAC_EXP | 0x5) // PCLD-788
  243. #define BD_PCLD8710 (AAC_EXP | 0x6) // PCLD-8710
  244. #define BD_PCLD8712 (AAC_EXP | 0x7) // PCLD-8712
  245. /****************************************************************************
  246. Define subsection identifier
  247. ****************************************************************************/
  248. #define DAS_AISECTION 0x1 // A/D subsection
  249. #define DAS_AOSECTION 0x2 // D/A sbusection
  250. #define DAS_DISECTION 0x3 // Digital input subsection
  251. #define DAS_DOSECTION 0x4 // Digital output sbusection
  252. #define DAS_TEMPSECTION 0x5 // thermocouple section
  253. #define DAS_ECSECTION 0x6 // Event count subsection
  254. #define DAS_FMSECTION 0x7 // frequency measurement section
  255. #define DAS_POSECTION 0x8 // pulse output section
  256. #define DAS_ALSECTION 0x9 // alarm section
  257. #define MT_AISECTION 0x0a // monitoring A/D subsection
  258. #define MT_DISECTION 0x0b // monitoring D/I subsection
  259. /***************************************************************************
  260. Define Transfer Mode
  261. ****************************************************************************/
  262. #define POLLED_MODE 0x0 // software transfer
  263. #define DMA_MODE 0x1 // DMA transfer
  264. #define INTERRUPT_MODE 0x2 // Interrupt transfer
  265. /***************************************************************************
  266. Define Acquisition Mode
  267. ****************************************************************************/
  268. #define FREE_RUN 0
  269. #define PRE_TRIG 1
  270. #define POST_TRIG 2
  271. #define POSITION_TRIG 3
  272. /***************************************************************************
  273. Define Comparator's Condition
  274. ****************************************************************************/
  275. #define NOCONDITION 0
  276. #define LESS 1
  277. #define BETWEEN 2
  278. #define GREATER 3
  279. #define OUTSIDE 4
  280. /***************************************************************************
  281. Define Channel
  282. ****************************************************************************/
  283. #define ADV_CHANNEL0 0x01
  284. #define ADV_CHANNEL1 0x02
  285. #define ADV_CHANNEL2 0x04
  286. #define ADV_CHANNEL3 0x08
  287. #define ADV_CHANNEL4 0x10
  288. #define ADV_CHANNEL5 0x20
  289. #define ADV_CHANNEL6 0x40
  290. #define ADV_CHANNEL7 0x80
  291. /**************************************************************************
  292. Define Status Code
  293. ***************************************************************************/
  294. #define SUCCESS 0
  295. #define DrvErrorCode 1
  296. #define KeErrorCode 100
  297. #define DnetErrorCode 200
  298. #define GeniDrvErrorCode 300
  299. #define OPCErrorCode 1000
  300. #define MemoryAllocateFailed (DrvErrorCode + 0)
  301. #define ConfigDataLost (DrvErrorCode + 1)
  302. #define InvalidDeviceHandle (DrvErrorCode + 2)
  303. #define AIConversionFailed (DrvErrorCode + 3)
  304. #define AIScaleFailed (DrvErrorCode + 4)
  305. #define SectionNotSupported (DrvErrorCode + 5)
  306. #define InvalidChannel (DrvErrorCode + 6)
  307. #define InvalidGain (DrvErrorCode + 7)
  308. #define DataNotReady (DrvErrorCode + 8)
  309. #define InvalidInputParam (DrvErrorCode + 9)
  310. #define NoExpansionBoardConfig (DrvErrorCode + 10)
  311. #define InvalidAnalogOutValue (DrvErrorCode + 11)
  312. #define ConfigIoPortFailed (DrvErrorCode + 12)
  313. #define CommOpenFailed (DrvErrorCode + 13)
  314. #define CommTransmitFailed (DrvErrorCode + 14)
  315. #define CommReadFailed (DrvErrorCode + 15)
  316. #define CommReceiveFailed (DrvErrorCode + 16)
  317. #define CommConfigFailed (DrvErrorCode + 17)
  318. #define CommChecksumError (DrvErrorCode + 18)
  319. #define InitError (DrvErrorCode + 19)
  320. #define DMABufAllocFailed (DrvErrorCode + 20)
  321. #define IllegalSpeed (DrvErrorCode + 21)
  322. #define ChanConflict (DrvErrorCode + 22)
  323. #define BoardIDNotSupported (DrvErrorCode + 23)
  324. #define FreqMeasurementFailed (DrvErrorCode + 24)
  325. #define CreateFileFailed (DrvErrorCode + 25)
  326. #define FunctionNotSupported (DrvErrorCode + 26)
  327. #define LoadLibraryFailed (DrvErrorCode + 27)
  328. #define GetProcAddressFailed (DrvErrorCode + 28)
  329. #define InvalidDriverHandle (DrvErrorCode + 29)
  330. #define InvalidModuleType (DrvErrorCode + 30)
  331. #define InvalidInputRange (DrvErrorCode + 31)
  332. #define InvalidWindowsHandle (DrvErrorCode + 32)
  333. #define InvalidCountNumber (DrvErrorCode + 33)
  334. #define InvalidInterruptCount (DrvErrorCode + 34)
  335. #define InvalidEventCount (DrvErrorCode + 35)
  336. #define OpenEventFailed (DrvErrorCode + 36)
  337. #define InterruptProcessFailed (DrvErrorCode + 37)
  338. #define InvalidDOSetting (DrvErrorCode + 38)
  339. #define InvalidEventType (DrvErrorCode + 39)
  340. #define EventTimeOut (DrvErrorCode + 40)
  341. #define InvalidDmaChannel (DrvErrorCode + 41)
  342. #define IntDamChannelBusy (DrvErrorCode + 42)
  343. //
  344. #define CheckRunTimeClassFailed (DrvErrorCode + 43)
  345. #define CreateDllLibFailed (DrvErrorCode + 44)
  346. #define ExceptionError (DrvErrorCode + 45)
  347. #define RemoveDeviceFailed (DrvErrorCode + 46)
  348. #define BuildDeviceListFailed (DrvErrorCode + 47)
  349. #define NoIOFunctionSupport (DrvErrorCode + 48)
  350. /*#define NoSerialFunctionSupported (DrvErrorCode + 49)
  351. #define NoAiFunctionSupported (DrvErrorCode + 50
  352. #define NoAoFunctionSupported (DrvErrorCode + 51)
  353. #define NoDiFunctionSupported (DrvErrorCode + 52)
  354. #define NoDoFunctionSupported (DrvErrorCode + 53)
  355. #define NoAlarmFunctionSupported (DrvErrorCode + 54)
  356. #define NoCounterFunctionSupported (DrvErrorCode + 55)
  357. #define NoTempFunctionSupported (DrvErrorCode + 56)
  358. #define NoIOFunctionSupported (DrvErrorCode + 57)*/
  359. #define NoSerialFunctionSupported (GeniDrvErrorCode + 5)
  360. #define NoAiFunctionSupported (GeniDrvErrorCode + 6)
  361. #define NoAoFunctionSupported (GeniDrvErrorCode + 7)
  362. #define NoDiFunctionSupported (GeniDrvErrorCode + 8)
  363. #define NoDoFunctionSupported (GeniDrvErrorCode + 9)
  364. #define NoAlarmFunctionSupported (GeniDrvErrorCode + 10)
  365. #define NoCounterFunctionSupported (GeniDrvErrorCode + 11)
  366. #define NoTempFunctionSupported (GeniDrvErrorCode + 12)
  367. #define NoIOFunctionSupported (GeniDrvErrorCode + 13)
  368. #define KeInvalidHandleValue (KeErrorCode + 0)
  369. #define KeFileNotFound (KeErrorCode + 1)
  370. #define KeInvalidHandle (KeErrorCode + 2)
  371. #define KeTooManyCmds (KeErrorCode + 3)
  372. #define KeInvalidParameter (KeErrorCode + 4)
  373. #define KeNoAccess (KeErrorCode + 5)
  374. #define KeUnsuccessful (KeErrorCode + 6)
  375. #define KeConInterruptFailure (KeErrorCode + 7)
  376. #define KeCreateNoteFailure (KeErrorCode + 8)
  377. #define KeInsufficientResources (KeErrorCode + 9)
  378. #define KeHalGetAdapterFailure (KeErrorCode +10)
  379. #define KeOpenEventFailure (KeErrorCode +11)
  380. #define KeAllocCommBufFailure (KeErrorCode +12)
  381. #define KeAllocMdlFailure (KeErrorCode +13)
  382. #define KeBufferSizeTooSmall (KeErrorCode +14)
  383. #define DNInitFailed (DnetErrorCode + 1)
  384. #define DNSendMsgFailed (DnetErrorCode + 2)
  385. #define DNRunOutOfMsgID (DnetErrorCode + 3)
  386. #define DNInvalidInputParam (DnetErrorCode + 4)
  387. #define DNErrorResponse (DnetErrorCode + 5)
  388. #define DNNoResponse (DnetErrorCode + 6)
  389. #define DNBusyOnNetwork (DnetErrorCode + 7)
  390. #define DNUnknownResponse (DnetErrorCode + 8)
  391. #define DNNotEnoughBuffer (DnetErrorCode + 9)
  392. #define DNFragResponseError (DnetErrorCode + 10)
  393. #define DNTooMuchDataAck (DnetErrorCode + 11)
  394. #define DNFragRequestError (DnetErrorCode + 12)
  395. #define DNEnableEventError (DnetErrorCode + 13)
  396. #define DNCreateOrOpenEventError (DnetErrorCode + 14)
  397. #define DNIORequestError (DnetErrorCode + 15)
  398. #define DNGetEventNameError (DnetErrorCode + 16)
  399. #define DNTimeOutError (DnetErrorCode + 17)
  400. #define DNOpenFailed (DnetErrorCode + 18)
  401. #define DNCloseFailed (DnetErrorCode + 19)
  402. #define DNResetFailed (DnetErrorCode + 20)
  403. #define WM_ATODNOTIFY (WM_USER+200)
  404. #define WM_DTOANOTIFY (WM_USER+201)
  405. #define WM_DIGINNOTIFY (WM_USER+202)
  406. #define WM_DIGOUTNOTIFY (WM_USER+203)
  407. #define WM_MTNOTIFY (WM_USER+204)
  408. #define WM_CANTRANSMITCOMPLETE (WM_USER+205)
  409. #define WM_CANMESSAGE (WM_USER+206)
  410. #define WM_CANERROR (WM_USER+207)
  411. // define the wParam in user window message
  412. #define AD_NONE 0 //AD Section
  413. #define AD_TERMINATE 1
  414. #define AD_INT 2
  415. #define AD_BUFFERCHANGE 3
  416. #define AD_OVERRUN 4
  417. #define AD_WATCHDOGACT 5
  418. #define AD_TIMEOUT 6
  419. #define DA_TERMINATE 0 // DA Section
  420. #define DA_DMATC 1
  421. #define DA_INT 2
  422. #define DA_BUFFERCHANGE 3
  423. #define DA_OVERRUN 4
  424. #define DI_TERMINATE 0 // DI Section
  425. #define DI_DMATC 1
  426. #define DI_INT 2
  427. #define DI_BUFFERCHANGE 3
  428. #define DI_OVERRUN 4
  429. #define DI_WATCHDOGACT 5
  430. #define DO_TERMINATE 0 // DO Section
  431. #define DO_DMATC 1
  432. #define DO_INT 2
  433. #define DO_BUFFERCHANGE 3
  434. #define DO_OVERRUN 4
  435. #define MT_ATOD 0 // MT Section
  436. #define MT_DIGIN 1
  437. #define CAN_TRANSFER 0 // CAN Section
  438. #define CAN_RECEIVE 1
  439. #define CAN_ERROR 2
  440. /****************************************************************************
  441. define thermocopule type J, K, S, T, B, R, E
  442. *****************************************************************************/
  443. #define BTC 4
  444. #define ETC 6
  445. #define JTC 0
  446. #define KTC 1
  447. #define RTC 5
  448. #define STC 2
  449. #define TTC 3
  450. /****************************************************************************
  451. define temperature scale
  452. *****************************************************************************/
  453. #define C 0 //Celsius
  454. #define F 1 //Fahrenheit
  455. #define R 2 // Rankine
  456. #define K 3 // Kelvin
  457. /****************************************************************************
  458. define service type for COMEscape()
  459. *****************************************************************************/
  460. #define EscapeFlushInput 1
  461. #define EscapeFlushOutput 2
  462. #define EscapeSetBreak 3
  463. #define EscapeClearBreak 4
  464. /****************************************************************************
  465. define gate mode
  466. *****************************************************************************/
  467. #define GATE_DISABLED 0 // no gating
  468. #define GATE_HIGHLEVEL 1 // active high level
  469. #define GATE_LOWLEVEL 2 // active low level
  470. #define GATE_HIGHEDGE 3 // active high edge
  471. #define GATE_LOWEDGE 4 // active low edge
  472. /****************************************************************************
  473. define input mode for PCL-833
  474. *****************************************************************************/
  475. #define DISABLE 0 // disable mode
  476. #define ABPHASEX1 1 // Quadrature input X1
  477. #define ABPHASEX2 2 // Quadrature input X2
  478. #define ABPHASEX4 3 // Quadrature input X4
  479. #define TWOPULSEIN 4 // 2 pulse input
  480. #define ONEPULSEIN 5 // 1 pulse input
  481. /****************************************************************************
  482. define latch source for PCL-833
  483. *****************************************************************************/
  484. #define SWLATCH 0 // S/W read latch data
  485. #define INDEXINLATCH 1 // Index-in latch data
  486. #define DI0LATCH 2 // DI0 latch data
  487. #define DI1LATCH 3 // DI1 latch data
  488. #define TIMERLATCH 4 // Timer latch data
  489. /****************************************************************************
  490. define timer base mode for PCL-833
  491. *****************************************************************************/
  492. #define TPOINT1MS 0 // 0.1 ms timer base
  493. #define T1MS 1 // 1 ms timer base
  494. #define T10MS 2 // 10 ms timer base
  495. #define T100MS 3 // 100 ms timer base
  496. #define T1000MS 4 // 1000 ms timer base
  497. /****************************************************************************
  498. define clock source for PCL-833
  499. *****************************************************************************/
  500. #define SYS8MHZ 0 // 8 MHZ system clock
  501. #define SYS4MHZ 1 // 4 MHZ system clock
  502. #define SYS2MHZ 2 // 2 MHZ system clock
  503. /****************************************************************************
  504. define cascade mode for PCL-833
  505. *****************************************************************************/
  506. #define NOCASCADE 0 // 24-bit(no cascade)
  507. #define CASCADE 1 // 48-bit(CH1, CH2 cascade)
  508. /****************************************************************************
  509. define event type for interrupt and DMA transfer
  510. *****************************************************************************/
  511. #define ADS_EVT_INTERRUPT 0x1 // interrupt
  512. #define ADS_EVT_BUFCHANGE 0x2 // buffer change
  513. #define ADS_EVT_TERMINATED 0x4 // termination
  514. #define ADS_EVT_OVERRUN 0x8 // overrun
  515. #define ADS_EVT_WATCHDOG 0x10 // watchdog actived
  516. #define ADS_EVT_CHGSTATE 0x20 // change state event
  517. #define ADS_EVT_ALARM 0x40 // alarm event
  518. #define ADS_EVT_PORT0 0x80 // port 0 event
  519. #define ADS_EVT_PORT1 0x100 // port 1 event
  520. #define ADS_EVT_PATTERNMATCH 0x200 // Pattern Match for DI
  521. #define ADS_EVT_COUNTER 0x201 // Persudo event for COUNTERMATCH and COUNTEROVERFLOW
  522. #define ADS_EVT_COUNTERMATCH 0x202 // Counter Match setting NO. for DI
  523. #define ADS_EVT_COUNTEROVERFLOW 0x203 // Counter Overflow for DI
  524. #define ADS_EVT_STATUSCHANGE 0x204 // Status Change for DI
  525. #define ADS_EVT_FILTER 0x205 // Filter Event
  526. #define ADS_EVT_INTERRUPT_DI0 0x300 // interrupt from DI0
  527. #define ADS_EVT_INTERRUPT_DI1 0x301 // interrupt from DI1
  528. #define ADS_EVT_INTERRUPT_DI2 0x302 // interrupt from DI2
  529. #define ADS_EVT_INTERRUPT_DI3 0x303 // interrupt from DI3
  530. #define ADS_EVT_INTERRUPT_DI4 0x304 // interrupt from DI4
  531. #define ADS_EVT_INTERRUPT_DI5 0x305 // interrupt from DI5
  532. #define ADS_EVT_INTERRUPT_DI6 0x306 // interrupt from DI6
  533. #define ADS_EVT_INTERRUPT_DI7 0x307 // interrupt from DI7
  534. /****************************************************************************
  535. define event name by device number
  536. *****************************************************************************/
  537. #define ADS_EVT_INTERRUPT_NAME "ADS_EVT_INTERRUPT"
  538. #define ADS_EVT_PORT0_NAME "ADS_EVT_PORT0"
  539. #define ADS_EVT_PORT1_NAME "ADS_EVT_PORT1"
  540. #define ADS_EVT_BUFCHANGE_NAME "ADS_EVT_BUFCHANGE"
  541. #define ADS_EVT_TERMINATED_NAME "ADS_EVT_TERMINATED"
  542. #define ADS_EVT_OVERRUN_NAME "ADS_EVT_OVERRUN"
  543. #define ADS_EVT_WATCHDOG_NAME "ADS_EVT_WATCHDOG"
  544. #define ADS_EVT_CHGSTATE_NAME "ADS_EVT_CHGSTATE"
  545. #define ADS_EVT_ALARM_NAME "ADS_EVT_ALARM"
  546. #define ADS_EVT_PATTERNMATCH_NAME "ADS_EVT_PATTERNMATCH"
  547. #define ADS_EVT_COUNTERMATCH_NAME "ADS_EVT_COUNTERMATCH"
  548. #define ADS_EVT_COUNTEROVERFLOW_NAME "ADS_EVT_COUNTEROVERFLOW"
  549. #define ADS_EVT_STATUSCHANGE_NAME "ADS_EVT_STATUSCHANGE"
  550. #define ADS_EVT_INTERRUPT_DI0_NAME "ADS_EVT_INTERRUPT_DI0"
  551. #define ADS_EVT_INTERRUPT_DI1_NAME "ADS_EVT_INTERRUPT_DI1"
  552. #define ADS_EVT_INTERRUPT_DI2_NAME "ADS_EVT_INTERRUPT_DI2"
  553. #define ADS_EVT_INTERRUPT_DI3_NAME "ADS_EVT_INTERRUPT_DI3"
  554. #define ADS_EVT_INTERRUPT_DI4_NAME "ADS_EVT_INTERRUPT_DI4"
  555. #define ADS_EVT_INTERRUPT_DI5_NAME "ADS_EVT_INTERRUPT_DI5"
  556. #define ADS_EVT_INTERRUPT_DI6_NAME "ADS_EVT_INTERRUPT_DI6"
  557. #define ADS_EVT_INTERRUPT_DI7_NAME "ADS_EVT_INTERRUPT_DI7"
  558. /****************************************************************************
  559. define FIFO size
  560. *****************************************************************************/
  561. #define FIFO_SIZE 512 // 1K FIFO size (512* 2byte/each data)
  562. #define FIFO_SIZE4 2048 // 4K FIFO size (2048* 2byte/each data)
  563. /****************************************************************************
  564. Function ID Definition
  565. *****************************************************************************/
  566. #define FID_DeviceOpen 0
  567. #define FID_DeviceClose 1
  568. #define FID_DeviceGetFeatures 2
  569. #define FID_AIConfig 3
  570. #define FID_AIGetConfig 4
  571. #define FID_AIBinaryIn 5
  572. #define FID_AIScale 6
  573. #define FID_AIVoltageIn 7
  574. #define FID_AIVoltageInExp 8
  575. #define FID_MAIConfig 9
  576. #define FID_MAIBinaryIn 10
  577. #define FID_MAIVoltageIn 11
  578. #define FID_MAIVoltageInExp 12
  579. #define FID_TCMuxRead 13
  580. #define FID_AOConfig 14
  581. #define FID_AOBinaryOut 15
  582. #define FID_AOVoltageOut 16
  583. #define FID_AOScale 17
  584. #define FID_DioSetPortMode 18
  585. #define FID_DioGetConfig 19
  586. #define FID_DioReadPortByte 20
  587. #define FID_DioWritePortByte 21
  588. #define FID_DioReadBit 22
  589. #define FID_DioWriteBit 23
  590. #define FID_DioGetCurrentDOByte 24
  591. #define FID_DioGetCurrentDOBit 25
  592. #define FID_WritePortByte 26
  593. #define FID_WritePortWord 27
  594. #define FID_ReadPortByte 28
  595. #define FID_ReadPortWord 29
  596. #define FID_CounterEventStart 30
  597. #define FID_CounterEventRead 31
  598. #define FID_CounterFreqStart 32
  599. #define FID_CounterFreqRead 33
  600. #define FID_CounterPulseStart 34
  601. #define FID_CounterReset 35
  602. #define FID_QCounterConfig 36
  603. #define FID_QCounterConfigSys 37
  604. #define FID_QCounterStart 38
  605. #define FID_QCounterRead 39
  606. #define FID_AlarmConfig 40
  607. #define FID_AlarmEnable 41
  608. #define FID_AlarmCheck 42
  609. #define FID_AlarmReset 43
  610. #define FID_COMOpen 44
  611. #define FID_COMConfig 45
  612. #define FID_COMClose 46
  613. #define FID_COMRead 47
  614. #define FID_COMWrite232 48
  615. #define FID_COMWrite485 49
  616. #define FID_COMWrite85 50
  617. #define FID_COMInit 51
  618. #define FID_COMLock 52
  619. #define FID_COMUnlock 53
  620. #define FID_WDTEnable 54
  621. #define FID_WDTRefresh 55
  622. #define FID_WDTReset 56
  623. #define FID_FAIIntStart 57
  624. #define FID_FAIIntScanStart 58
  625. #define FID_FAIDmaStart 59
  626. #define FID_FAIDmaScanStart 60
  627. #define FID_FAIDualDmaStart 61
  628. #define FID_FAIDualDmaScanStart 62
  629. #define FID_FAICheck 63
  630. #define FID_FAITransfer 64
  631. #define FID_FAIStop 65
  632. #define FID_FAIWatchdogConfig 66
  633. #define FID_FAIIntWatchdogStart 67
  634. #define FID_FAIDmaWatchdogStart 68
  635. #define FID_FAIWatchdogCheck 69
  636. #define FID_FAOIntStart 70
  637. #define FID_FAODmaStart 71
  638. #define FID_FAOScale 72
  639. #define FID_FAOLoad 73
  640. #define FID_FAOCheck 74
  641. #define FID_FAOStop 75
  642. #define FID_ClearOverrun 76
  643. #define FID_EnableEvent 77
  644. #define FID_CheckEvent 78
  645. #define FID_AllocateDMABuffer 79
  646. #define FID_FreeDMABuffer 80
  647. #define FID_EnableCANEvent 81
  648. #define FID_GetCANEventData 82
  649. #define FID_TimerCountSetting 83
  650. #define FID_CounterPWMSetting 84
  651. #define FID_CounterPWMEnable 85
  652. #define FID_DioTimerSetting 86
  653. #define FID_EnableEventEx 87
  654. #define FID_DICounterReset 88
  655. #define FID_FDITransfer 89
  656. #define FID_EnableSyncAO 90
  657. #define FID_WriteSyncAO 91
  658. #define FID_AOCurrentOut 92
  659. #define FID_ADAMCounterSetHWConfig 93
  660. #define FID_ADAMCounterGetHWConfig 94
  661. #define FID_ADAMAISetHWConfig 95
  662. #define FID_ADAMAIGetHWConfig 96
  663. #define FID_ADAMAOSetHWConfig 97
  664. #define FID_ADAMAOGetHWConfig 98
  665. #define FID_GetFIFOSize 99
  666. #define FID_PWMStartRead 100
  667. #define FID_FAIDmaExStart 101
  668. #define FID_FAOWaveFormStart 102
  669. typedef struct _DRIVERINFO
  670. {
  671. struct _DRIVERINFO far * pNext; // next device info. address
  672. ULONG ulDeviceNum; // device number
  673. HGLOBAL hDriverInfo; // driver info. handle
  674. USHORT usUsageCount; // usage count
  675. HINSTANCE hDriverInstance; // driver instance handle
  676. FARPROC lpfnDriverEntry; // driver entry address
  677. LONG hDeviceInfo; // deivce info. (Lock data)
  678. } DRIVERINFO, FAR * LPDRIVERINFO;
  679. /*************************************************************************
  680. define gain listing
  681. *************************************************************************/
  682. typedef struct tagGAINLIST
  683. {
  684. USHORT usGainCde;
  685. FLOAT fMaxGainVal;
  686. FLOAT fMinGainVal;
  687. CHAR szGainStr[16];
  688. } GAINLIST;
  689. /*************************************************************************
  690. Define hardware board(device) features.
  691. Note: definition for dwPermutaion member
  692. Bit 0: Software AI
  693. Bit 1: DMA AI
  694. Bit 2: Interrupt AI
  695. Bit 3: Condition AI
  696. Bit 4: Software AO
  697. Bit 5: DMA AO
  698. Bit 6: Interrupt AO
  699. Bit 7: Condition AO
  700. Bit 8: Software DI
  701. Bit 9: DMA DI
  702. Bit 10: Interrupt DI
  703. Bit 11: Condition DI
  704. Bit 12: Software DO
  705. Bit 13: DMA DO
  706. Bit 14: Interrupt DO
  707. Bit 15: Condition DO
  708. Bit 16: High Gain
  709. Bit 17: Auto Channel Scan
  710. Bit 18: Pacer Trigger
  711. Bit 19: External Trigger
  712. Bit 20: Down Counter
  713. Bit 21: Dual DMA
  714. Bit 22: Monitoring
  715. Bit 23: QCounter
  716. ************************************************************************/
  717. typedef struct tagDEVFEATURES
  718. {
  719. CHAR szDriverVer[8]; // device driver version
  720. CHAR szDriverName[MAX_DRIVER_NAME_LEN]; // device driver name
  721. DWORD dwBoardID; // board ID
  722. USHORT usMaxAIDiffChl; // Max. number of differential channel
  723. USHORT usMaxAISiglChl; // Max. number of single-end channel
  724. USHORT usMaxAOChl; // Max. number of D/A channel
  725. USHORT usMaxDOChl; // Max. number of digital out channel
  726. USHORT usMaxDIChl; // Max. number of digital input channel
  727. USHORT usDIOPort; // specifies if programmable or not
  728. USHORT usMaxTimerChl; // Max. number of Counter/Timer channel
  729. USHORT usMaxAlarmChl; // Max number of alram channel
  730. USHORT usNumADBit; // number of bits for A/D converter
  731. USHORT usNumADByte; // A/D channel width in bytes.
  732. USHORT usNumDABit; // number of bits for D/A converter.
  733. USHORT usNumDAByte; // D/A channel width in bytes.
  734. USHORT usNumGain ; // Max. number of gain code
  735. GAINLIST glGainList[16]; // Gain listing
  736. DWORD dwPermutation[4]; // Permutation
  737. } DEVFEATURES, FAR * LPDEVFEATURES;
  738. /*************************************************************************
  739. AOSET Definition
  740. *************************************************************************/
  741. typedef struct tagAOSET
  742. {
  743. USHORT usAOSource; // 0-internal, 1-external
  744. FLOAT fAOMaxVol; // maximum output voltage
  745. FLOAT fAOMinVol; // minimum output voltage
  746. FLOAT fAOMaxCur; // maximum output voltage
  747. FLOAT fAOMinCur; // minimum output voltage
  748. } AOSET, FAR * LPAOSET;
  749. /*************************************************************************
  750. DaughterSet Definition
  751. *************************************************************************/
  752. typedef struct tagDAUGHTERSET
  753. {
  754. DWORD dwBoardID; // expansion board ID
  755. USHORT usNum; // available expansion channels
  756. FLOAT fGain; // gain for expansion channel
  757. USHORT usCards; // number of expansion cards
  758. } DAUGHTERSET, FAR * LPDAUGHTERSET;
  759. /**************************************************************************
  760. Analog Input Configuration Definition
  761. ***************************************************************************/
  762. typedef struct tagDEVCONFIG_AI
  763. {
  764. DWORD dwBoardID; // board ID code
  765. USHORT usChanConfig; // 0-single ended, 1-differential
  766. USHORT usGainCtrMode; // 1-by jumper, 0-programmable
  767. USHORT usPolarity; // 0-bipolar, 1-unipolar
  768. USHORT usDasGain; // not used if GainCtrMode = 1
  769. USHORT usNumExpChan; // DAS channels attached expansion board
  770. USHORT usCjcChannel; // cold junction channel
  771. DAUGHTERSET Daughter[MAX_DAUGHTER_NUM]; // expansion board settings
  772. } DEVCONFIG_AI, FAR * LPDEVCONFIG_AI;
  773. /**************************************************************************
  774. DEVCONFIG_COM Definition
  775. ***************************************************************************/
  776. typedef struct tagDEVCONFIG_COM
  777. {
  778. USHORT usCommPort; // serial port
  779. DWORD dwBaudRate; // baud rate
  780. USHORT usParity; // parity check
  781. USHORT usDataBits; // data bits
  782. USHORT usStopBits; // stop bits
  783. USHORT usTxMode; // transmission mode
  784. USHORT usPortAddress; // communication port address
  785. } DEVCONFIG_COM, FAR * LPDEVCONFIG_COM;
  786. /**************************************************************************
  787. TRIGLEVEL Definition
  788. ***************************************************************************/
  789. typedef struct tagTRIGLEVEL
  790. {
  791. FLOAT fLow;
  792. FLOAT fHigh;
  793. } TRIGLEVEL;
  794. typedef struct tagPT_DEVLIST
  795. {
  796. DWORD dwDeviceNum;
  797. char szDeviceName[50];
  798. SHORT nNumOfSubdevices;
  799. } DEVLIST, FAR *LPDEVLIST;
  800. typedef struct tagPT_DeviceGetFeatures
  801. {
  802. LPDEVFEATURES buffer;
  803. USHORT size;
  804. } PT_DeviceGetFeatures, FAR * LPT_DeviceGetFeatures;
  805. typedef struct tagPT_AIConfig
  806. {
  807. USHORT DasChan;
  808. USHORT DasGain;
  809. } PT_AIConfig, FAR * LPT_AIConfig;
  810. typedef struct tagPT_AIGetConfig
  811. {
  812. LPDEVCONFIG_AI buffer;
  813. USHORT size;
  814. } PT_AIGetConfig, FAR * LPT_AIGetConfig;
  815. typedef struct tagPT_AIBinaryIn
  816. {
  817. USHORT chan;
  818. USHORT TrigMode;
  819. USHORT far *reading;
  820. } PT_AIBinaryIn, FAR * LPT_AIBinaryIn;
  821. typedef struct tagPT_AIScale
  822. {
  823. USHORT reading;
  824. FLOAT MaxVolt;
  825. USHORT MaxCount;
  826. USHORT offset;
  827. FLOAT far *voltage;
  828. } PT_AIScale, FAR * LPT_AIScale;
  829. typedef struct tagPT_AIVoltageIn
  830. {
  831. USHORT chan;
  832. USHORT gain;
  833. USHORT TrigMode;
  834. FLOAT far *voltage;
  835. } PT_AIVoltageIn, FAR * LPT_AIVoltageIn;
  836. typedef struct tagPT_AIVoltageInExp
  837. {
  838. USHORT DasChan;
  839. USHORT DasGain;
  840. USHORT ExpChan;
  841. FLOAT far *voltage;
  842. } PT_AIVoltageInExp, FAR * LPT_AIVoltageInExp;
  843. typedef struct tagPT_MAIConfig
  844. {
  845. USHORT NumChan;
  846. USHORT StartChan;
  847. USHORT far *GainArray;
  848. } PT_MAIConfig, FAR * LPT_MAIConfig;
  849. typedef struct tagPT_MAIBinaryIn
  850. {
  851. USHORT NumChan;
  852. USHORT StartChan;
  853. USHORT TrigMode;
  854. USHORT far *ReadingArray;
  855. } PT_MAIBinaryIn, FAR * LPT_MAIBinaryIn;
  856. typedef struct tagPT_MAIVoltageIn
  857. {
  858. USHORT NumChan;
  859. USHORT StartChan;
  860. USHORT far *GainArray;
  861. USHORT TrigMode;
  862. FLOAT far *VoltageArray;
  863. } PT_MAIVoltageIn, FAR * LPT_MAIVoltageIn;
  864. typedef struct tagPT_MAIVoltageInExp
  865. {
  866. USHORT NumChan;
  867. USHORT far *DasChanArray;
  868. USHORT far *DasGainArray;
  869. USHORT far *ExpChanArray;
  870. FLOAT far *VoltageArray;
  871. } PT_MAIVoltageInExp, FAR * LPT_MAIVoltageInExp;
  872. typedef struct tagPT_TCMuxRead
  873. {
  874. USHORT DasChan;
  875. USHORT DasGain;
  876. USHORT ExpChan;
  877. USHORT TCType;
  878. USHORT TempScale;
  879. FLOAT far *temp;
  880. } PT_TCMuxRead, FAR * LPT_TCMuxRead;
  881. typedef struct tagPT_AOConfig
  882. {
  883. USHORT chan;
  884. USHORT RefSrc;
  885. FLOAT MaxValue;
  886. FLOAT MinValue;
  887. } PT_AOConfig, FAR * LPT_AOConfig;
  888. typedef struct tagPT_AOBinaryOut
  889. {
  890. USHORT chan;
  891. USHORT BinData;
  892. } PT_AOBinaryOut, FAR * LPT_AOBinaryOut;
  893. typedef struct tagPT_AOVoltageOut
  894. {
  895. USHORT chan;
  896. FLOAT OutputValue;
  897. } PT_AOVoltageOut, FAR * LPT_AOVoltageOut;
  898. typedef struct tagPT_AOScale
  899. {
  900. USHORT chan;
  901. FLOAT OutputValue;
  902. USHORT far *BinData;
  903. }PT_AOScale, FAR * LPT_AOScale;
  904. typedef struct tagPT_DioSetPortMode
  905. {
  906. USHORT port;
  907. USHORT dir;
  908. } PT_DioSetPortMode, FAR * LPT_DioSetPortMode;
  909. typedef struct tagPT_DioGetConfig
  910. {
  911. SHORT far *PortArray;
  912. USHORT NumOfPorts;
  913. } PT_DioGetConfig, FAR * LPT_DioGetConfig;
  914. typedef struct tagPT_DioReadPortByte
  915. {
  916. USHORT port;
  917. USHORT far *value;
  918. } PT_DioReadPortByte, FAR * LPT_DioReadPortByte;
  919. typedef struct tagPT_DioWritePortByte
  920. {
  921. USHORT port;
  922. USHORT mask;
  923. USHORT state;
  924. } PT_DioWritePortByte, FAR * LPT_DioWritePortByte;
  925. typedef struct tagPT_DioReadBit
  926. {
  927. USHORT port;
  928. USHORT bit;
  929. USHORT far *state;
  930. } PT_DioReadBit, FAR * LPT_DioReadBit;
  931. typedef struct tagPT_DioWriteBit
  932. {
  933. USHORT port;
  934. USHORT bit;
  935. USHORT state;
  936. } PT_DioWriteBit, FAR * LPT_DioWriteBit;
  937. typedef struct tagPT_DioGetCurrentDOByte
  938. {
  939. USHORT port;
  940. USHORT far *value;
  941. } PT_DioGetCurrentDOByte, FAR * LPT_DioGetCurrentDOByte;
  942. typedef struct tagPT_DioGetCurrentDOBit
  943. {
  944. USHORT port;
  945. USHORT bit;
  946. USHORT far *state;
  947. } PT_DioGetCurrentDOBit, FAR * LPT_DioGetCurrentDOBit;
  948. typedef struct tagPT_WritePortByte
  949. {
  950. USHORT port;
  951. USHORT ByteData;
  952. } PT_WritePortByte, FAR * LPT_WritePortByte;
  953. typedef struct tagPT_WritePortWord
  954. {
  955. USHORT port;
  956. USHORT WordData;
  957. } PT_WritePortWord, FAR * LPT_WritePortWord;
  958. typedef struct tagPT_ReadPortByte
  959. {
  960. USHORT port;
  961. USHORT far *ByteData;
  962. } PT_ReadPortByte, FAR * LPT_ReadPortByte;
  963. typedef struct tagPT_ReadPortWord
  964. {
  965. USHORT port;
  966. USHORT far *WordData;
  967. } PT_ReadPortWord, FAR * LPT_ReadPortWord;
  968. typedef struct tagPT_CounterEventStart
  969. {
  970. USHORT counter;
  971. USHORT GateMode;
  972. } PT_CounterEventStart, FAR * LPT_CounterEventStart;
  973. typedef struct tagPT_CounterEventRead
  974. {
  975. USHORT counter;
  976. USHORT far *overflow;
  977. ULONG far *count;
  978. } PT_CounterEventRead, FAR * LPT_CounterEventRead;
  979. typedef struct tagPT_CounterFreqStart
  980. {
  981. USHORT counter;
  982. USHORT GatePeriod;
  983. USHORT GateMode;
  984. } PT_CounterFreqStart, FAR * LPT_CounterFreqStart;
  985. typedef struct tagPT_CounterFreqRead
  986. {
  987. USHORT counter;
  988. FLOAT far *freq;
  989. } PT_CounterFreqRead, FAR * LPT_CounterFreqRead;
  990. typedef struct tagPT_CounterPulseStart
  991. {
  992. USHORT counter;
  993. FLOAT period;
  994. FLOAT UpCycle;
  995. USHORT GateMode;
  996. } PT_CounterPulseStart, FAR * LPT_CounterPulseStart;
  997. typedef struct tagPT_QCounterConfig
  998. {
  999. USHORT counter;
  1000. USHORT LatchSrc;
  1001. USHORT LatchOverflow;
  1002. USHORT ResetOnLatch;
  1003. USHORT ResetValue;
  1004. } PT_QCounterConfig, FAR * LPT_QCounterConfig;
  1005. typedef struct tagPT_QCounterConfigSys
  1006. {
  1007. USHORT SysClock;
  1008. USHORT TimeBase;
  1009. USHORT TimeDivider;
  1010. USHORT CascadeMode;
  1011. } PT_QCounterConfigSys, FAR * LPT_QCounterConfigSys;
  1012. typedef struct tagPT_QCounterStart
  1013. {
  1014. USHORT counter;
  1015. USHORT InputMode;
  1016. } PT_QCounterStart, FAR * LPT_QCounterStart;
  1017. typedef struct tagPT_QCounterRead
  1018. {
  1019. USHORT counter;
  1020. USHORT far *overflow;
  1021. ULONG far *LoCount;
  1022. ULONG far *HiCount;
  1023. } PT_QCounterRead, FAR * LPT_QCounterRead;
  1024. typedef struct tagPT_AlarmConfig
  1025. {
  1026. USHORT chan;
  1027. FLOAT LoLimit;
  1028. FLOAT HiLimit;
  1029. } PT_AlarmConfig, FAR * LPT_AlarmConfig;
  1030. typedef struct tagPT_AlarmEnable
  1031. {
  1032. USHORT chan;
  1033. USHORT LatchMode;
  1034. USHORT enabled;
  1035. } PT_AlarmEnable, FAR * LPT_AlarmEnable;
  1036. typedef struct tagPT_AlarmCheck
  1037. {
  1038. USHORT chan;
  1039. USHORT far *LoState;
  1040. USHORT far *HiState;
  1041. } PT_AlarmCheck, FAR * LPT_AlarmCheck;
  1042. typedef struct tagPT_WDTEnable
  1043. {
  1044. USHORT message;
  1045. HWND Destination;
  1046. } PT_WDTEnable, FAR * LPT_WDTEnable;
  1047. typedef struct tagPT_FAIIntStart
  1048. {
  1049. USHORT TrigSrc;
  1050. DWORD SampleRate;
  1051. USHORT chan;
  1052. USHORT gain;
  1053. USHORT far *buffer;
  1054. ULONG count;
  1055. USHORT cyclic;
  1056. USHORT IntrCount;
  1057. } PT_FAIIntStart, FAR * LPT_FAIIntStart;
  1058. typedef struct tagPT_FAIIntScanStart
  1059. {
  1060. USHORT TrigSrc;
  1061. DWORD SampleRate;
  1062. USHORT NumChans;
  1063. USHORT StartChan;
  1064. USHORT far *GainList;
  1065. USHORT far *buffer;
  1066. ULONG count;
  1067. USHORT cyclic;
  1068. USHORT IntrCount;
  1069. } PT_FAIIntScanStart, FAR * LPT_FAIIntScanStart;
  1070. typedef struct tagPT_FAIDmaStart
  1071. {
  1072. USHORT TrigSrc;
  1073. DWORD SampleRate;
  1074. USHORT chan;
  1075. USHORT gain;
  1076. USHORT far *buffer;
  1077. ULONG count;
  1078. } PT_FAIDmaStart, FAR * LPT_FAIDmaStart;
  1079. typedef struct tagPT_FAIDmaScanStart
  1080. {
  1081. USHORT TrigSrc;
  1082. DWORD SampleRate;
  1083. USHORT NumChans;
  1084. USHORT StartChan;
  1085. USHORT far *GainList;
  1086. USHORT far *buffer;
  1087. ULONG count;
  1088. } PT_FAIDmaScanStart, FAR * LPT_FAIDmaScanStart;
  1089. typedef struct tagPT_FAIDualDmaStart
  1090. {
  1091. USHORT TrigSrc;
  1092. DWORD SampleRate;
  1093. USHORT chan;
  1094. USHORT gain;
  1095. USHORT far *BufferA;
  1096. USHORT far *BufferB;
  1097. ULONG count;
  1098. USHORT cyclic;
  1099. } PT_FAIDualDmaStart, FAR * LPT_FAIDualDmaStart;
  1100. typedef struct tagPT_FAIDualDmaScanStart
  1101. {
  1102. USHORT TrigSrc;
  1103. DWORD SampleRate;
  1104. USHORT NumChans;
  1105. USHORT StartChan;
  1106. USHORT far *GainList;
  1107. USHORT far *BufferA;
  1108. USHORT far *BufferB;
  1109. ULONG count;
  1110. USHORT cyclic;
  1111. } PT_FAIDualDmaScanStart, FAR * LPT_FAIDualDmaScanStart;
  1112. typedef struct tagPT_FAITransfer
  1113. {
  1114. USHORT ActiveBuf;
  1115. LPVOID DataBuffer;
  1116. USHORT DataType;
  1117. ULONG start;
  1118. ULONG count;
  1119. USHORT far *overrun;
  1120. } PT_FAITransfer, FAR * LPT_FAITransfer;
  1121. typedef struct tagPT_FAICheck
  1122. {
  1123. USHORT far *ActiveBuf;
  1124. USHORT far *stopped;
  1125. ULONG far *retrieved;
  1126. USHORT far *overrun;
  1127. USHORT far *HalfReady;
  1128. } PT_FAICheck, FAR * LPT_FAICheck;
  1129. typedef struct tagPT_FAIWatchdogConfig
  1130. {
  1131. USHORT TrigMode;
  1132. USHORT NumChans;
  1133. USHORT StartChan;
  1134. USHORT far *GainList;
  1135. USHORT far *CondList;
  1136. TRIGLEVEL far *LevelList;
  1137. } PT_FAIWatchdogConfig, FAR * LPT_FAIWatchdogConfig;
  1138. typedef struct tagPT_FAIIntWatchdogStart
  1139. {
  1140. USHORT TrigSrc;
  1141. DWORD SampleRate;
  1142. USHORT far *buffer;
  1143. ULONG count;
  1144. USHORT cyclic;
  1145. USHORT IntrCount;
  1146. } PT_FAIIntWatchdogStart, FAR * LPT_FAIIntWatchdogStart;
  1147. typedef struct tagPT_FAIDmaWatchdogStart
  1148. {
  1149. USHORT TrigSrc;
  1150. DWORD SampleRate;
  1151. USHORT far *BufferA;
  1152. USHORT far *BufferB;
  1153. ULONG count;
  1154. } PT_FAIDmaWatchdogStart, FAR * LPT_FAIDmaWatchdogStart;
  1155. typedef struct tagPT_FAIWatchdogCheck
  1156. {
  1157. USHORT DataType;
  1158. USHORT far *ActiveBuf;
  1159. USHORT far *triggered;
  1160. USHORT far *TrigChan;
  1161. ULONG far *TrigIndex;
  1162. LPVOID TrigData;
  1163. } PT_FAIWatchdogCheck, FAR * LPT_FAIWatchdogCheck;
  1164. typedef struct tagPT_FAOIntStart
  1165. {
  1166. USHORT TrigSrc;
  1167. DWORD SampleRate;
  1168. USHORT chan;
  1169. LONG far *buffer;
  1170. ULONG count;
  1171. USHORT cyclic;
  1172. } PT_FAOIntStart, FAR * LPT_FAOIntStart;
  1173. typedef struct tagPT_FAODmaStart
  1174. {
  1175. USHORT TrigSrc;
  1176. DWORD SampleRate;
  1177. USHORT chan;
  1178. LONG far *buffer;
  1179. ULONG count;
  1180. } PT_FAODmaStart, FAR * LPT_FAODmaStart;
  1181. typedef struct tagPT_FAOScale
  1182. {
  1183. USHORT chan;
  1184. ULONG count;
  1185. FLOAT far *VoltArray;
  1186. USHORT far *BinArray;
  1187. } PT_FAOScale, FAR * LPT_FAOScale;
  1188. typedef struct tagPT_FAOLoad
  1189. {
  1190. USHORT ActiveBuf;
  1191. USHORT far *DataBuffer;
  1192. ULONG start;
  1193. ULONG count;
  1194. } PT_FAOLoad, FAR * LPT_FAOLoad;
  1195. typedef struct tagPT_FAOCheck
  1196. {
  1197. USHORT far *ActiveBuf;
  1198. USHORT far *stopped;
  1199. ULONG far *CurrentCount;
  1200. USHORT far *overrun;
  1201. USHORT far *HalfReady;
  1202. } PT_FAOCheck, FAR * LPT_FAOCheck;
  1203. typedef struct tagPT_EnableEvent
  1204. {
  1205. USHORT EventType;
  1206. USHORT Enabled;
  1207. USHORT Count;
  1208. } PT_EnableEvent, FAR * LPT_EnableEvent;
  1209. typedef struct tagPT_CheckEvent
  1210. {
  1211. USHORT far *EventType;
  1212. DWORD Milliseconds;
  1213. } PT_CheckEvent, FAR * LPT_CheckEvent;
  1214. typedef struct tagPT_EnableCANEvent
  1215. {
  1216. USHORT EventType;
  1217. USHORT Enabled;
  1218. CHAR APEventName[15];
  1219. } PT_EnableCANEvent, FAR * LPT_EnableCANEvent;
  1220. typedef struct tagPT_GetCANEventData
  1221. {
  1222. USHORT far *EventType;
  1223. USHORT far *PortNum;
  1224. USHORT far *MacID;
  1225. CHAR Data[8];
  1226. } PT_GetCANEventData, FAR * LPT_GetCANEventData;
  1227. typedef struct tagPT_AllocateDMABuffer
  1228. {
  1229. USHORT CyclicMode;
  1230. ULONG RequestBufSize;
  1231. ULONG far * ActualBufSize;
  1232. LONG far * buffer;
  1233. } PT_AllocateDMABuffer, FAR * LPT_AllocateDMABuffer;
  1234. typedef struct tagPT_TimerCountSetting
  1235. {
  1236. USHORT counter;
  1237. ULONG Count;
  1238. } PT_TimerCountSetting, FAR * LPT_TimerCountSetting;
  1239. typedef struct tagPT_DIFilter
  1240. {
  1241. USHORT usEventType;
  1242. USHORT usEventEnable;
  1243. USHORT usCount;
  1244. USHORT usEnable; // Filter enable data
  1245. USHORT far * usHiValue; // Filter value array pointer
  1246. USHORT far * usLowValue;
  1247. } PT_DIFilter, FAR * LPT_DIFilter;
  1248. typedef struct tagPT_DIPattern
  1249. {
  1250. USHORT usEventType;
  1251. USHORT usEventEnable;
  1252. USHORT usCount;
  1253. USHORT usEnable; // Pattern Match enable data
  1254. USHORT usValue; // Pattern Match pre_setting value;
  1255. } PT_DIPattern, FAR * LPT_DIPattern;
  1256. typedef struct tagPT_DICounter
  1257. {
  1258. USHORT usEventType;
  1259. USHORT usEventEnable;
  1260. USHORT usCount;
  1261. USHORT usEnable; // Counter enable data
  1262. USHORT usTrigEdge; // Counter Trigger edge 0: Rising edge 1:Falling edge
  1263. USHORT far * usPreset; // counter pre_setting value
  1264. USHORT usMatchEnable;// counter match enable data
  1265. USHORT far * usValue; // counter match value
  1266. USHORT usOverflow; // counter overflow data
  1267. USHORT usDirection; // up/down counter direction
  1268. } PT_DICounter, FAR * LPT_DICounter;
  1269. typedef struct tagPT_Status
  1270. {
  1271. USHORT usEventType;
  1272. USHORT usEventEnable;
  1273. USHORT usCount;
  1274. USHORT usEnable; // status change enable data
  1275. USHORT usRisingedge; // record Rising edge trigger type
  1276. USHORT usFallingedge;// record Falling edge trigger type
  1277. } PT_DIStatus, FAR * LPT_DIStatus;
  1278. typedef union tagPT_EnableEventEx
  1279. {
  1280. PT_DIFilter Filter;
  1281. PT_DIPattern Pattern;
  1282. PT_DICounter Counter;
  1283. PT_DIStatus Status;
  1284. } PT_EnableEventEx, FAR * LPT_EnableEventEx;
  1285. //typedef struct tagPT_EnableEventEx
  1286. //{
  1287. // USHORT usEventType;
  1288. // USHORT usEventEnable;
  1289. // USHORT usCount;
  1290. // PT_EventST EventST;
  1291. //
  1292. //} PT_EnableEventEx, FAR * LPT_EnableEventEx;
  1293. typedef struct tagPT_CounterPWMSetting
  1294. {
  1295. USHORT Port; //counter port
  1296. FLOAT Period; //ms
  1297. FLOAT HiPeriod; //UpCycle period ms
  1298. ULONG OutCount; //Stop count
  1299. USHORT GateMode;
  1300. } PT_CounterPWMSetting, FAR * LPT_CounterPWMSetting;
  1301. typedef struct tagPT_DioTimerSetting
  1302. {
  1303. USHORT Port;
  1304. USHORT TimeronEnable;
  1305. USHORT TimeroffEnable;
  1306. USHORT far * OnDuration; //Timer on duration
  1307. USHORT far * OffDuration; //Timer off duration
  1308. } PT_DioTimerSetting, FAR * LPT_DioTimerSetting;
  1309. typedef struct tagPT_FDITransfer
  1310. {
  1311. USHORT usEventType;
  1312. ULONG far * ulRetData;
  1313. } PT_FDITransfer, FAR * LPT_FDITransfer;
  1314. typedef struct tagPT_AOCurrentOut
  1315. {
  1316. USHORT chan;
  1317. FLOAT OutputValue;
  1318. } PT_AOCurrentOut, FAR * LPT_AOCurrentOut;
  1319. typedef struct tagPT_ADAMCounterSetHWConfig
  1320. {
  1321. USHORT usCounterMode;
  1322. USHORT usDataFormat; // Only for adam5080
  1323. USHORT usGateTime; // Only for adam4080,4080D
  1324. } PT_ADAMCounterSetHWConfig, FAR * LPT_ADAMCounterSetHWConfig;
  1325. typedef struct tagPT_ADAMCounterGetHWConfig
  1326. {
  1327. USHORT far *usCounterMode;
  1328. USHORT far *usDataFormat; // Only for adam5080
  1329. USHORT far *usGateTime; // Only for adam4080,4080D
  1330. } PT_ADAMCounterGetHWConfig, FAR * LPT_ADAMCounterGetHWConfig;
  1331. typedef struct tagPT_ADAMAISetHWConfig
  1332. {
  1333. USHORT usInputRange;
  1334. USHORT usDataFormat;
  1335. USHORT usIntegrationTime;
  1336. } PT_ADAMAISetHWConfig, FAR * LPT_ADAMAISetHWConfig;
  1337. typedef struct tagPT_ADAMAIGetHWConfig
  1338. {
  1339. USHORT far *usInputRange;
  1340. USHORT far *usDataFormat;
  1341. USHORT far *usIntegrationTime;
  1342. } PT_ADAMAIGetHWConfig, FAR * LPT_ADAMAIGetHWConfig;
  1343. typedef struct tagPT_ADAMAOSetHWConfig
  1344. {
  1345. USHORT usChan;
  1346. USHORT usOutputRange;
  1347. USHORT usDataFormat;
  1348. USHORT usSlewRate;
  1349. } PT_ADAMAOSetHWConfig, FAR * LPT_ADAMAOSetHWConfig;
  1350. typedef struct tagPT_ADAMAOGetHWConfig
  1351. {
  1352. USHORT usChan;
  1353. USHORT far *usOutputRange;
  1354. USHORT far *usDataFormat;
  1355. USHORT far *usSlewRate;
  1356. } PT_ADAMAOGetHWConfig, FAR * LPT_ADAMAOGetHWConfig;
  1357. typedef struct tagPT_PWMStartRead
  1358. {
  1359. USHORT usChan;
  1360. FLOAT far *flHiperiod;
  1361. FLOAT far *flLowperiod;
  1362. }PT_PWMStartRead, FAR * LPT_PWMStartRead;
  1363. typedef struct tagPT_FAIDmaExStart
  1364. {
  1365. USHORT TrigSrc; //Trigger source : internal,external
  1366. USHORT TrigMode; //Trigger Mode : Pacer, Post, Delay, About
  1367. USHORT ClockSrc; //Clock source : internel, external
  1368. USHORT TrigEdge; //Trigger Edge : Rise 0 Fall 1
  1369. USHORT SRCType; //Source type : Digtal 0, Analog
  1370. FLOAT TrigVol; //Analog Trigger type Trigger voltage
  1371. USHORT CyclicMode; //Cyclic, noncyclic
  1372. USHORT NumChans; //Scan number of channel
  1373. USHORT StartChan; //Start channel
  1374. ULONG ulDelayCnt; //Delay count
  1375. ULONG count; //Number of sample
  1376. ULONG SampleRate; //Sampling rate
  1377. USHORT *GainList; //Gain code list
  1378. USHORT *CondList; //Trigger condition
  1379. TRIGLEVEL *LevelList; //Trigger level
  1380. USHORT *buffer0; //Buffer pointer
  1381. USHORT *buffer1; //Buffer pointer
  1382. USHORT *Pt1; //Reserve parameter
  1383. USHORT *Pt2; //Reserve Parameter
  1384. USHORT *Pt3; //Reserve Parameter
  1385. }PT_FAIDmaExStart, *LPT_FAIDmaExStart;
  1386. typedef struct tagPT_FAOWaveFormStart
  1387. {
  1388. USHORT TrigSrc;
  1389. DWORD SampleRate;
  1390. ULONG WaveCount;
  1391. ULONG Count;
  1392. USHORT far * Buffer;
  1393. USHORT EnabledChannel;
  1394. } PT_FAOWaveFormStart, FAR * LPT_FAOWaveFormStart;
  1395. /**************************************************************************
  1396. Function Declaration
  1397. ***************************************************************************/
  1398. #if !defined(_WIN31)
  1399. #define FEXPORT __declspec (dllexport)
  1400. #define FTYPE CALLBACK
  1401. #else
  1402. #define FEXPORT extern
  1403. #define FTYPE FAR PASCAL
  1404. #endif
  1405. /**************************************************************************
  1406. Function Declaration
  1407. ***************************************************************************/
  1408. FEXPORT LRESULT FTYPE DeviceConfig(ULONG DeviceNum,DWORD BoardID,HWND owner);
  1409. FEXPORT LRESULT FTYPE DeviceOpen(ULONG DeviceNum, LONG far * DeviceHandle);
  1410. FEXPORT LRESULT FTYPE DeviceClose(LONG far * DeviceHandle);
  1411. FEXPORT LRESULT FTYPE DeviceGetFeatures(LONG DeviceHandle,
  1412. DEVFEATURES far * buffer, USHORT size);
  1413. FEXPORT LRESULT FTYPE AIConfig(LONG DeviceHandle,USHORT DasChan,
  1414. USHORT DasGain);
  1415. FEXPORT LRESULT FTYPE AIGetConfig(LONG DeviceHandle,LPDEVCONFIG_AI buffer,
  1416. USHORT size);
  1417. FEXPORT LRESULT FTYPE AIBinaryIn(LONG DeviceHandle,USHORT chan,
  1418. USHORT TrigMode,USHORT far * reading);
  1419. FEXPORT LRESULT FTYPE AIScale(USHORT reading,FLOAT MaxVolt,USHORT MaxCount,
  1420. USHORT offset,FLOAT far * voltage);
  1421. FEXPORT LRESULT FTYPE AIVoltageIn(LONG DeviceHandle,USHORT chan,
  1422. USHORT gain,USHORT TrigMode,FLOAT far * voltage);
  1423. FEXPORT LRESULT FTYPE AIVoltageInExp(LONG DeviceHandle,USHORT DasChan,
  1424. USHORT DasGain,USHORT ExpChan,FLOAT far * voltage);
  1425. FEXPORT LRESULT FTYPE MAIConfig(LONG DeviceHandle,USHORT NumChan,
  1426. USHORT StartChan,USHORT far * GainArray);
  1427. FEXPORT LRESULT FTYPE MAIBinaryIn(LONG DeviceHandle,USHORT NumChan,
  1428. USHORT StartChan,USHORT TrigMode,USHORT far * ReadingArray);
  1429. FEXPORT LRESULT FTYPE MAIVoltageIn(LONG DeviceHandle,USHORT NumChan,
  1430. USHORT StartChan,USHORT far * GainArray,
  1431. USHORT TrigMode,FLOAT far * VoltageArray);
  1432. FEXPORT LRESULT FTYPE MAIVoltageInExp(LONG DeviceHandle,USHORT NumChan,
  1433. USHORT far * DasChanArray,USHORT far * DasGainArray,
  1434. USHORT far * ExpChanArray,FLOAT far * VoltageArray);
  1435. FEXPORT LRESULT FTYPE TCMuxRead(LONG DeviceHandle,USHORT DasChan,
  1436. USHORT DasGain,USHORT ExpChan,USHORT TCType,
  1437. USHORT TempScale,FLOAT far * temp);
  1438. FEXPORT LRESULT FTYPE AOConfig(LONG DeviceHandle,USHORT chan,USHORT RefSrc,
  1439. FLOAT MaxValue,FLOAT MinValue);
  1440. FEXPORT LRESULT FTYPE AOBinaryOut(LONG DeviceHandle,USHORT chan,USHORT BinData);
  1441. FEXPORT LRESULT FTYPE AOVoltageOut(LONG DeviceHandle,USHORT chan,FLOAT OutputValue);
  1442. FEXPORT LRESULT FTYPE AOScale(LONG DeviceHandle,USHORT chan,FLOAT OutputValue,
  1443. USHORT far * BinData);
  1444. FEXPORT LRESULT FTYPE DioSetPortMode(LONG DeviceHandle,USHORT port,
  1445. USHORT dir);
  1446. FEXPORT LRESULT FTYPE DioGetConfig(LONG DeviceHandle,SHORT far * PortArray,
  1447. USHORT NumOfPorts);
  1448. FEXPORT LRESULT FTYPE DioReadPortByte(LONG DeviceHandle,USHORT port,
  1449. USHORT far * value);
  1450. FEXPORT LRESULT FTYPE DioWritePortByte(LONG DeviceHandle,USHORT port,
  1451. USHORT mask,USHORT state);
  1452. FEXPORT LRESULT FTYPE DioReadBit(LONG DeviceHandle,USHORT port,USHORT bit,
  1453. USHORT far * state);
  1454. FEXPORT LRESULT FTYPE DioWriteBit(LONG DeviceHandle,USHORT port,USHORT bit,
  1455. USHORT state);
  1456. FEXPORT LRESULT FTYPE DioGetCurrentDOByte(LONG DeviceHandle,USHORT port,
  1457. USHORT far * value);
  1458. FEXPORT LRESULT FTYPE DioGetCurrentDOBit(LONG DeviceHandle,USHORT port,
  1459. USHORT bit,USHORT far * state);
  1460. FEXPORT LRESULT FTYPE WritePortByte(LONG DeviceHandle,USHORT port,
  1461. USHORT ByteData);
  1462. FEXPORT LRESULT FTYPE WritePortWord(LONG DeviceHandle,USHORT port,
  1463. USHORT WordData);
  1464. FEXPORT LRESULT FTYPE ReadPortByte(LONG DeviceHandle,USHORT port,
  1465. USHORT far * ByteData);
  1466. FEXPORT LRESULT FTYPE ReadPortWord(LONG DeviceHandle,USHORT port,
  1467. USHORT far * WordData);
  1468. FEXPORT LRESULT FTYPE CounterEventStart(LONG DeviceHandle,USHORT counter,
  1469. USHORT GateMode);
  1470. FEXPORT LRESULT FTYPE CounterEventRead(LONG DeviceHandle,USHORT counter,
  1471. USHORT far * overflow,ULONG far * count);
  1472. FEXPORT LRESULT FTYPE CounterFreqStart(LONG DeviceHandle,USHORT counter,
  1473. USHORT GatePeriod,USHORT GateMode);
  1474. FEXPORT LRESULT FTYPE CounterFreqRead(LONG DeviceHandle,USHORT counter,
  1475. FLOAT far * freq);
  1476. FEXPORT LRESULT FTYPE CounterPulseStart(LONG DeviceHandle,USHORT counter,
  1477. FLOAT period,FLOAT UpCycle,USHORT GateMode);
  1478. FEXPORT LRESULT FTYPE CounterReset(LONG DeviceHandle,USHORT counter);
  1479. FEXPORT LRESULT FTYPE QCounterConfig(LONG DeviceHandle,USHORT counter,
  1480. USHORT LatchSrc,USHORT LatchOverflow,USHORT ResetOnLatch,
  1481. USHORT ResetValue);
  1482. FEXPORT LRESULT FTYPE QCounterConfigSys(LONG DeviceHandle,USHORT SysClock,
  1483. USHORT TimeBase, USHORT TimeDivider,USHORT CascadeMode);
  1484. FEXPORT LRESULT FTYPE QCounterStart(LONG DeviceHandle,USHORT counter,
  1485. USHORT InputMode);
  1486. FEXPORT LRESULT FTYPE QCounterRead(LONG DeviceHandle,USHORT counter,
  1487. USHORT far * overflow,ULONG far * LoCount,
  1488. ULONG far * HiCount);
  1489. FEXPORT LRESULT FTYPE AlarmConfig(LONG DeviceHandle,USHORT chan,
  1490. FLOAT LoLimit,FLOAT HiLimit);
  1491. FEXPORT LRESULT FTYPE AlarmEnable(LONG DeviceHandle,USHORT chan,
  1492. USHORT LatchMode,USHORT enabled);
  1493. FEXPORT LRESULT FTYPE AlarmCheck(LONG DeviceHandle,USHORT chan,
  1494. USHORT far * LoState,USHORT far * HiState);
  1495. FEXPORT LRESULT FTYPE AlarmReset(LONG DeviceHandle,USHORT chan);
  1496. FEXPORT LRESULT FTYPE COMOpen(USHORT PortNum, LONG far * ComHandle,
  1497. LONG far * DeviceHandle);
  1498. FEXPORT LRESULT FTYPE COMClose(LONG far * DeviceHandle);
  1499. FEXPORT LRESULT FTYPE COMGetConfig(ULONG DeviceNum, LPDEVCONFIG_COM buffer);
  1500. FEXPORT LRESULT FTYPE COMSetConfig(LONG DeviceHandle, LPDEVCONFIG_COM buffer);
  1501. FEXPORT LRESULT FTYPE COMRead(LONG DeviceHandle, LPSTR buffer,
  1502. USHORT BufferSize, USHORT TimeOut, CHAR FinalChar,
  1503. USHORT far * ReadCount);
  1504. FEXPORT LRESULT FTYPE COMReadEx(LONG DeviceHandle, LPSTR buffer,
  1505. USHORT BufferSize, USHORT TimeOut, CHAR FinalChar,
  1506. USHORT far * ReadCount);
  1507. FEXPORT LRESULT FTYPE COMWrite(LONG DeviceHandle,LPSTR buffer,
  1508. USHORT DataLength);
  1509. FEXPORT LRESULT FTYPE COMWrite232(LONG DeviceHandle,LPSTR buffer,
  1510. USHORT DataLength);
  1511. FEXPORT LRESULT FTYPE COMWrite485(LONG DeviceHandle,LPSTR buffer,
  1512. USHORT DataLength);
  1513. FEXPORT LRESULT FTYPE COMWrite85(LONG DeviceHandle,LPSTR buffer,
  1514. USHORT DataLength);
  1515. // Add by Mely_Shi(2001-8-1)
  1516. FEXPORT LRESULT FTYPE COMClear(LONG DeviceHandle);
  1517. FEXPORT LRESULT FTYPE COMEscape(LONG DeviceHandle, USHORT escape);
  1518. FEXPORT LRESULT FTYPE WDTEnable(LONG DeviceHandle,USHORT message,
  1519. HWND Destination);
  1520. FEXPORT LRESULT FTYPE WDTRefresh(LONG DeviceHandle);
  1521. FEXPORT LRESULT FTYPE WDTReset(LONG DeviceHandle);
  1522. FEXPORT LRESULT FTYPE TimerCountSetting(LONG DeviceHandle,USHORT counter,
  1523. ULONG Count);
  1524. FEXPORT LRESULT FTYPE CounterPWMSetting(LONG DeviceHandle,USHORT counter,
  1525. FLOAT period,FLOAT UpCycle,ULONG OutCount,USHORT GateMode);
  1526. FEXPORT LRESULT FTYPE CounterPWMEnable(LONG DeviceHandle,USHORT Port);
  1527. FEXPORT LRESULT FTYPE DioTimerSetting(LONG DeviceHandle,USHORT Port,USHORT TimeronEnable,
  1528. USHORT TimeroffEnable,USHORT far * OnDuration,
  1529. USHORT far * OffDuration);
  1530. FEXPORT LRESULT FTYPE DICounterReset(LONG DeviceHandle,USHORT counter);
  1531. FEXPORT LRESULT FTYPE EnableSyncAO(LONG DeviceHandle,USHORT Enable);
  1532. FEXPORT LRESULT FTYPE WriteSyncAO(LONG DeviceHandle);
  1533. FEXPORT LRESULT FTYPE AOCurrentOut(LONG DeviceHandle,USHORT chan,FLOAT OutputValue);
  1534. FEXPORT LRESULT FTYPE GetFIFOSize(LONG DeviceHandle,LONG far * lSize);
  1535. FEXPORT LRESULT FTYPE PWMStartRead(LONG DeviceHandle, USHORT usChan, FLOAT far *flHiperiod, FLOAT far *flLowperiod);
  1536. // Only for ADAM
  1537. FEXPORT LRESULT FTYPE AISetHWConfig(LONG DeviceHandle,USHORT InputRange, USHORT DataFormat, USHORT IntegrationTime);
  1538. FEXPORT LRESULT FTYPE AIGetHWConfig(LONG DeviceHandle,USHORT far * InputRange, USHORT far * DataFormat, USHORT far * IntegrationTime);
  1539. FEXPORT LRESULT FTYPE AOSetHWConfig(LONG DeviceHandle,USHORT Chan, USHORT OutputRange, USHORT DataFormat, USHORT SlewRate);
  1540. FEXPORT LRESULT FTYPE AOGetHWConfig(LONG DeviceHandle,USHORT Chan, USHORT far * OutputRange, USHORT far * DataFormat, USHORT far * SlewRate);
  1541. FEXPORT LRESULT FTYPE CounterSetHWConfig(LONG DeviceHandle,USHORT CounterMode, USHORT DataFormat,USHORT GateMode);
  1542. FEXPORT LRESULT FTYPE CounterGetHWConfig(LONG DeviceHandle,USHORT far * CounterMode, USHORT far * DataFormat,USHORT far * GateMode);
  1543. // High speed function declaration
  1544. FEXPORT LRESULT FTYPE FAIIntStart(LONG DeviceHandle,USHORT TrigSrc,
  1545. DWORD SampleRate,USHORT chan,USHORT gain,
  1546. USHORT far * buffer, ULONG count,
  1547. USHORT cyclic, USHORT IntrCount);
  1548. FEXPORT LRESULT FTYPE FAIIntScanStart(LONG DeviceHandle,USHORT TrigSrc,
  1549. DWORD SampleRate,USHORT NumChans,
  1550. USHORT StartChan,USHORT far * GainList,
  1551. USHORT far * buffer,ULONG count,USHORT cyclic,
  1552. USHORT IntrCount);
  1553. FEXPORT LRESULT FTYPE FAIDmaStart(LONG DeviceHandle,USHORT TrigSrc,
  1554. DWORD SampleRate,USHORT chan,USHORT gain,
  1555. USHORT far * buffer, ULONG count);
  1556. FEXPORT LRESULT FTYPE FAIDmaScanStart(LONG DeviceHandle,USHORT TrigSrc,
  1557. DWORD SampleRate,USHORT NumChans,
  1558. USHORT StartChan,USHORT far * GainList,
  1559. USHORT far * buffer,ULONG count);
  1560. FEXPORT LRESULT FTYPE FAIDualDmaStart(LONG DeviceHandle,USHORT TrigSrc,
  1561. DWORD SampleRate,USHORT chan,USHORT gain,
  1562. USHORT far * BufferA, USHORT far * BufferB,
  1563. ULONG count);
  1564. FEXPORT LRESULT FTYPE FAIDualDmaScanStart(LONG DeviceHandle,USHORT TrigSrc,
  1565. DWORD SampleRate,USHORT NumChans,
  1566. USHORT StartChan,USHORT far * GainList,
  1567. USHORT far * BufferA, USHORT far * BufferB,
  1568. ULONG count);
  1569. FEXPORT LRESULT FTYPE FAITransfer(LONG DeviceHandle,USHORT ActiveBuf,
  1570. LPVOID DataBuffer,USHORT DataType,ULONG start,
  1571. ULONG count,USHORT far *overrun);
  1572. FEXPORT LRESULT FTYPE FAICheck(LONG DeviceHandle,USHORT far * ActiveBuf,
  1573. USHORT far * stopped,ULONG far * retrieved,
  1574. USHORT far * overrun,USHORT far * HalfReady);
  1575. FEXPORT LRESULT FTYPE FAIWatchdogConfig(LONG DeviceHandle,USHORT TrigMode,
  1576. USHORT NumChans,USHORT StartChan,USHORT far * GainList,
  1577. USHORT far * CondList, TRIGLEVEL far * LevelList);
  1578. FEXPORT LRESULT FTYPE FAIIntWatchdogStart(LONG DeviceHandle, USHORT TrigSrc,
  1579. DWORD SampleRate,USHORT far * buffer,
  1580. ULONG count, USHORT cyclic, USHORT IntrCount);
  1581. FEXPORT LRESULT FTYPE FAIDmaWatchdogStart(LONG DeviceHandle,USHORT TrigSrc,
  1582. DWORD SampleRate,USHORT far * BufferA,
  1583. USHORT far * BufferB,ULONG count);
  1584. FEXPORT LRESULT FTYPE FAIWatchdogCheck(LONG DeviceHandle,USHORT DataType,
  1585. USHORT far * ActiveBuf,USHORT far * triggered,
  1586. USHORT far * TrigChan,ULONG far * TrigIndex,
  1587. LPVOID TrigData);
  1588. FEXPORT LRESULT FTYPE FAIStop(LONG DeviceHandle);
  1589. FEXPORT LRESULT FTYPE FAOIntStart(LONG DeviceHandle,USHORT TrigSrc,
  1590. DWORD SampleRate,USHORT chan,LONG far * buffer,
  1591. ULONG count, USHORT cyclic);
  1592. FEXPORT LRESULT FTYPE FAODmaStart(LONG DeviceHandle,USHORT TrigSrc,
  1593. DWORD SampleRate,USHORT chan,LONG far * buffer,
  1594. ULONG count);
  1595. FEXPORT LRESULT FTYPE FAOScale(LONG DeviceHandle,USHORT chan,
  1596. ULONG count,FLOAT far * VoltArray,
  1597. USHORT far * BinArray);
  1598. FEXPORT LRESULT FTYPE FAOLoad(LONG DeviceHandle,USHORT ActiveBuf,
  1599. LONG far * DataBuffer,ULONG start,ULONG count);
  1600. FEXPORT LRESULT FTYPE FAOCheck(LONG DeviceHandle,USHORT far * ActiveBuf,
  1601. USHORT far * stopped,ULONG far * CurrentCount,
  1602. USHORT far * overrun,USHORT far * HalfReady);
  1603. FEXPORT LRESULT FTYPE FAOStop(LONG DeviceHandle);
  1604. FEXPORT LRESULT FTYPE ClearOverrun(LONG DeviceHandle);
  1605. FEXPORT LRESULT FTYPE EnableEvent(LONG DeviceHandle, USHORT EventType,
  1606. USHORT Enabled, USHORT Count);
  1607. FEXPORT LRESULT FTYPE CheckEvent(LONG DeviceHandle,USHORT far *EventType,
  1608. DWORD Milliseconds);
  1609. FEXPORT LRESULT FTYPE EnableCANEvent(LONG DeviceHandle,USHORT usEventType,
  1610. USHORT usEnabled,CHAR far *EventName);
  1611. FEXPORT LRESULT FTYPE GetCANEventData(USHORT FAR * Port,USHORT FAR * MacID,
  1612. USHORT FAR * Type,CHAR FAR * Data);
  1613. FEXPORT LRESULT FTYPE AllocateDMABuffer(LONG DeviceHandle, USHORT CyclicMode,
  1614. ULONG RequestBufSize, ULONG far * ActualBufSize,
  1615. LONG far * buffer);
  1616. FEXPORT LRESULT FTYPE FreeDMABuffer(LONG DeviceHandle,LONG far * buffer);
  1617. FEXPORT LRESULT FTYPE EnableEventEx(LONG DeviceHandle, LPT_EnableEventEx lpEnableEventEx);
  1618. FEXPORT LRESULT FTYPE FDITransfer(LONG DeviceHandle,USHORT usEventType, ULONG far * ulRetData);
  1619. FEXPORT LRESULT FTYPE FAIDmaExStart(LONG DeviceHandle, USHORT TrigSrc, USHORT TrigMode, USHORT ClockSrc, USHORT TrigEdge,
  1620. USHORT SRCType, FLOAT TrigVol, USHORT CyclicMode, USHORT NumChans, USHORT StartChan, ULONG ulDelayCnt,
  1621. ULONG count, DWORD SampleRate, USHORT *GainList, USHORT *CondList, USHORT *LevelList, USHORT *buffer0,
  1622. USHORT *buffer1, USHORT *Pt1, USHORT *Pt2, USHORT *Pt3);
  1623. FEXPORT LRESULT FTYPE FAOWaveFormStart(LONG DeviceHandle,USHORT TrigSrc,
  1624. DWORD SampleRate,ULONG WaveCount, ULONG count,
  1625. USHORT far * Buffer,USHORT usEnabledChannel);
  1626. // CAN bus function declaration
  1627. FEXPORT LRESULT FTYPE CANPortOpen(WORD DevNum, WORD *wPort,
  1628. WORD *wHostID, WORD *wBaudRate);
  1629. FEXPORT LRESULT FTYPE CANPortClose(WORD wPort);
  1630. FEXPORT LRESULT FTYPE CANInit(WORD Port,WORD BTR0,WORD BTR1,UCHAR usMask);
  1631. FEXPORT LRESULT FTYPE CANReset(WORD Port);
  1632. FEXPORT LRESULT FTYPE CANInpb(WORD Port,WORD Offset,UCHAR FAR *Data);
  1633. FEXPORT LRESULT FTYPE CANOutpb(WORD Port,WORD Offset,UCHAR Value);
  1634. FEXPORT LRESULT FTYPE CANSetBaud(WORD Port,WORD BTR0,WORD BTR1);
  1635. FEXPORT LRESULT FTYPE CANGetBaudRate(WORD Port,WORD *wBaudRate);
  1636. FEXPORT LRESULT FTYPE CANSetAcp(WORD Port,WORD Acp,WORD Mask);
  1637. FEXPORT LRESULT FTYPE CANSetOutCtrl(WORD Port,WORD OutCtrl);
  1638. FEXPORT LRESULT FTYPE CANSetNormal(WORD Port);
  1639. FEXPORT LRESULT FTYPE CANHwReset(WORD Port);
  1640. FEXPORT LRESULT FTYPE CANSendMsg(WORD Port,UCHAR FAR *TxBuf,BOOL Wait);
  1641. FEXPORT LRESULT FTYPE CANQueryMsg(WORD Port,BOOL FAR *Ready,
  1642. UCHAR FAR *RcvBuf);
  1643. FEXPORT LRESULT FTYPE CANWaitForMsg(WORD Port,UCHAR FAR *RcvBuf,
  1644. ULONG uTimeValue);
  1645. FEXPORT LRESULT FTYPE CANQueryID(WORD Port,BOOL FAR *Ready,
  1646. UCHAR FAR *IDBuf);
  1647. FEXPORT LRESULT FTYPE CANWaitForID(WORD Port,UCHAR FAR *IDBuf,
  1648. ULONG uTimeValue);
  1649. FEXPORT LRESULT FTYPE CANEnableMessaging(WORD Port,WORD Type,
  1650. BOOL Enabled,HWND AppWnd,UCHAR FAR *RcvBuf);
  1651. FEXPORT LRESULT FTYPE CANGetEventName(WORD Port,CHAR *RcvBuf);
  1652. FEXPORT LRESULT FTYPE CANEnableEvent(USHORT Port, BOOL Enabled);
  1653. FEXPORT LRESULT FTYPE CANCheckEvent(USHORT Port, DWORD Milliseconds);
  1654. FEXPORT LRESULT FTYPE CANPortOpenX(WORD wPort, DWORD dwMemoryAddress, ULONG IRQ);
  1655. // Function Declaration for PCL-839
  1656. FEXPORT int FTYPE set_base(int address);
  1657. FEXPORT int FTYPE set_mode(int chan, int mode);
  1658. FEXPORT int FTYPE set_speed(int chan, int low_speed, int high_speed, int accelerate);
  1659. FEXPORT int FTYPE status(int chan);
  1660. FEXPORT int FTYPE m_stop(int chan);
  1661. FEXPORT int FTYPE slowdown(int chan);
  1662. FEXPORT int FTYPE sldn_stop(int chan);
  1663. FEXPORT int FTYPE waitrdy(int chan);
  1664. FEXPORT int FTYPE chkbusy(void);
  1665. FEXPORT int FTYPE out_port(int port_no, int value);
  1666. FEXPORT int FTYPE in_port(int port_no);
  1667. FEXPORT int FTYPE In_byte(int offset);
  1668. FEXPORT int FTYPE Out_byte(int offset , int value);
  1669. FEXPORT int FTYPE org(int chan, int dir1, int speed1, int dir2, int speed2 , int dir3, int speed3);
  1670. FEXPORT int FTYPE cmove(int chan, int dir1, int speed1, int dir2, int speed2, int dir3, int speed3);
  1671. FEXPORT int FTYPE pmove(int ch, int dir1, int speed1, long step1, int dir2, int speed2, long step2,
  1672. int dir3, int speed3, long step3);
  1673. /**************************************************************************
  1674. Function Declaration for ADSAPI32
  1675. ***************************************************************************/
  1676. FEXPORT LRESULT FTYPE DRV_DeviceGetNumOfList(SHORT far *NumOfDevices);
  1677. FEXPORT LRESULT FTYPE DRV_DeviceGetList(DEVLIST far *DeviceList,
  1678. SHORT MaxEntries, SHORT far *OutEntries);
  1679. FEXPORT LRESULT FTYPE DRV_DeviceGetSubList(DWORD DeviceNum,
  1680. DEVLIST far *SubDevList, SHORT MaxEntries,
  1681. SHORT far *OutEntries);
  1682. FEXPORT LRESULT FTYPE DRV_SelectDevice(HWND hCaller, BOOL GetModule,
  1683. ULONG *DeviceNum, UCHAR *Description);
  1684. FEXPORT LRESULT FTYPE DRV_DeviceOpen(ULONG DeviceNum, LONG far * DriverHandle);
  1685. FEXPORT LRESULT FTYPE DRV_DeviceClose(LONG far * DriverHandle);
  1686. FEXPORT LRESULT FTYPE DRV_DeviceGetFeatures(LONG DriverHandle,
  1687. LPT_DeviceGetFeatures lpDevFeatures);
  1688. FEXPORT LRESULT FTYPE DRV_BoardTypeMapBoardName(DWORD BoardID, LPSTR ExpName);
  1689. FEXPORT VOID FTYPE DRV_GetErrorMessage(LRESULT lError,LPSTR lpszErrMsg);
  1690. FEXPORT LRESULT FTYPE DRV_AIConfig(LONG DriverHandle,
  1691. LPT_AIConfig lpAIConfig);
  1692. FEXPORT LRESULT FTYPE DRV_AIGetConfig(LONG DriverHandle,
  1693. LPT_AIGetConfig lpAIGetConfig);
  1694. FEXPORT LRESULT FTYPE DRV_AIBinaryIn(LONG DriverHandle,
  1695. LPT_AIBinaryIn lpAIBinaryIn);
  1696. FEXPORT LRESULT FTYPE DRV_AIScale(LONG DriverHandle,
  1697. LPT_AIScale lpAIScale);
  1698. FEXPORT LRESULT FTYPE DRV_AIVoltageIn(LONG DriverHandle,
  1699. LPT_AIVoltageIn lpAIVoltageIn);
  1700. FEXPORT LRESULT FTYPE DRV_AIVoltageInExp(LONG DriverHandle,
  1701. LPT_AIVoltageInExp lpAIVoltageInExp);
  1702. FEXPORT LRESULT FTYPE DRV_MAIConfig(LONG DriverHandle,
  1703. LPT_MAIConfig lpMAIConfig);
  1704. FEXPORT LRESULT FTYPE DRV_MAIBinaryIn(LONG DriverHandle,
  1705. LPT_MAIBinaryIn lpMAIBinaryIn);
  1706. FEXPORT LRESULT FTYPE DRV_MAIVoltageIn(LONG DriverHandle,
  1707. LPT_MAIVoltageIn lpMAIVoltageIn);
  1708. FEXPORT LRESULT FTYPE DRV_MAIVoltageInExp(LONG DriverHandle,
  1709. LPT_MAIVoltageInExp lpMAIVoltageInExp);
  1710. FEXPORT LRESULT FTYPE DRV_TCMuxRead(LONG DriverHandle,
  1711. LPT_TCMuxRead lpTCMuxRead);
  1712. FEXPORT LRESULT FTYPE DRV_AOConfig(LONG DriverHandle,
  1713. LPT_AOConfig lpAOConfig);
  1714. FEXPORT LRESULT FTYPE DRV_AOBinaryOut(LONG DriverHandle,
  1715. LPT_AOBinaryOut lpAOBinaryOut);
  1716. FEXPORT LRESULT FTYPE DRV_AOVoltageOut(LONG DriverHandle,
  1717. LPT_AOVoltageOut lpAOVoltageOut);
  1718. FEXPORT LRESULT FTYPE DRV_AOScale(LONG DriverHandle,
  1719. LPT_AOScale lpAOScale);
  1720. FEXPORT LRESULT FTYPE DRV_DioSetPortMode(LONG DriverHandle,
  1721. LPT_DioSetPortMode lpDioSetPortMode);
  1722. FEXPORT LRESULT FTYPE DRV_DioGetConfig(LONG DriverHandle,
  1723. LPT_DioGetConfig lpDioGetConfig);
  1724. FEXPORT LRESULT FTYPE DRV_DioReadPortByte(LONG DriverHandle,
  1725. LPT_DioReadPortByte lpDioReadPortByte);
  1726. FEXPORT LRESULT FTYPE DRV_DioWritePortByte(LONG DriverHandle,
  1727. LPT_DioWritePortByte lpDioWritePortByte);
  1728. FEXPORT LRESULT FTYPE DRV_DioReadBit(LONG DriverHandle,
  1729. LPT_DioReadBit lpDioReadBit);
  1730. FEXPORT LRESULT FTYPE DRV_DioWriteBit(LONG DriverHandle,
  1731. LPT_DioWriteBit lpDioWriteBit);
  1732. FEXPORT LRESULT FTYPE DRV_DioGetCurrentDOByte(LONG DriverHandle,
  1733. LPT_DioGetCurrentDOByte lpDioGetCurrentDOByte);
  1734. FEXPORT LRESULT FTYPE DRV_DioGetCurrentDOBit(LONG DriverHandle,
  1735. LPT_DioGetCurrentDOBit lpDioGetCurrentDOBit);
  1736. FEXPORT LRESULT FTYPE DRV_WritePortByte(LONG DriverHandle,
  1737. LPT_WritePortByte lpWritePortByte);
  1738. FEXPORT LRESULT FTYPE DRV_WritePortWord(LONG DriverHandle,
  1739. LPT_WritePortWord lpWritePortWord);
  1740. FEXPORT LRESULT FTYPE DRV_ReadPortByte(LONG DriverHandle,
  1741. LPT_ReadPortByte lpReadPortByte);
  1742. FEXPORT LRESULT FTYPE DRV_ReadPortWord(LONG DriverHandle,
  1743. LPT_ReadPortWord lpReadPortWord);
  1744. FEXPORT LRESULT FTYPE DRV_CounterEventStart(LONG DriverHandle,
  1745. LPT_CounterEventStart lpCounterEventStart);
  1746. FEXPORT LRESULT FTYPE DRV_CounterEventRead(LONG DriverHandle,
  1747. LPT_CounterEventRead lpCounterEventRead);
  1748. FEXPORT LRESULT FTYPE DRV_CounterFreqStart(LONG DriverHandle,
  1749. LPT_CounterFreqStart lpCounterFreqStart);
  1750. FEXPORT LRESULT FTYPE DRV_CounterFreqRead(LONG DriverHandle,
  1751. LPT_CounterFreqRead lpCounterFreqRead);
  1752. FEXPORT LRESULT FTYPE DRV_CounterPulseStart(LONG DriverHandle,
  1753. LPT_CounterPulseStart lpCounterPulseStart);
  1754. FEXPORT LRESULT FTYPE DRV_CounterReset(LONG DriverHandle,
  1755. LPARAM counter);
  1756. FEXPORT LRESULT FTYPE DRV_QCounterConfig(LONG DriverHandle,
  1757. LPT_QCounterConfig lpQCounterConfig);
  1758. FEXPORT LRESULT FTYPE DRV_QCounterConfigSys(LONG DriverHandle,
  1759. LPT_QCounterConfigSys lpQCounterConfigSys);
  1760. FEXPORT LRESULT FTYPE DRV_QCounterStart(LONG DriverHandle,
  1761. LPT_QCounterStart lpQCounterStart);
  1762. FEXPORT LRESULT FTYPE DRV_QCounterRead(LONG DriverHandle,
  1763. LPT_QCounterRead lpQCounterRead);
  1764. FEXPORT LRESULT FTYPE DRV_AlarmConfig(LONG DriverHandle,
  1765. LPT_AlarmConfig lpAlarmConfig);
  1766. FEXPORT LRESULT FTYPE DRV_AlarmEnable(LONG DriverHandle,
  1767. LPT_AlarmEnable lpAlarmEnable);
  1768. FEXPORT LRESULT FTYPE DRV_AlarmCheck(LONG DriverHandle,
  1769. LPT_AlarmCheck lpAlarmCheck);
  1770. FEXPORT LRESULT FTYPE DRV_AlarmReset(LONG DriverHandle,
  1771. LPARAM chan);
  1772. FEXPORT LRESULT FTYPE DRV_WDTEnable(LONG DriverHandle,
  1773. LPT_WDTEnable lpWDTEnable);
  1774. FEXPORT LRESULT FTYPE DRV_WDTRefresh(LONG DriverHandle);
  1775. FEXPORT LRESULT FTYPE DRV_WDTReset(LONG DriverHandle);
  1776. FEXPORT LRESULT FTYPE DRV_TimerCountSetting(LONG DriverHandle,
  1777. LPT_TimerCountSetting lpTimerCountSetting);
  1778. FEXPORT LRESULT FTYPE DRV_CounterPWMSetting(LONG DriverHandle,
  1779. LPT_CounterPWMSetting lpCounterPWMSetting);
  1780. FEXPORT LRESULT FTYPE DRV_CounterPWMEnable(LONG DriverHandle,
  1781. LPARAM Port);
  1782. FEXPORT LRESULT FTYPE DRV_DioTimerSetting(LONG DriverHandle,
  1783. LPT_DioTimerSetting lpDioTimerSetting);
  1784. FEXPORT LRESULT FTYPE DRV_DICounterReset(LONG DriverHandle,
  1785. LPARAM counter);
  1786. FEXPORT LRESULT FTYPE DRV_EnableSyncAO(LONG DriverHandle, LPARAM Enable);
  1787. FEXPORT LRESULT FTYPE DRV_WriteSyncAO(LONG DriverHandle);
  1788. FEXPORT LRESULT FTYPE DRV_AOCurrentOut(LONG DriverHandle,
  1789. LPT_AOCurrentOut lpAOCurrentOut);
  1790. FEXPORT LRESULT FTYPE DRV_DeviceNumToDeviceName(DWORD BoardID, LPSTR ExpName);
  1791. FEXPORT LRESULT FTYPE DRV_GetFIFOSize(LONG DriverHandle, LONG far * lSize);
  1792. FEXPORT LRESULT FTYPE DRV_PWMStartRead(LONG DriverHandle, LPT_PWMStartRead lpPWMStartRead);
  1793. //Only for ADAM configuration
  1794. FEXPORT LRESULT FTYPE DRV_ADAMCounterSetHWConfig(LONG DriverHandle,
  1795. LPT_ADAMCounterSetHWConfig lpCounterSetHWConfig);
  1796. FEXPORT LRESULT FTYPE DRV_ADAMCounterGetHWConfig(LONG DriverHandle,
  1797. LPT_ADAMCounterGetHWConfig lpCounterGetHWConfig);
  1798. FEXPORT LRESULT FTYPE DRV_ADAMAISetHWConfig(LONG DriverHandle,
  1799. LPT_ADAMAISetHWConfig lpADAMAISetHWConfig);
  1800. FEXPORT LRESULT FTYPE DRV_ADAMAIGetHWConfig(LONG DriverHandle,
  1801. LPT_ADAMAIGetHWConfig lpADAMAIGetHWConfig);
  1802. FEXPORT LRESULT FTYPE DRV_ADAMAOSetHWConfig(LONG DriverHandle,
  1803. LPT_ADAMAOSetHWConfig lpADAMAOSetHWConfig);
  1804. FEXPORT LRESULT FTYPE DRV_ADAMAOGetHWConfig(LONG DriverHandle,
  1805. LPT_ADAMAOGetHWConfig lpADAMAOGetHWConfig);
  1806. // Direct IO Function Listing
  1807. FEXPORT LRESULT FTYPE DRV_outp(ULONG DeviceNum,
  1808. USHORT port, USHORT ByteData);
  1809. FEXPORT LRESULT FTYPE DRV_outpw(ULONG DeviceNum,
  1810. USHORT port, USHORT WordData);
  1811. FEXPORT LRESULT FTYPE DRV_inp(ULONG DeviceNum,
  1812. USHORT port, USHORT far * ByteData);
  1813. FEXPORT LRESULT FTYPE DRV_inpw(ULONG DeviceNum,
  1814. USHORT port, USHORT far * WordData);
  1815. // High speed function declaration
  1816. FEXPORT LRESULT FTYPE DRV_FAIWatchdogConfig(LONG DriverHandle,
  1817. LPT_FAIWatchdogConfig lpFAIWatchdogConfig);
  1818. FEXPORT LRESULT FTYPE DRV_FAIIntStart(LONG DriverHandle,
  1819. LPT_FAIIntStart lpFAIIntStart);
  1820. FEXPORT LRESULT FTYPE DRV_FAIIntScanStart(LONG DriverHandle,
  1821. LPT_FAIIntScanStart lpFAIIntScanStart);
  1822. FEXPORT LRESULT FTYPE DRV_FAIDmaStart(LONG DriverHandle,
  1823. LPT_FAIDmaStart lpFAIDmaStart);
  1824. FEXPORT LRESULT FTYPE DRV_FAIDmaScanStart(LONG DriverHandle,
  1825. LPT_FAIDmaScanStart lpFAIDmaScanStart);
  1826. FEXPORT LRESULT FTYPE DRV_FAIDualDmaStart(LONG DriverHandle,
  1827. LPT_FAIDualDmaStart lpFAIDualDmaStart);
  1828. FEXPORT LRESULT FTYPE DRV_FAIDualDmaScanStart(LONG DriverHandle,
  1829. LPT_FAIDualDmaScanStart lpFAIDualDmaScanStart);
  1830. FEXPORT LRESULT FTYPE DRV_FAIIntWatchdogStart(LONG DriverHandle,
  1831. LPT_FAIIntWatchdogStart lpFAIIntWatchdogStart);
  1832. FEXPORT LRESULT FTYPE DRV_FAIDmaWatchdogStart(LONG DriverHandle,
  1833. LPT_FAIDmaWatchdogStart lpFAIDmaWatchdogStart);
  1834. FEXPORT LRESULT FTYPE DRV_FAICheck(LONG DriverHandle,
  1835. LPT_FAICheck lpFAICheck);
  1836. FEXPORT LRESULT FTYPE DRV_FAIWatchdogCheck(LONG DriverHandle,
  1837. LPT_FAIWatchdogCheck lpFAIWatchdogCheck);
  1838. FEXPORT LRESULT FTYPE DRV_FAITransfer(LONG DriverHandle,
  1839. LPT_FAITransfer lpFAITransfer);
  1840. FEXPORT LRESULT FTYPE DRV_FAIStop(LONG DriverHandle);
  1841. FEXPORT LRESULT FTYPE DRV_FAOIntStart(LONG DriverHandle,
  1842. LPT_FAOIntStart lpFAOIntStart);
  1843. FEXPORT LRESULT FTYPE DRV_FAODmaStart(LONG DriverHandle,
  1844. LPT_FAODmaStart lpFAODmaStart);
  1845. FEXPORT LRESULT FTYPE DRV_FAOScale(LONG DriverHandle,
  1846. LPT_FAOScale lpFAOScale);
  1847. FEXPORT LRESULT FTYPE DRV_FAOLoad(LONG DriverHandle,
  1848. LPT_FAOLoad lpFAOLoad);
  1849. FEXPORT LRESULT FTYPE DRV_FAOCheck(LONG DriverHandle,
  1850. LPT_FAOCheck lpFAOCheck);
  1851. FEXPORT LRESULT FTYPE DRV_FAOStop(LONG DriverHandle);
  1852. FEXPORT LRESULT FTYPE DRV_ClearOverrun(LONG DriverHandle);
  1853. FEXPORT LRESULT FTYPE DRV_EnableEvent(LONG DriverHandle,
  1854. LPT_EnableEvent lpEnableEvent);
  1855. FEXPORT LRESULT FTYPE DRV_CheckEvent(LONG DriverHandle,
  1856. LPT_CheckEvent lpCheckEvent);
  1857. FEXPORT LRESULT FTYPE DRV_EnableCANEvent(LONG DriverHandle,
  1858. LPT_EnableCANEvent lpEnableCANEvent);
  1859. FEXPORT LRESULT FTYPE DRV_GetCANEventData(LONG DriverHandle,
  1860. LPT_GetCANEventData lpGetCANEventData);
  1861. FEXPORT LRESULT FTYPE DRV_AllocateDMABuffer(LONG DriverHandle,
  1862. LPT_AllocateDMABuffer lpAllocateDMABuffer);
  1863. FEXPORT LRESULT FTYPE DRV_FreeDMABuffer(LONG DriverHandle,
  1864. LPARAM buffer);
  1865. FEXPORT LRESULT FTYPE DRV_EnableEventEx(LONG DriverHandle,
  1866. LPT_EnableEventEx lpEnableEventEx);
  1867. FEXPORT LRESULT FTYPE DRV_FDITransfer(LONG DriverHandle,
  1868. LPT_FDITransfer lpFDITransfer);
  1869. FEXPORT LRESULT FTYPE DRV_FAIDmaExStart(LONG DriverHandle,
  1870. LPT_FAIDmaExStart lpFAIDmaExStart);
  1871. FEXPORT LRESULT FTYPE DRV_FAOWaveFormStart(LONG DeviceHandle,
  1872. LPT_FAOWaveFormStart lpFAOWaveFormStart);
  1873. #ifdef __cplusplus
  1874. }
  1875. #endif
  1876. #endif