visa32.cs 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Text;
  4. internal sealed class visa32
  5. {
  6. // --------------------------------------------------------------------------------
  7. // Adapted from visa32.bas which was distributed by VXIplug&play Systems Alliance
  8. // Distributed By Agilent Technologies, Inc.
  9. // --------------------------------------------------------------------------------
  10. // Title : visa32.cs
  11. // Date : 03-06-2009
  12. // Purpose : VISA definitions for C#
  13. // -------------------------------------------------------------------------
  14. public const int VI_SPEC_VERSION = 4194304;
  15. #region - Resource Template Functions and Operations ----------------------------
  16. [DllImportAttribute("VISA32.DLL", EntryPoint="#141", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  17. public static extern int viOpenDefaultRM(out int sesn);
  18. [DllImportAttribute("VISA32.DLL", EntryPoint="#128", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  19. public static extern int viGetDefaultRM(out int sesn);
  20. [DllImportAttribute("VISA32.DLL", EntryPoint="#129", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  21. public static extern int viFindRsrc(int sesn, string expr, out int vi, out int retCount, StringBuilder desc);
  22. [DllImportAttribute("VISA32.DLL", EntryPoint="#130", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  23. public static extern int viFindNext(int vi, StringBuilder desc);
  24. [DllImportAttribute("VISA32.DLL", EntryPoint="#146", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  25. public static extern int viParseRsrc(int sesn, string desc, ref short intfType, ref short intfNum);
  26. [DllImportAttribute("VISA32.DLL", EntryPoint="#147", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  27. public static extern int viParseRsrcEx(int sesn, string desc, ref short intfType, ref short intfNum, StringBuilder rsrcClass, StringBuilder expandedUnaliasedName, StringBuilder aliasIfExists);
  28. [DllImportAttribute("VISA32.DLL", EntryPoint="#131", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  29. public static extern int viOpen(int sesn, string viDesc, int mode, int timeout, out int vi);
  30. [DllImportAttribute("VISA32.DLL", EntryPoint="#132", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  31. public static extern int viClose(int vi);
  32. #region viGetAttribute Overloads
  33. [DllImportAttribute("VISA32.DLL", EntryPoint="#133", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  34. public static extern int viGetAttribute(int vi, int attrName, out byte attrValue);
  35. [DllImportAttribute("VISA32.DLL", EntryPoint="#133", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  36. public static extern int viGetAttribute(int vi, int attrName, out short attrValue);
  37. [DllImportAttribute("VISA32.DLL", EntryPoint="#133", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  38. public static extern int viGetAttribute(int vi, int attrName, out int attrValue);
  39. [DllImportAttribute("VISA32.DLL", EntryPoint="#133", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  40. public static extern int viGetAttribute(int vi, int attrName, StringBuilder attrValue);
  41. #endregion
  42. #region viSetAttribute Overloads
  43. [DllImportAttribute("VISA32.DLL", EntryPoint="#134", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  44. public static extern int viSetAttribute(int vi, int attrName, byte attrValue);
  45. [DllImportAttribute("VISA32.DLL", EntryPoint="#134", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  46. public static extern int viSetAttribute(int vi, int attrName, short attrValue);
  47. [DllImportAttribute("VISA32.DLL", EntryPoint="#134", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  48. public static extern int viSetAttribute(int vi, int attrName, int attrValue);
  49. #endregion
  50. [DllImportAttribute("VISA32.DLL", EntryPoint="#142", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  51. public static extern int viStatusDesc(int vi, int status, StringBuilder desc);
  52. [DllImportAttribute("VISA32.DLL", EntryPoint="#143", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  53. public static extern int viTerminate(int vi, short degree, int jobId);
  54. [DllImportAttribute("VISA32.DLL", EntryPoint="#144", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  55. public static extern int viLock(int vi, int lockType, int timeout, string requestedKey, StringBuilder accessKey);
  56. [DllImportAttribute("VISA32.DLL", EntryPoint="#145", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  57. public static extern int viUnlock(int vi);
  58. [DllImportAttribute("VISA32.DLL", EntryPoint="#135", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  59. public static extern int viEnableEvent(int vi, int eventType, short mechanism, int context);
  60. [DllImportAttribute("VISA32.DLL", EntryPoint="#136", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  61. public static extern int viDisableEvent(int vi, int eventType, short mechanism);
  62. [DllImportAttribute("VISA32.DLL", EntryPoint="#137", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  63. public static extern int viDiscardEvents(int vi, int eventType, short mechanism);
  64. [DllImportAttribute("VISA32.DLL", EntryPoint="#138", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  65. public static extern int viWaitOnEvent(int vi, int inEventType, int timeout, ref int outEventType, ref int outEventContext);
  66. public delegate int viEventHandler(int vi, int eventType, int context, int userHandle);
  67. [DllImportAttribute("VISA32.DLL", EntryPoint="#139", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  68. public static extern int viInstallHandler(int vi, int eventType, viEventHandler handler, int UserHandle);
  69. [DllImportAttribute("VISA32.DLL", EntryPoint="#140", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  70. public static extern int viUninstallHandler(int vi, int eventType, viEventHandler handler, int userHandle);
  71. #endregion
  72. #region - Basic I/O Operations --------------------------------------------------
  73. [DllImportAttribute("VISA32.DLL", EntryPoint="#256", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  74. public static extern int viRead(int vi, byte[] buffer, int count, out int retCount);
  75. [DllImportAttribute("VISA32.DLL", EntryPoint="#277", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  76. public static extern int viReadAsync(int vi, byte[] buffer, int count, out int jobId);
  77. [DllImportAttribute("VISA32.DLL", EntryPoint="#219", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  78. public static extern int viReadToFile(int vi, string filename, int count, ref int retCount);
  79. [DllImportAttribute("VISA32.DLL", EntryPoint="#257", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  80. public static extern int viWrite(int vi, byte[] buffer, int count, out int retCount);
  81. [DllImportAttribute("VISA32.DLL", EntryPoint="#278", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  82. public static extern int viWriteAsync(int vi, byte[] buffer, int count, out int jobId);
  83. [DllImportAttribute("VISA32.DLL", EntryPoint="#218", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  84. public static extern int viWriteFromFile(int vi, string filename, int count, ref int retCount);
  85. [DllImportAttribute("VISA32.DLL", EntryPoint="#258", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  86. public static extern int viAssertTrigger(int vi, short protocol);
  87. [DllImportAttribute("VISA32.DLL", EntryPoint="#259", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  88. public static extern int viReadSTB(int vi, ref short status);
  89. [DllImportAttribute("VISA32.DLL", EntryPoint="#260", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  90. public static extern int viClear(int vi);
  91. #endregion
  92. #region - Formatted and Buffered I/O Operations ---------------------------------
  93. [DllImportAttribute("VISA32.DLL", EntryPoint="#267", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  94. public static extern int viSetBuf(int vi, short mask, int bufSize);
  95. [DllImportAttribute("VISA32.DLL", EntryPoint="#268", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  96. public static extern int viFlush(int vi, short mask);
  97. [DllImportAttribute("VISA32.DLL", EntryPoint="#202", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  98. public static extern int viBufWrite(int vi, byte[] buffer, int count, out int retCount);
  99. [DllImportAttribute("VISA32.DLL", EntryPoint="#203", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  100. public static extern int viBufRead(int vi, byte[] buffer, int count, out int retCount);
  101. #region viPrintf Overloads
  102. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  103. public static extern int viPrintf(int vi, string writeFmt);
  104. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  105. public static extern int viPrintf(int vi, string writeFmt, int[] arr);
  106. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  107. public static extern int viPrintf(int vi, string writeFmt, short[] arr);
  108. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  109. public static extern int viPrintf(int vi, string writeFmt, float[] arr);
  110. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  111. public static extern int viPrintf(int vi, string writeFmt, double[] arr);
  112. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  113. public static extern int viPrintf(int vi, string writeFmt, byte[] arr);
  114. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  115. public static extern int viPrintf(int vi, string writeFmt, string arg);
  116. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  117. public static extern int viPrintf(int vi, string writeFmt, int arg);
  118. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  119. public static extern int viPrintf(int vi, string writeFmt, short arg);
  120. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  121. public static extern int viPrintf(int vi, string writeFmt, double arg);
  122. [DllImportAttribute("VISA32.DLL", EntryPoint="#269", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  123. public static extern int viPrintf(int vi, string writeFmt, byte arg);
  124. #endregion
  125. #region viSPrintf Overloads
  126. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  127. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt);
  128. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  129. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, int[] arr);
  130. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  131. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, short[] arr);
  132. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  133. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, float[] arr);
  134. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  135. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, double[] arr);
  136. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  137. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, byte[] arr);
  138. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  139. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, string arg);
  140. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  141. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, int arg);
  142. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  143. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, short arg);
  144. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  145. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, double arg);
  146. [DllImportAttribute("VISA32.DLL", EntryPoint="#204", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  147. public static extern int viSPrintf(int vi, StringBuilder buffer, string writeFmt, byte arg);
  148. #endregion
  149. #region viScanf Overloads
  150. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  151. public static extern int viScanf(int vi, string readFmt);
  152. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  153. public static extern int viScanf(int vi, string readFmt, int[] arr);
  154. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  155. public static extern int viScanf(int vi, string readFmt, short[] arr);
  156. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  157. public static extern int viScanf(int vi, string readFmt, float[] arr);
  158. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  159. public static extern int viScanf(int vi, string readFmt, double[] arr);
  160. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  161. public static extern int viScanf(int vi, string readFmt, byte[] arr);
  162. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  163. public static extern int viScanf(int vi, string readFmt, ref int count, int[] arr);
  164. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  165. public static extern int viScanf(int vi, string readFmt, ref int count, short[] arr);
  166. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  167. public static extern int viScanf(int vi, string readFmt, ref int count, float[] arr);
  168. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  169. public static extern int viScanf(int vi, string readFmt, ref int count, double[] arr);
  170. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  171. public static extern int viScanf(int vi, string readFmt, ref int count, byte[] arr);
  172. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  173. public static extern int viScanf(int vi, string readFmt, StringBuilder arg);
  174. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  175. public static extern int viScanf(int vi, string readFmt, ref int stringSize, StringBuilder arg);
  176. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  177. public static extern int viScanf(int vi, string readFmt, out int arg);
  178. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  179. public static extern int viScanf(int vi, string readFmt, out short arg);
  180. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  181. public static extern int viScanf(int vi, string readFmt, out float arg);
  182. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  183. public static extern int viScanf(int vi, string readFmt, out double arg);
  184. [DllImportAttribute("VISA32.DLL", EntryPoint="#271", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  185. public static extern int viScanf(int vi, string readFmt, out byte arg);
  186. #endregion
  187. #region viSScanf Overloads
  188. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  189. public static extern int viSScanf(int vi, string buffer, string readFmt);
  190. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  191. public static extern int viSScanf(int vi, string buffer, string readFmt, int[] arr);
  192. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  193. public static extern int viSScanf(int vi, string buffer, string readFmt, short[] arr);
  194. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  195. public static extern int viSScanf(int vi, string buffer, string readFmt, float[] arr);
  196. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  197. public static extern int viSScanf(int vi, string buffer, string readFmt, double[] arr);
  198. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  199. public static extern int viSScanf(int vi, string buffer, string readFmt, byte[] arr);
  200. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  201. public static extern int viSScanf(int vi, string buffer, string readFmt, ref int count, int[] arr);
  202. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  203. public static extern int viSScanf(int vi, string buffer, string readFmt, ref int count, short[] arr);
  204. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  205. public static extern int viSScanf(int vi, string buffer, string readFmt, ref int count, float[] arr);
  206. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  207. public static extern int viSScanf(int vi, string buffer, string readFmt, ref int count, double[] arr);
  208. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  209. public static extern int viSScanf(int vi, string buffer, string readFmt, ref int count, byte[] arr);
  210. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  211. public static extern int viSScanf(int vi, string buffer, string readFmt, StringBuilder arg);
  212. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  213. public static extern int viSScanf(int vi, string buffer, string readFmt, ref int stringSize, StringBuilder arg);
  214. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  215. public static extern int viSScanf(int vi, string buffer, string readFmt, out int arg);
  216. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  217. public static extern int viSScanf(int vi, string buffer, string readFmt, out short arg);
  218. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  219. public static extern int viSScanf(int vi, string buffer, string readFmt, out float arg);
  220. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  221. public static extern int viSScanf(int vi, string buffer, string readFmt, out double arg);
  222. [DllImportAttribute("VISA32.DLL", EntryPoint="#206", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true, CallingConvention=CallingConvention.Cdecl)]
  223. public static extern int viSScanf(int vi, string buffer, string readFmt, out byte arg);
  224. #endregion
  225. #endregion
  226. #region - Memory I/O Operations -------------------------------------------------
  227. [DllImportAttribute("VISA32.DLL", EntryPoint="#273", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  228. public static extern int viIn8(int vi, short accSpace, int offset, out byte val8);
  229. [DllImportAttribute("VISA32.DLL", EntryPoint="#274", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  230. public static extern int viOut8(int vi, short accSpace, int offset, byte val8);
  231. [DllImportAttribute("VISA32.DLL", EntryPoint="#261", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  232. public static extern int viIn16(int vi, short accSpace, int offset, out short val16);
  233. [DllImportAttribute("VISA32.DLL", EntryPoint="#262", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  234. public static extern int viOut16(int vi, short accSpace, int offset, short val16);
  235. [DllImportAttribute("VISA32.DLL", EntryPoint="#281", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  236. public static extern int viIn32(int vi, short accSpace, int offset, out int val32);
  237. [DllImportAttribute("VISA32.DLL", EntryPoint="#282", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  238. public static extern int viOut32(int vi, short accSpace, int offset, int val32);
  239. [DllImportAttribute("VISA32.DLL", EntryPoint="#283", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  240. public static extern int viMoveIn8(int vi, short accSpace, int offset, int length, byte[] buf8);
  241. [DllImportAttribute("VISA32.DLL", EntryPoint="#284", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  242. public static extern int viMoveOut8(int vi, short accSpace, int offset, int length, byte[] buf8);
  243. [DllImportAttribute("VISA32.DLL", EntryPoint="#285", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  244. public static extern int viMoveIn16(int vi, short accSpace, int offset, int length, short[] buf16);
  245. [DllImportAttribute("VISA32.DLL", EntryPoint="#286", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  246. public static extern int viMoveOut16(int vi, short accSpace, int offset, int length, short[] buf16);
  247. [DllImportAttribute("VISA32.DLL", EntryPoint="#287", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  248. public static extern int viMoveIn32(int vi, short accSpace, int offset, int length, int[] buf32);
  249. [DllImportAttribute("VISA32.DLL", EntryPoint="#288", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  250. public static extern int viMoveOut32(int vi, short accSpace, int offset, int length, int[] buf32);
  251. [DllImportAttribute("VISA32.DLL", EntryPoint="#200", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  252. public static extern int viMove(int vi, short srcSpace, int srcOffset, short srcWidth, short destSpace, int destOffset, short destWidth, int srcLength);
  253. [DllImportAttribute("VISA32.DLL", EntryPoint="#201", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  254. public static extern int viMoveAsync(int vi, short srcSpace, int srcOffset, short srcWidth, short destSpace, int destOffset, short destWidth, int srcLength, out int jobId);
  255. [DllImportAttribute("VISA32.DLL", EntryPoint="#263", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  256. public static extern int viMapAddress(int vi, short mapSpace, int mapOffset, int mapSize, short accMode, int suggested, out int address);
  257. [DllImportAttribute("VISA32.DLL", EntryPoint="#264", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  258. public static extern int viUnmapAddress(int vi);
  259. [DllImportAttribute("VISA32.DLL", EntryPoint="#275", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  260. public static extern void viPeek8(int vi, int address, out byte val8);
  261. [DllImportAttribute("VISA32.DLL", EntryPoint="#276", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  262. public static extern void viPoke8(int vi, int address, byte val8);
  263. [DllImportAttribute("VISA32.DLL", EntryPoint="#265", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  264. public static extern void viPeek16(int vi, int address, out short val16);
  265. [DllImportAttribute("VISA32.DLL", EntryPoint="#266", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  266. public static extern void viPoke16(int vi, int address, short val16);
  267. [DllImportAttribute("VISA32.DLL", EntryPoint="#289", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  268. public static extern void viPeek32(int vi, int address, out int val32);
  269. [DllImportAttribute("VISA32.DLL", EntryPoint="#290", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  270. public static extern void viPoke32(int vi, int address, int val32);
  271. #region 64-bit Extension Functions
  272. [DllImportAttribute("VISA32.DLL", EntryPoint = "#220", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  273. public static extern int viIn64(int vi, short accSpace, int offset, out long val64);
  274. [DllImportAttribute("VISA32.DLL", EntryPoint = "#221", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  275. public static extern int viOut64(int vi, short accSpace, int offset, long val64);
  276. [DllImportAttribute("VISA32.DLL", EntryPoint = "#222", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  277. public static extern int viIn8Ex(int vi, short accSpace, long offset, out byte val8);
  278. [DllImportAttribute("VISA32.DLL", EntryPoint = "#223", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  279. public static extern int viOut8Ex(int vi, short accSpace, long offset, byte val8);
  280. [DllImportAttribute("VISA32.DLL", EntryPoint = "#224", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  281. public static extern int viIn16Ex(int vi, short accSpace, long offset, out short val16);
  282. [DllImportAttribute("VISA32.DLL", EntryPoint = "#225", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  283. public static extern int viOut16Ex(int vi, short accSpace, long offset, short val16);
  284. [DllImportAttribute("VISA32.DLL", EntryPoint = "#226", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  285. public static extern int viIn32Ex(int vi, short accSpace, long offset, out int val32);
  286. [DllImportAttribute("VISA32.DLL", EntryPoint = "#227", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  287. public static extern int viOut32Ex(int vi, short accSpace, long offset, int val32);
  288. [DllImportAttribute("VISA32.DLL", EntryPoint = "#228", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  289. public static extern int viIn64Ex(int vi, short accSpace, long offset, out long val64);
  290. [DllImportAttribute("VISA32.DLL", EntryPoint = "#229", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  291. public static extern int viOut64Ex(int vi, short accSpace, long offset, long val64);
  292. [DllImportAttribute("VISA32.DLL", EntryPoint = "#230", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  293. public static extern int viMoveIn64(int vi, short accSpace, int offset, int length, long[] buf64);
  294. [DllImportAttribute("VISA32.DLL", EntryPoint = "#231", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  295. public static extern int viMoveOut64(int vi, short accSpace, int offset, int length, long[] buf64);
  296. [DllImportAttribute("VISA32.DLL", EntryPoint = "#232", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  297. public static extern int viMoveIn8Ex(int vi, short accSpace, long offset, int length, byte[] buf8);
  298. [DllImportAttribute("VISA32.DLL", EntryPoint = "#233", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  299. public static extern int viMoveOut8Ex(int vi, short accSpace, long offset, int length, byte[] buf8);
  300. [DllImportAttribute("VISA32.DLL", EntryPoint = "#234", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  301. public static extern int viMoveIn16Ex(int vi, short accSpace, long offset, int length, short[] buf16);
  302. [DllImportAttribute("VISA32.DLL", EntryPoint = "#235", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  303. public static extern int viMoveOut16Ex(int vi, short accSpace, long offset, int length, short[] buf16);
  304. [DllImportAttribute("VISA32.DLL", EntryPoint = "#236", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  305. public static extern int viMoveIn32Ex(int vi, short accSpace, long offset, int length, int[] buf32);
  306. [DllImportAttribute("VISA32.DLL", EntryPoint = "#237", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  307. public static extern int viMoveOut32Ex(int vi, short accSpace, long offset, int length, int[] buf32);
  308. [DllImportAttribute("VISA32.DLL", EntryPoint = "#238", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  309. public static extern int viMoveIn64Ex(int vi, short accSpace, long offset, int length, long[] buf64);
  310. [DllImportAttribute("VISA32.DLL", EntryPoint = "#239", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  311. public static extern int viMoveOut64Ex(int vi, short accSpace, long offset, int length, long[] buf64);
  312. [DllImportAttribute("VISA32.DLL", EntryPoint = "#240", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  313. public static extern int viMoveEx(int vi, short srcSpace, long srcOffset, short srcWidth, short destSpace, long destOffset, short destWidth, int srcLength);
  314. [DllImportAttribute("VISA32.DLL", EntryPoint = "#241", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  315. public static extern int viMoveAsyncEx(int vi, short srcSpace, long srcOffset, short srcWidth, short destSpace, long destOffset, short destWidth, int srcLength, out int jobId);
  316. [DllImportAttribute("VISA32.DLL", EntryPoint = "#242", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  317. public static extern int viMapAddressEx(int vi, short mapSpace, long mapOffset, int mapSize, short accMode, int suggested, out int address);
  318. [DllImportAttribute("VISA32.DLL", EntryPoint = "#243", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  319. public static extern int viMemAllocEx(int vi, int memSize, out long offset);
  320. [DllImportAttribute("VISA32.DLL", EntryPoint = "#244", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  321. public static extern int viMemFreeEx(int vi, long offset);
  322. [DllImportAttribute("VISA32.DLL", EntryPoint = "#245", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  323. public static extern void viPeek64(int vi, int address, out long val64);
  324. [DllImportAttribute("VISA32.DLL", EntryPoint = "#246", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
  325. public static extern void viPoke64(int vi, int address, long val64);
  326. #endregion
  327. #endregion
  328. #region - Shared Memory Operations ----------------------------------------------
  329. [DllImportAttribute("VISA32.DLL", EntryPoint="#291", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  330. public static extern int viMemAlloc(int vi, int memSize, out int offset);
  331. [DllImportAttribute("VISA32.DLL", EntryPoint="#292", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  332. public static extern int viMemFree(int vi, int offset);
  333. #endregion
  334. #region - Interface Specific Operations -----------------------------------------
  335. [DllImportAttribute("VISA32.DLL", EntryPoint="#208", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  336. public static extern int viGpibControlREN(int vi, short mode);
  337. [DllImportAttribute("VISA32.DLL", EntryPoint="#210", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  338. public static extern int viGpibControlATN(int vi, short mode);
  339. [DllImportAttribute("VISA32.DLL", EntryPoint="#211", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  340. public static extern int viGpibSendIFC(int vi);
  341. [DllImportAttribute("VISA32.DLL", EntryPoint="#212", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  342. public static extern int viGpibCommand(int vi, string buffer, int count, out int retCount);
  343. [DllImportAttribute("VISA32.DLL", EntryPoint="#213", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  344. public static extern int viGpibPassControl(int vi, short primAddr, short secAddr);
  345. [DllImportAttribute("VISA32.DLL", EntryPoint="#209", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  346. public static extern int viVxiCommandQuery(int vi, short mode, int devCmd, out int devResponse);
  347. [DllImportAttribute("VISA32.DLL", EntryPoint="#214", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  348. public static extern int viAssertUtilSignal(int vi, short line);
  349. [DllImportAttribute("VISA32.DLL", EntryPoint="#215", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  350. public static extern int viAssertIntrSignal(int vi, short mode, int statusID);
  351. [DllImportAttribute("VISA32.DLL", EntryPoint="#216", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  352. public static extern int viMapTrigger(int vi, short trigSrc, short trigDest, short mode);
  353. [DllImportAttribute("VISA32.DLL", EntryPoint="#217", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  354. public static extern int viUnmapTrigger(int vi, short trigSrc, short trigDest);
  355. [DllImportAttribute("VISA32.DLL", EntryPoint="#293", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  356. public static extern int viUsbControlOut(int vi, short bmRequestType, short bRequest, short wValue, short wIndex, short wLength, byte[] buf);
  357. [DllImportAttribute("VISA32.DLL", EntryPoint="#294", ExactSpelling=true, CharSet=CharSet.Ansi, SetLastError=true)]
  358. public static extern int viUsbControlIn(int vi, short bmRequestType, short bRequest, short wValue, short wIndex, short wLength, byte[] buf, out short retCnt);
  359. #endregion
  360. #region - Constants -------------------------------------------------------------
  361. #region - Attributes ------------------------------------------------------------
  362. public const int VI_ATTR_RSRC_CLASS = -1073807359;
  363. public const int VI_ATTR_RSRC_NAME = -1073807358;
  364. public const int VI_ATTR_RSRC_IMPL_VERSION = 1073676291;
  365. public const int VI_ATTR_RSRC_LOCK_STATE = 1073676292;
  366. public const int VI_ATTR_MAX_QUEUE_LENGTH = 1073676293;
  367. public const int VI_ATTR_USER_DATA = 1073676295;
  368. public const int VI_ATTR_FDC_CHNL = 1073676301;
  369. public const int VI_ATTR_FDC_MODE = 1073676303;
  370. public const int VI_ATTR_FDC_GEN_SIGNAL_EN = 1073676305;
  371. public const int VI_ATTR_FDC_USE_PAIR = 1073676307;
  372. public const int VI_ATTR_SEND_END_EN = 1073676310;
  373. public const int VI_ATTR_TERMCHAR = 1073676312;
  374. public const int VI_ATTR_TMO_VALUE = 1073676314;
  375. public const int VI_ATTR_GPIB_READDR_EN = 1073676315;
  376. public const int VI_ATTR_IO_PROT = 1073676316;
  377. public const int VI_ATTR_DMA_ALLOW_EN = 1073676318;
  378. public const int VI_ATTR_ASRL_BAUD = 1073676321;
  379. public const int VI_ATTR_ASRL_DATA_BITS = 1073676322;
  380. public const int VI_ATTR_ASRL_PARITY = 1073676323;
  381. public const int VI_ATTR_ASRL_STOP_BITS = 1073676324;
  382. public const int VI_ATTR_ASRL_FLOW_CNTRL = 1073676325;
  383. public const int VI_ATTR_RD_BUF_OPER_MODE = 1073676330;
  384. public const int VI_ATTR_RD_BUF_SIZE = 1073676331;
  385. public const int VI_ATTR_WR_BUF_OPER_MODE = 1073676333;
  386. public const int VI_ATTR_WR_BUF_SIZE = 1073676334;
  387. public const int VI_ATTR_SUPPRESS_END_EN = 1073676342;
  388. public const int VI_ATTR_TERMCHAR_EN = 1073676344;
  389. public const int VI_ATTR_DEST_ACCESS_PRIV = 1073676345;
  390. public const int VI_ATTR_DEST_BYTE_ORDER = 1073676346;
  391. public const int VI_ATTR_SRC_ACCESS_PRIV = 1073676348;
  392. public const int VI_ATTR_SRC_BYTE_ORDER = 1073676349;
  393. public const int VI_ATTR_SRC_INCREMENT = 1073676352;
  394. public const int VI_ATTR_DEST_INCREMENT = 1073676353;
  395. public const int VI_ATTR_WIN_ACCESS_PRIV = 1073676357;
  396. public const int VI_ATTR_WIN_BYTE_ORDER = 1073676359;
  397. public const int VI_ATTR_GPIB_ATN_STATE = 1073676375;
  398. public const int VI_ATTR_GPIB_ADDR_STATE = 1073676380;
  399. public const int VI_ATTR_GPIB_CIC_STATE = 1073676382;
  400. public const int VI_ATTR_GPIB_NDAC_STATE = 1073676386;
  401. public const int VI_ATTR_GPIB_SRQ_STATE = 1073676391;
  402. public const int VI_ATTR_GPIB_SYS_CNTRL_STATE = 1073676392;
  403. public const int VI_ATTR_GPIB_HS488_CBL_LEN = 1073676393;
  404. public const int VI_ATTR_CMDR_LA = 1073676395;
  405. public const int VI_ATTR_VXI_DEV_CLASS = 1073676396;
  406. public const int VI_ATTR_MAINFRAME_LA = 1073676400;
  407. public const int VI_ATTR_MANF_NAME = -1073807246;
  408. public const int VI_ATTR_MODEL_NAME = -1073807241;
  409. public const int VI_ATTR_VXI_VME_INTR_STATUS = 1073676427;
  410. public const int VI_ATTR_VXI_TRIG_STATUS = 1073676429;
  411. public const int VI_ATTR_VXI_VME_SYSFAIL_STATE = 1073676436;
  412. public const int VI_ATTR_WIN_BASE_ADDR = 1073676440;
  413. public const int VI_ATTR_WIN_SIZE = 1073676442;
  414. public const int VI_ATTR_ASRL_AVAIL_NUM = 1073676460;
  415. public const int VI_ATTR_MEM_BASE = 1073676461;
  416. public const int VI_ATTR_ASRL_CTS_STATE = 1073676462;
  417. public const int VI_ATTR_ASRL_DCD_STATE = 1073676463;
  418. public const int VI_ATTR_ASRL_DSR_STATE = 1073676465;
  419. public const int VI_ATTR_ASRL_DTR_STATE = 1073676466;
  420. public const int VI_ATTR_ASRL_END_IN = 1073676467;
  421. public const int VI_ATTR_ASRL_END_OUT = 1073676468;
  422. public const int VI_ATTR_ASRL_REPLACE_CHAR = 1073676478;
  423. public const int VI_ATTR_ASRL_RI_STATE = 1073676479;
  424. public const int VI_ATTR_ASRL_RTS_STATE = 1073676480;
  425. public const int VI_ATTR_ASRL_XON_CHAR = 1073676481;
  426. public const int VI_ATTR_ASRL_XOFF_CHAR = 1073676482;
  427. public const int VI_ATTR_WIN_ACCESS = 1073676483;
  428. public const int VI_ATTR_RM_SESSION = 1073676484;
  429. public const int VI_ATTR_VXI_LA = 1073676501;
  430. public const int VI_ATTR_MANF_ID = 1073676505;
  431. public const int VI_ATTR_MEM_SIZE = 1073676509;
  432. public const int VI_ATTR_MEM_SPACE = 1073676510;
  433. public const int VI_ATTR_MODEL_CODE = 1073676511;
  434. public const int VI_ATTR_SLOT = 1073676520;
  435. public const int VI_ATTR_INTF_INST_NAME = -1073807127;
  436. public const int VI_ATTR_IMMEDIATE_SERV = 1073676544;
  437. public const int VI_ATTR_INTF_PARENT_NUM = 1073676545;
  438. public const int VI_ATTR_RSRC_SPEC_VERSION = 1073676656;
  439. public const int VI_ATTR_INTF_TYPE = 1073676657;
  440. public const int VI_ATTR_GPIB_PRIMARY_ADDR = 1073676658;
  441. public const int VI_ATTR_GPIB_SECONDARY_ADDR = 1073676659;
  442. public const int VI_ATTR_RSRC_MANF_NAME = -1073806988;
  443. public const int VI_ATTR_RSRC_MANF_ID = 1073676661;
  444. public const int VI_ATTR_INTF_NUM = 1073676662;
  445. public const int VI_ATTR_TRIG_ID = 1073676663;
  446. public const int VI_ATTR_GPIB_REN_STATE = 1073676673;
  447. public const int VI_ATTR_GPIB_UNADDR_EN = 1073676676;
  448. public const int VI_ATTR_DEV_STATUS_BYTE = 1073676681;
  449. public const int VI_ATTR_FILE_APPEND_EN = 1073676690;
  450. public const int VI_ATTR_VXI_TRIG_SUPPORT = 1073676692;
  451. public const int VI_ATTR_TCPIP_ADDR = -1073806955;
  452. public const int VI_ATTR_TCPIP_HOSTNAME = -1073806954;
  453. public const int VI_ATTR_TCPIP_PORT = 1073676695;
  454. public const int VI_ATTR_TCPIP_DEVICE_NAME = -1073806951;
  455. public const int VI_ATTR_TCPIP_NODELAY = 1073676698;
  456. public const int VI_ATTR_TCPIP_KEEPALIVE = 1073676699;
  457. public const int VI_ATTR_4882_COMPLIANT = 1073676703;
  458. public const int VI_ATTR_USB_SERIAL_NUM = -1073806944;
  459. public const int VI_ATTR_USB_INTFC_NUM = 1073676705;
  460. public const int VI_ATTR_USB_PROTOCOL = 1073676711;
  461. public const int VI_ATTR_USB_MAX_INTR_SIZE = 1073676719;
  462. public const int VI_ATTR_JOB_ID = 1073692678;
  463. public const int VI_ATTR_EVENT_TYPE = 1073692688;
  464. public const int VI_ATTR_SIGP_STATUS_ID = 1073692689;
  465. public const int VI_ATTR_RECV_TRIG_ID = 1073692690;
  466. public const int VI_ATTR_INTR_STATUS_ID = 1073692707;
  467. public const int VI_ATTR_STATUS = 1073692709;
  468. public const int VI_ATTR_RET_COUNT = 1073692710;
  469. public const int VI_ATTR_BUFFER = 1073692711;
  470. public const int VI_ATTR_RECV_INTR_LEVEL = 1073692737;
  471. public const int VI_ATTR_OPER_NAME = -1073790910;
  472. public const int VI_ATTR_GPIB_RECV_CIC_STATE = 1073693075;
  473. public const int VI_ATTR_RECV_TCPIP_ADDR = -1073790568;
  474. public const int VI_ATTR_USB_RECV_INTR_SIZE = 1073693104;
  475. public const int VI_ATTR_USB_RECV_INTR_DATA = -1073790543;
  476. #endregion
  477. #region - Event Types -----------------------------------------------------------
  478. public const int VI_EVENT_IO_COMPLETION = 1073684489;
  479. public const int VI_EVENT_TRIG = -1073799158;
  480. public const int VI_EVENT_SERVICE_REQ = 1073684491;
  481. public const int VI_EVENT_CLEAR = 1073684493;
  482. public const int VI_EVENT_EXCEPTION = -1073799154;
  483. public const int VI_EVENT_GPIB_CIC = 1073684498;
  484. public const int VI_EVENT_GPIB_TALK = 1073684499;
  485. public const int VI_EVENT_GPIB_LISTEN = 1073684500;
  486. public const int VI_EVENT_VXI_VME_SYSFAIL = 1073684509;
  487. public const int VI_EVENT_VXI_VME_SYSRESET = 1073684510;
  488. public const int VI_EVENT_VXI_SIGP = 1073684512;
  489. public const int VI_EVENT_VXI_VME_INTR = -1073799135;
  490. public const int VI_EVENT_TCPIP_CONNECT = 1073684534;
  491. public const int VI_EVENT_USB_INTR = 1073684535;
  492. public const int VI_ALL_ENABLED_EVENTS = 1073709055;
  493. #endregion
  494. #region - Completion and Error Codes --------------------------------------------
  495. public const int VI_SUCCESS = 0;
  496. public const int VI_SUCCESS_EVENT_EN = 1073676290;
  497. public const int VI_SUCCESS_EVENT_DIS = 1073676291;
  498. public const int VI_SUCCESS_QUEUE_EMPTY = 1073676292;
  499. public const int VI_SUCCESS_TERM_CHAR = 1073676293;
  500. public const int VI_SUCCESS_MAX_CNT = 1073676294;
  501. public const int VI_SUCCESS_DEV_NPRESENT = 1073676413;
  502. public const int VI_SUCCESS_TRIG_MAPPED = 1073676414;
  503. public const int VI_SUCCESS_QUEUE_NEMPTY = 1073676416;
  504. public const int VI_SUCCESS_NCHAIN = 1073676440;
  505. public const int VI_SUCCESS_NESTED_SHARED = 1073676441;
  506. public const int VI_SUCCESS_NESTED_EXCLUSIVE = 1073676442;
  507. public const int VI_SUCCESS_SYNC = 1073676443;
  508. public const int VI_WARN_QUEUE_OVERFLOW = 1073676300;
  509. public const int VI_WARN_CONFIG_NLOADED = 1073676407;
  510. public const int VI_WARN_NULL_OBJECT = 1073676418;
  511. public const int VI_WARN_NSUP_ATTR_STATE = 1073676420;
  512. public const int VI_WARN_UNKNOWN_STATUS = 1073676421;
  513. public const int VI_WARN_NSUP_BUF = 1073676424;
  514. public const int VI_WARN_EXT_FUNC_NIMPL = 1073676457;
  515. public const int VI_ERROR_SYSTEM_ERROR = -1073807360;
  516. public const int VI_ERROR_INV_OBJECT = -1073807346;
  517. public const int VI_ERROR_RSRC_LOCKED = -1073807345;
  518. public const int VI_ERROR_INV_EXPR = -1073807344;
  519. public const int VI_ERROR_RSRC_NFOUND = -1073807343;
  520. public const int VI_ERROR_INV_RSRC_NAME = -1073807342;
  521. public const int VI_ERROR_INV_ACC_MODE = -1073807341;
  522. public const int VI_ERROR_TMO = -1073807339;
  523. public const int VI_ERROR_CLOSING_FAILED = -1073807338;
  524. public const int VI_ERROR_INV_DEGREE = -1073807333;
  525. public const int VI_ERROR_INV_JOB_ID = -1073807332;
  526. public const int VI_ERROR_NSUP_ATTR = -1073807331;
  527. public const int VI_ERROR_NSUP_ATTR_STATE = -1073807330;
  528. public const int VI_ERROR_ATTR_READONLY = -1073807329;
  529. public const int VI_ERROR_INV_LOCK_TYPE = -1073807328;
  530. public const int VI_ERROR_INV_ACCESS_KEY = -1073807327;
  531. public const int VI_ERROR_INV_EVENT = -1073807322;
  532. public const int VI_ERROR_INV_MECH = -1073807321;
  533. public const int VI_ERROR_HNDLR_NINSTALLED = -1073807320;
  534. public const int VI_ERROR_INV_HNDLR_REF = -1073807319;
  535. public const int VI_ERROR_INV_CONTEXT = -1073807318;
  536. public const int VI_ERROR_QUEUE_OVERFLOW = -1073807315;
  537. public const int VI_ERROR_NENABLED = -1073807313;
  538. public const int VI_ERROR_ABORT = -1073807312;
  539. public const int VI_ERROR_RAW_WR_PROT_VIOL = -1073807308;
  540. public const int VI_ERROR_RAW_RD_PROT_VIOL = -1073807307;
  541. public const int VI_ERROR_OUTP_PROT_VIOL = -1073807306;
  542. public const int VI_ERROR_INP_PROT_VIOL = -1073807305;
  543. public const int VI_ERROR_BERR = -1073807304;
  544. public const int VI_ERROR_IN_PROGRESS = -1073807303;
  545. public const int VI_ERROR_INV_SETUP = -1073807302;
  546. public const int VI_ERROR_QUEUE_ERROR = -1073807301;
  547. public const int VI_ERROR_ALLOC = -1073807300;
  548. public const int VI_ERROR_INV_MASK = -1073807299;
  549. public const int VI_ERROR_IO = -1073807298;
  550. public const int VI_ERROR_INV_FMT = -1073807297;
  551. public const int VI_ERROR_NSUP_FMT = -1073807295;
  552. public const int VI_ERROR_LINE_IN_USE = -1073807294;
  553. public const int VI_ERROR_NSUP_MODE = -1073807290;
  554. public const int VI_ERROR_SRQ_NOCCURRED = -1073807286;
  555. public const int VI_ERROR_INV_SPACE = -1073807282;
  556. public const int VI_ERROR_INV_OFFSET = -1073807279;
  557. public const int VI_ERROR_INV_WIDTH = -1073807278;
  558. public const int VI_ERROR_NSUP_OFFSET = -1073807276;
  559. public const int VI_ERROR_NSUP_VAR_WIDTH = -1073807275;
  560. public const int VI_ERROR_WINDOW_NMAPPED = -1073807273;
  561. public const int VI_ERROR_RESP_PENDING = -1073807271;
  562. public const int VI_ERROR_NLISTENERS = -1073807265;
  563. public const int VI_ERROR_NCIC = -1073807264;
  564. public const int VI_ERROR_NSYS_CNTLR = -1073807263;
  565. public const int VI_ERROR_NSUP_OPER = -1073807257;
  566. public const int VI_ERROR_INTR_PENDING = -1073807256;
  567. public const int VI_ERROR_ASRL_PARITY = -1073807254;
  568. public const int VI_ERROR_ASRL_FRAMING = -1073807253;
  569. public const int VI_ERROR_ASRL_OVERRUN = -1073807252;
  570. public const int VI_ERROR_TRIG_NMAPPED = -1073807250;
  571. public const int VI_ERROR_NSUP_ALIGN_OFFSET = -1073807248;
  572. public const int VI_ERROR_USER_BUF = -1073807247;
  573. public const int VI_ERROR_RSRC_BUSY = -1073807246;
  574. public const int VI_ERROR_NSUP_WIDTH = -1073807242;
  575. public const int VI_ERROR_INV_PARAMETER = -1073807240;
  576. public const int VI_ERROR_INV_PROT = -1073807239;
  577. public const int VI_ERROR_INV_SIZE = -1073807237;
  578. public const int VI_ERROR_WINDOW_MAPPED = -1073807232;
  579. public const int VI_ERROR_NIMPL_OPER = -1073807231;
  580. public const int VI_ERROR_INV_LENGTH = -1073807229;
  581. public const int VI_ERROR_INV_MODE = -1073807215;
  582. public const int VI_ERROR_SESN_NLOCKED = -1073807204;
  583. public const int VI_ERROR_MEM_NSHARED = -1073807203;
  584. public const int VI_ERROR_LIBRARY_NFOUND = -1073807202;
  585. public const int VI_ERROR_NSUP_INTR = -1073807201;
  586. public const int VI_ERROR_INV_LINE = -1073807200;
  587. public const int VI_ERROR_FILE_ACCESS = -1073807199;
  588. public const int VI_ERROR_FILE_IO = -1073807198;
  589. public const int VI_ERROR_NSUP_LINE = -1073807197;
  590. public const int VI_ERROR_NSUP_MECH = -1073807196;
  591. public const int VI_ERROR_INTF_NUM_NCONFIG = -1073807195;
  592. public const int VI_ERROR_CONN_LOST = -1073807194;
  593. public const int VI_ERROR_NPERMISSION = -1073807192;
  594. #endregion
  595. #region - Other VISA Definitions ------------------------------------------------
  596. public const short VI_FIND_BUFLEN = 256;
  597. public const short VI_NULL = 0;
  598. public const short VI_TRUE = 1;
  599. public const short VI_FALSE = 0;
  600. public const short VI_INTF_GPIB = 1;
  601. public const short VI_INTF_VXI = 2;
  602. public const short VI_INTF_GPIB_VXI = 3;
  603. public const short VI_INTF_ASRL = 4;
  604. public const short VI_INTF_TCPIP = 6;
  605. public const short VI_INTF_USB = 7;
  606. public const short VI_PROT_NORMAL = 1;
  607. public const short VI_PROT_FDC = 2;
  608. public const short VI_PROT_HS488 = 3;
  609. public const short VI_PROT_4882_STRS = 4;
  610. public const short VI_PROT_USBTMC_VENDOR = 5;
  611. public const short VI_FDC_NORMAL = 1;
  612. public const short VI_FDC_STREAM = 2;
  613. public const short VI_LOCAL_SPACE = 0;
  614. public const short VI_A16_SPACE = 1;
  615. public const short VI_A24_SPACE = 2;
  616. public const short VI_A32_SPACE = 3;
  617. public const short VI_OPAQUE_SPACE = -1;
  618. public const short VI_UNKNOWN_LA = -1;
  619. public const short VI_UNKNOWN_SLOT = -1;
  620. public const short VI_UNKNOWN_LEVEL = -1;
  621. public const short VI_QUEUE = 1;
  622. public const short VI_HNDLR = 2;
  623. public const short VI_SUSPEND_HNDLR = 4;
  624. public const short VI_ALL_MECH = -1;
  625. public const short VI_ANY_HNDLR = 0;
  626. public const short VI_TRIG_ALL = -2;
  627. public const short VI_TRIG_SW = -1;
  628. public const short VI_TRIG_TTL0 = 0;
  629. public const short VI_TRIG_TTL1 = 1;
  630. public const short VI_TRIG_TTL2 = 2;
  631. public const short VI_TRIG_TTL3 = 3;
  632. public const short VI_TRIG_TTL4 = 4;
  633. public const short VI_TRIG_TTL5 = 5;
  634. public const short VI_TRIG_TTL6 = 6;
  635. public const short VI_TRIG_TTL7 = 7;
  636. public const short VI_TRIG_ECL0 = 8;
  637. public const short VI_TRIG_ECL1 = 9;
  638. public const short VI_TRIG_PANEL_IN = 27;
  639. public const short VI_TRIG_PANEL_OUT = 28;
  640. public const short VI_TRIG_PROT_DEFAULT = 0;
  641. public const short VI_TRIG_PROT_ON = 1;
  642. public const short VI_TRIG_PROT_OFF = 2;
  643. public const short VI_TRIG_PROT_SYNC = 5;
  644. public const short VI_READ_BUF = 1;
  645. public const short VI_WRITE_BUF = 2;
  646. public const short VI_READ_BUF_DISCARD = 4;
  647. public const short VI_WRITE_BUF_DISCARD = 8;
  648. public const short VI_IO_IN_BUF = 16;
  649. public const short VI_IO_OUT_BUF = 32;
  650. public const short VI_IO_IN_BUF_DISCARD = 64;
  651. public const short VI_IO_OUT_BUF_DISCARD = 128;
  652. public const short VI_FLUSH_ON_ACCESS = 1;
  653. public const short VI_FLUSH_WHEN_FULL = 2;
  654. public const short VI_FLUSH_DISABLE = 3;
  655. public const short VI_NMAPPED = 1;
  656. public const short VI_USE_OPERS = 2;
  657. public const short VI_DEREF_ADDR = 3;
  658. public const int VI_TMO_IMMEDIATE = 0;
  659. public const int VI_TMO_INFINITE = -1;
  660. public const short VI_NO_LOCK = 0;
  661. public const short VI_EXCLUSIVE_LOCK = 1;
  662. public const short VI_SHARED_LOCK = 2;
  663. public const short VI_LOAD_CONFIG = 4;
  664. public const short VI_NO_SEC_ADDR = -1;
  665. public const short VI_ASRL_PAR_NONE = 0;
  666. public const short VI_ASRL_PAR_ODD = 1;
  667. public const short VI_ASRL_PAR_EVEN = 2;
  668. public const short VI_ASRL_PAR_MARK = 3;
  669. public const short VI_ASRL_PAR_SPACE = 4;
  670. public const short VI_ASRL_STOP_ONE = 10;
  671. public const short VI_ASRL_STOP_ONE5 = 15;
  672. public const short VI_ASRL_STOP_TWO = 20;
  673. public const short VI_ASRL_FLOW_NONE = 0;
  674. public const short VI_ASRL_FLOW_XON_XOFF = 1;
  675. public const short VI_ASRL_FLOW_RTS_CTS = 2;
  676. public const short VI_ASRL_FLOW_DTR_DSR = 4;
  677. public const short VI_ASRL_END_NONE = 0;
  678. public const short VI_ASRL_END_LAST_BIT = 1;
  679. public const short VI_ASRL_END_TERMCHAR = 2;
  680. public const short VI_ASRL_END_BREAK = 3;
  681. public const short VI_STATE_ASSERTED = 1;
  682. public const short VI_STATE_UNASSERTED = 0;
  683. public const short VI_STATE_UNKNOWN = -1;
  684. public const short VI_BIG_ENDIAN = 0;
  685. public const short VI_LITTLE_ENDIAN = 1;
  686. public const short VI_DATA_PRIV = 0;
  687. public const short VI_DATA_NPRIV = 1;
  688. public const short VI_PROG_PRIV = 2;
  689. public const short VI_PROG_NPRIV = 3;
  690. public const short VI_BLCK_PRIV = 4;
  691. public const short VI_BLCK_NPRIV = 5;
  692. public const short VI_D64_PRIV = 6;
  693. public const short VI_D64_NPRIV = 7;
  694. public const short VI_WIDTH_8 = 1;
  695. public const short VI_WIDTH_16 = 2;
  696. public const short VI_WIDTH_32 = 4;
  697. public const short VI_GPIB_REN_DEASSERT = 0;
  698. public const short VI_GPIB_REN_ASSERT = 1;
  699. public const short VI_GPIB_REN_DEASSERT_GTL = 2;
  700. public const short VI_GPIB_REN_ASSERT_ADDRESS = 3;
  701. public const short VI_GPIB_REN_ASSERT_LLO = 4;
  702. public const short VI_GPIB_REN_ASSERT_ADDRESS_LLO = 5;
  703. public const short VI_GPIB_REN_ADDRESS_GTL = 6;
  704. public const short VI_GPIB_ATN_DEASSERT = 0;
  705. public const short VI_GPIB_ATN_ASSERT = 1;
  706. public const short VI_GPIB_ATN_DEASSERT_HANDSHAKE = 2;
  707. public const short VI_GPIB_ATN_ASSERT_IMMEDIATE = 3;
  708. public const short VI_GPIB_HS488_DISABLED = 0;
  709. public const short VI_GPIB_HS488_NIMPL = -1;
  710. public const short VI_GPIB_UNADDRESSED = 0;
  711. public const short VI_GPIB_TALKER = 1;
  712. public const short VI_GPIB_LISTENER = 2;
  713. public const short VI_VXI_CMD16 = 512;
  714. public const short VI_VXI_CMD16_RESP16 = 514;
  715. public const short VI_VXI_RESP16 = 2;
  716. public const short VI_VXI_CMD32 = 1024;
  717. public const short VI_VXI_CMD32_RESP16 = 1026;
  718. public const short VI_VXI_CMD32_RESP32 = 1028;
  719. public const short VI_VXI_RESP32 = 4;
  720. public const short VI_ASSERT_SIGNAL = -1;
  721. public const short VI_ASSERT_USE_ASSIGNED = 0;
  722. public const short VI_ASSERT_IRQ1 = 1;
  723. public const short VI_ASSERT_IRQ2 = 2;
  724. public const short VI_ASSERT_IRQ3 = 3;
  725. public const short VI_ASSERT_IRQ4 = 4;
  726. public const short VI_ASSERT_IRQ5 = 5;
  727. public const short VI_ASSERT_IRQ6 = 6;
  728. public const short VI_ASSERT_IRQ7 = 7;
  729. public const short VI_UTIL_ASSERT_SYSRESET = 1;
  730. public const short VI_UTIL_ASSERT_SYSFAIL = 2;
  731. public const short VI_UTIL_DEASSERT_SYSFAIL = 3;
  732. public const short VI_VXI_CLASS_MEMORY = 0;
  733. public const short VI_VXI_CLASS_EXTENDED = 1;
  734. public const short VI_VXI_CLASS_MESSAGE = 2;
  735. public const short VI_VXI_CLASS_REGISTER = 3;
  736. public const short VI_VXI_CLASS_OTHER = 4;
  737. #endregion
  738. #region - Backward Compatibility Macros -----------------------------------------
  739. public const int VI_ERROR_INV_SESSION = -1073807346;
  740. public const int VI_INFINITE = -1;
  741. public const short VI_NORMAL = 1;
  742. public const short VI_FDC = 2;
  743. public const short VI_HS488 = 3;
  744. public const short VI_ASRL488 = 4;
  745. public const short VI_ASRL_IN_BUF = 16;
  746. public const short VI_ASRL_OUT_BUF = 32;
  747. public const short VI_ASRL_IN_BUF_DISCARD = 64;
  748. public const short VI_ASRL_OUT_BUF_DISCARD = 128;
  749. #endregion
  750. #endregion
  751. }