ps2000aApi.h 117 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948
  1. /****************************************************************************
  2. *
  3. * Filename: ps2000aApi.h
  4. * Author: MAS
  5. * Description:
  6. *
  7. * This header defines the interface to driver routines for the
  8. * PicoScope 2000A and 2000B Series, and 2205 MSO PC Oscilloscopes.
  9. *
  10. * Copyright � 2010 - 2022 Pico Technology Ltd. All rights reserved.
  11. *
  12. ****************************************************************************/
  13. #ifndef __PS2000AAPI_H__
  14. #define __PS2000AAPI_H__
  15. #include <stdint.h>
  16. #include "PicoStatus.h"
  17. #ifdef __cplusplus
  18. #define PREF0 extern "C"
  19. #define TYPE_ENUM
  20. #else
  21. #define PREF0
  22. #define TYPE_ENUM enum
  23. #endif
  24. #ifdef WIN32
  25. #ifdef PREF1
  26. #undef PREF1
  27. #endif
  28. #ifdef PREF2
  29. #undef PREF2
  30. #endif
  31. #ifdef PREF3
  32. #undef PREF3
  33. #endif
  34. /* If you are dynamically linking ps2000a.dll into your project #define DYNLINK here
  35. */
  36. #ifdef DYNLINK
  37. #define PREF1 typedef
  38. #define PREF2
  39. #define PREF3(x) (__stdcall *x)
  40. #else
  41. #define PREF1
  42. #ifdef _USRDLL
  43. #define PREF2 __declspec(dllexport) __stdcall
  44. #else
  45. #define PREF2 __declspec(dllimport) __stdcall
  46. #endif
  47. #define PREF3(x) x
  48. #endif
  49. #else
  50. /* Define a 64-bit integer type */
  51. #ifdef DYNLINK
  52. #define PREF1 typedef
  53. #define PREF2
  54. #define PREF3(x) (*x)
  55. #else
  56. #ifdef _USRDLL
  57. #define PREF1 __attribute__((visibility("default")))
  58. #else
  59. #define PREF1
  60. #endif
  61. #define PREF2
  62. #define PREF3(x) x
  63. #endif
  64. #define __stdcall
  65. #endif
  66. /* Depending on the adc; oversample (collect multiple readings at each time) by up to 256.
  67. * the results are therefore ALWAYS scaled up to 16-bits, even if
  68. * oversampling is not used.
  69. *
  70. * The maximum and minimum values returned are therefore as follows:
  71. */
  72. // covers the PS2208 and PS2208A
  73. #define PS2208_MAX_ETS_CYCLES 500
  74. #define PS2208_MAX_INTERLEAVE 20
  75. // covers the PS2207 and PS2207A
  76. #define PS2207_MAX_ETS_CYCLES 500
  77. #define PS2207_MAX_INTERLEAVE 20
  78. // covers the PS2206 and PS2206A
  79. #define PS2206_MAX_ETS_CYCLES 250
  80. #define PS2206_MAX_INTERLEAVE 10
  81. #define PS2000A_EXT_MAX_VALUE 32767
  82. #define PS2000A_EXT_MIN_VALUE -32767
  83. #define PS2000A_MAX_LOGIC_LEVEL 32767
  84. #define PS2000A_MIN_LOGIC_LEVEL -32767
  85. #define MIN_SIG_GEN_FREQ 0.0f
  86. #define MAX_SIG_GEN_FREQ 20000000.0f
  87. #define PS2000A_MAX_SIG_GEN_BUFFER_SIZE 8192
  88. #define PS2000A_MIN_SIG_GEN_BUFFER_SIZE 1
  89. #define PS2000A_MIN_DWELL_COUNT 3
  90. #define PS2000A_MAX_SWEEPS_SHOTS ((1 << 30) - 1)
  91. #define PS2000A_MAX_ANALOGUE_OFFSET_50MV_200MV 0.250f
  92. #define PS2000A_MIN_ANALOGUE_OFFSET_50MV_200MV -0.250f
  93. #define PS2000A_MAX_ANALOGUE_OFFSET_500MV_2V 2.500f
  94. #define PS2000A_MIN_ANALOGUE_OFFSET_500MV_2V -2.500f
  95. #define PS2000A_MAX_ANALOGUE_OFFSET_5V_20V 20.f
  96. #define PS2000A_MIN_ANALOGUE_OFFSET_5V_20V -20.f
  97. // supported by the PS2206/PS2206A, PS2207/PS2207A, PS2208/PS2208A only
  98. #define PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN 0xFFFFFFFF
  99. /// <summary>
  100. /// The analogue channels index
  101. /// </summary>
  102. typedef enum enPS2000AChannelBufferIndex
  103. {
  104. PS2000A_CHANNEL_A_MAX,
  105. PS2000A_CHANNEL_A_MIN,
  106. PS2000A_CHANNEL_B_MAX,
  107. PS2000A_CHANNEL_B_MIN,
  108. PS2000A_CHANNEL_C_MAX,
  109. PS2000A_CHANNEL_C_MIN,
  110. PS2000A_CHANNEL_D_MAX,
  111. PS2000A_CHANNEL_D_MIN,
  112. PS2000A_MAX_CHANNEL_BUFFERS
  113. } PS2000A_CHANNEL_BUFFER_INDEX;
  114. /// <summary>
  115. /// The analogue channels and trigger channels supported by the devices
  116. /// </summary>
  117. typedef enum enPS2000AChannel
  118. {
  119. PS2000A_CHANNEL_A,
  120. PS2000A_CHANNEL_B,
  121. PS2000A_CHANNEL_C,
  122. PS2000A_CHANNEL_D,
  123. PS2000A_EXTERNAL,
  124. PS2000A_MAX_CHANNELS = PS2000A_EXTERNAL,
  125. PS2000A_TRIGGER_AUX,
  126. PS2000A_MAX_TRIGGER_SOURCES
  127. } PS2000A_CHANNEL;
  128. /// <summary>
  129. /// MSO models only.
  130. /// Defines how the analgoue and digital triggers are combined.
  131. /// </summary>
  132. typedef enum enPS2000ATriggerOperand
  133. {
  134. /// <summary>
  135. /// Ignore the trigger settings
  136. /// </summary>
  137. PS2000A_OPERAND_NONE,
  138. /// <summary>
  139. /// Fire when either trigger is activated.
  140. /// </summary>
  141. PS2000A_OPERAND_OR,
  142. /// <summary>
  143. /// Fire when both triggers are activated
  144. /// </summary>
  145. PS2000A_OPERAND_AND,
  146. /// <summary>
  147. /// Fire when one trigger is activated.
  148. /// </summary>
  149. PS2000A_OPERAND_THEN
  150. } PS2000A_TRIGGER_OPERAND;
  151. /// <summary>
  152. /// MSO ports
  153. /// </summary>
  154. typedef enum enPS2000DigitalPort
  155. {
  156. PS2000A_DIGITAL_PORT0 = 0x80, // digital channel 0 - 7
  157. PS2000A_DIGITAL_PORT1, // digital channel 8 - 15
  158. PS2000A_DIGITAL_PORT2, // digital channel 16 - 23
  159. PS2000A_DIGITAL_PORT3, // digital channel 24 - 31
  160. PS2000A_MAX_DIGITAL_PORTS = (PS2000A_DIGITAL_PORT3 - PS2000A_DIGITAL_PORT0) + 1
  161. } PS2000A_DIGITAL_PORT;
  162. /// <summary>
  163. /// MSO digital channels
  164. /// </summary>
  165. typedef enum enPS2000ADigitalChannel
  166. {
  167. PS2000A_DIGITAL_CHANNEL_0,
  168. PS2000A_DIGITAL_CHANNEL_1,
  169. PS2000A_DIGITAL_CHANNEL_2,
  170. PS2000A_DIGITAL_CHANNEL_3,
  171. PS2000A_DIGITAL_CHANNEL_4,
  172. PS2000A_DIGITAL_CHANNEL_5,
  173. PS2000A_DIGITAL_CHANNEL_6,
  174. PS2000A_DIGITAL_CHANNEL_7,
  175. PS2000A_DIGITAL_CHANNEL_8,
  176. PS2000A_DIGITAL_CHANNEL_9,
  177. PS2000A_DIGITAL_CHANNEL_10,
  178. PS2000A_DIGITAL_CHANNEL_11,
  179. PS2000A_DIGITAL_CHANNEL_12,
  180. PS2000A_DIGITAL_CHANNEL_13,
  181. PS2000A_DIGITAL_CHANNEL_14,
  182. PS2000A_DIGITAL_CHANNEL_15,
  183. PS2000A_DIGITAL_CHANNEL_16,
  184. PS2000A_DIGITAL_CHANNEL_17,
  185. PS2000A_DIGITAL_CHANNEL_18,
  186. PS2000A_DIGITAL_CHANNEL_19,
  187. PS2000A_DIGITAL_CHANNEL_20,
  188. PS2000A_DIGITAL_CHANNEL_21,
  189. PS2000A_DIGITAL_CHANNEL_22,
  190. PS2000A_DIGITAL_CHANNEL_23,
  191. PS2000A_DIGITAL_CHANNEL_24,
  192. PS2000A_DIGITAL_CHANNEL_25,
  193. PS2000A_DIGITAL_CHANNEL_26,
  194. PS2000A_DIGITAL_CHANNEL_27,
  195. PS2000A_DIGITAL_CHANNEL_28,
  196. PS2000A_DIGITAL_CHANNEL_29,
  197. PS2000A_DIGITAL_CHANNEL_30,
  198. PS2000A_DIGITAL_CHANNEL_31,
  199. PS2000A_MAX_DIGITAL_CHANNELS
  200. } PS2000A_DIGITAL_CHANNEL;
  201. /// <summary>
  202. /// Ranges that the channels are set to:
  203. /// Not all ranges are supported by every variant
  204. /// </summary>
  205. typedef enum enPS2000ARange
  206. {
  207. PS2000A_10MV,
  208. PS2000A_20MV,
  209. PS2000A_50MV,
  210. PS2000A_100MV,
  211. PS2000A_200MV,
  212. PS2000A_500MV,
  213. PS2000A_1V,
  214. PS2000A_2V,
  215. PS2000A_5V,
  216. PS2000A_10V,
  217. PS2000A_20V,
  218. PS2000A_50V,
  219. PS2000A_MAX_RANGES,
  220. } PS2000A_RANGE;
  221. /// <summary>
  222. /// Available coupling modes.
  223. /// </summary>
  224. typedef enum enPS2000ACoupling
  225. {
  226. PS2000A_AC,
  227. PS2000A_DC
  228. } PS2000A_COUPLING;
  229. typedef enum enPS2000AChannelInfo
  230. {
  231. PS2000A_CI_RANGES,
  232. } PS2000A_CHANNEL_INFO;
  233. /// <summary>
  234. /// Ets modes avialable
  235. /// </summary>
  236. typedef enum enPS2000AEtsMode
  237. {
  238. /// <summary>
  239. /// disables
  240. /// </summary>
  241. PS2000A_ETS_OFF,
  242. /// <summary>
  243. /// enables ETS and provides etsCycles of data, which may contain data from previously returned cycles.
  244. /// </summary>
  245. PS2000A_ETS_FAST,
  246. /// <summary>
  247. /// enables ETS and provides fresh data every etsCycles. This
  248. /// mode takes longer to provide each data set, but the data sets are more stable and
  249. /// are guaranteed to contain only new data.
  250. /// </summary>
  251. PS2000A_ETS_SLOW,
  252. PS2000A_ETS_MODES_MAX
  253. } PS2000A_ETS_MODE;
  254. /// <summary>
  255. /// Time units that the time paramaters are using.
  256. /// </summary>
  257. typedef enum enPS2000ATimeUnits
  258. {
  259. PS2000A_FS,
  260. PS2000A_PS,
  261. PS2000A_NS,
  262. PS2000A_US,
  263. PS2000A_MS,
  264. PS2000A_S,
  265. PS2000A_MAX_TIME_UNITS,
  266. } PS2000A_TIME_UNITS;
  267. /// <summary>
  268. /// whether the frequency will sweep from startFrequency to
  269. /// stopFrequency, or in the opposite direction, or repeatedly reverse direction
  270. /// </summary>
  271. typedef enum enPS2000ASweepType
  272. {
  273. PS2000A_UP,
  274. PS2000A_DOWN,
  275. PS2000A_UPDOWN,
  276. PS2000A_DOWNUP,
  277. PS2000A_MAX_SWEEP_TYPES
  278. } PS2000A_SWEEP_TYPE;
  279. /// <summary>
  280. /// Built in waveform types
  281. /// </summary>
  282. typedef enum enPS2000AWaveType
  283. {
  284. PS2000A_SINE,
  285. PS2000A_SQUARE,
  286. PS2000A_TRIANGLE,
  287. PS2000A_RAMP_UP,
  288. PS2000A_RAMP_DOWN,
  289. PS2000A_SINC,
  290. PS2000A_GAUSSIAN,
  291. PS2000A_HALF_SINE,
  292. PS2000A_DC_VOLTAGE,
  293. PS2000A_MAX_WAVE_TYPES
  294. } PS2000A_WAVE_TYPE;
  295. /// <summary>
  296. /// The type of waveform to be produced, specified by one of the following
  297. /// </summary>
  298. typedef enum enPS2000AExtraOperations
  299. {
  300. /// <summary>
  301. /// Normal signal generator operation specified by wavetype.
  302. /// </summary>
  303. PS2000A_ES_OFF,
  304. /// <summary>
  305. /// The signal generator produces white noise and ignores all settings except pkToPk and offsetVoltage.
  306. /// </summary>
  307. PS2000A_WHITENOISE,
  308. /// <summary>
  309. /// produces a pseudorandom random binary sequence with a bit rate
  310. /// specified by the start and stop frequency.
  311. /// </summary>
  312. PS2000A_PRBS // Pseudo-Random Bit Stream
  313. } PS2000A_EXTRA_OPERATIONS;
  314. #define PS2000A_SINE_MAX_FREQUENCY 1000000.f
  315. #define PS2000A_SQUARE_MAX_FREQUENCY 1000000.f
  316. #define PS2000A_TRIANGLE_MAX_FREQUENCY 1000000.f
  317. #define PS2000A_SINC_MAX_FREQUENCY 1000000.f
  318. #define PS2000A_RAMP_MAX_FREQUENCY 1000000.f
  319. #define PS2000A_HALF_SINE_MAX_FREQUENCY 1000000.f
  320. #define PS2000A_GAUSSIAN_MAX_FREQUENCY 1000000.f
  321. #define PS2000A_PRBS_MAX_FREQUENCY 1000000.f
  322. #define PS2000A_PRBS_MIN_FREQUENCY 0.03f
  323. #define PS2000A_MIN_FREQUENCY 0.03f
  324. /// <summary>
  325. /// The type of trigger that will be applied to the signal generator
  326. /// </summary>
  327. typedef enum enPS2000ASigGenTrigType
  328. {
  329. /// <summary>
  330. /// Trigger on rising edge
  331. /// </summary>
  332. PS2000A_SIGGEN_RISING,
  333. /// <summary>
  334. /// Trigger on falling edge
  335. /// </summary>
  336. PS2000A_SIGGEN_FALLING,
  337. /// <summary>
  338. /// Run while trigger is high
  339. /// </summary>
  340. PS2000A_SIGGEN_GATE_HIGH,
  341. /// <summary>
  342. /// Run while trigger is low
  343. /// </summary>
  344. PS2000A_SIGGEN_GATE_LOW
  345. } PS2000A_SIGGEN_TRIG_TYPE;
  346. /// <summary>
  347. /// The source that will trigger the signal generator
  348. /// </summary>
  349. typedef enum enPS2000ASigGenTrigSource
  350. {
  351. /// <summary>
  352. /// Run without waiting for trigger
  353. /// </summary>
  354. PS2000A_SIGGEN_NONE,
  355. /// <summary>
  356. /// Use scope trigger
  357. /// </summary
  358. PS2000A_SIGGEN_SCOPE_TRIG,
  359. /// <summary>
  360. /// Use AUXIO input
  361. /// </summary>
  362. PS2000A_SIGGEN_AUX_IN,
  363. /// <summary>
  364. /// Use external input
  365. /// </summary>
  366. PS2000A_SIGGEN_EXT_IN,
  367. /// <summary>
  368. /// Wait for software trigger
  369. /// </summary>
  370. PS2000A_SIGGEN_SOFT_TRIG
  371. } PS2000A_SIGGEN_TRIG_SOURCE;
  372. /// <summary>
  373. /// AWG index modes
  374. /// </summary>
  375. typedef enum enPS2000AIndexMode
  376. {
  377. /// <summary>
  378. /// The generator outputs the raw contents of the buffer repeatedly .
  379. /// </summary>
  380. PS2000A_SINGLE,
  381. /// <summary>
  382. /// The generator outputs the contents of the buffer from beginning to end, and then does a second pass in the reverse
  383. /// direction through the buffer
  384. /// </summary>
  385. PS2000A_DUAL,
  386. /// <summary>
  387. /// This is similiar to the Dual but passes through the buffer four time inverting, and inverting reversed
  388. /// </summary>
  389. PS2000A_QUAD,
  390. PS2000A_MAX_INDEX_MODES
  391. } PS2000A_INDEX_MODE;
  392. /// <summary>
  393. /// The number of thershold that will be used for triggering.
  394. /// </summary>
  395. typedef enum enPS2000A_ThresholdMode
  396. {
  397. PS2000A_LEVEL,
  398. PS2000A_WINDOW
  399. } PS2000A_THRESHOLD_MODE;
  400. /// <summary>
  401. /// The direction that the signal will pass through the trigger.
  402. /// </summary>
  403. typedef enum enPS2000AThresholdDirection
  404. {
  405. /// <summary>
  406. /// For gated triggers: above the upper threshold.
  407. /// </summary>
  408. PS2000A_ABOVE,
  409. /// <summary>
  410. /// For gated triggers: below the upper threshold.
  411. /// </summary
  412. PS2000A_BELOW,
  413. /// <summary>
  414. /// For threshold triggers: rising edge, using upper threshold.
  415. /// </summary>
  416. PS2000A_RISING,
  417. /// <summary>
  418. /// For threshold triggers: falling edge, using upper threshold.
  419. /// </summary>
  420. PS2000A_FALLING,
  421. /// <summary>
  422. /// For threshold triggers: either edge.
  423. /// </summary>
  424. PS2000A_RISING_OR_FALLING,
  425. /// <summary>
  426. /// For gated triggers: above the lower threshold.
  427. /// </summary>
  428. PS2000A_ABOVE_LOWER,
  429. /// <summary>
  430. /// For gated triggers: below the lower threshold.
  431. /// </summary>
  432. PS2000A_BELOW_LOWER,
  433. /// <summary>
  434. /// For threshold triggers: rising edge, using lower threshold.
  435. /// </summary>
  436. PS2000A_RISING_LOWER,
  437. /// <summary>
  438. /// For threshold triggers: falling edge, using lower threshold.
  439. /// </summary>
  440. PS2000A_FALLING_LOWER,
  441. /// <summary>
  442. /// For window-qualified triggers: inside window.
  443. /// </summary>
  444. PS2000A_INSIDE = PS2000A_ABOVE,
  445. /// <summary>
  446. /// For window-qualified triggers: outside window.
  447. /// </summary>
  448. PS2000A_OUTSIDE = PS2000A_BELOW,
  449. /// <summary>
  450. /// For window triggers: entering the window.
  451. /// </summary>
  452. PS2000A_ENTER = PS2000A_RISING,
  453. /// <summary>
  454. /// For window triggers: leaving the window.
  455. /// </summary>
  456. PS2000A_EXIT = PS2000A_FALLING,
  457. /// <summary>
  458. /// For window triggers: either entering or leaving the window.
  459. /// </summary>
  460. PS2000A_ENTER_OR_EXIT = PS2000A_RISING_OR_FALLING,
  461. /// <summary>
  462. /// For window-qualified triggers.
  463. /// </summary>
  464. PS2000A_POSITIVE_RUNT = 9,
  465. /// <summary>
  466. /// For window-qualified triggers.
  467. /// </summary>
  468. PS2000A_NEGATIVE_RUNT,
  469. /// <summary>
  470. /// No trigger.
  471. /// </summary>
  472. PS2000A_NONE = PS2000A_RISING
  473. } PS2000A_THRESHOLD_DIRECTION;
  474. /// <summary>
  475. /// Digital channel trigger dirction
  476. /// </summary>
  477. typedef enum enPS2000ADigitalDirection
  478. {
  479. PS2000A_DIGITAL_DONT_CARE,
  480. PS2000A_DIGITAL_DIRECTION_LOW,
  481. PS2000A_DIGITAL_DIRECTION_HIGH,
  482. PS2000A_DIGITAL_DIRECTION_RISING,
  483. PS2000A_DIGITAL_DIRECTION_FALLING,
  484. PS2000A_DIGITAL_DIRECTION_RISING_OR_FALLING,
  485. PS2000A_DIGITAL_MAX_DIRECTION
  486. } PS2000A_DIGITAL_DIRECTION;
  487. /// <summary>
  488. /// The type of condition that should be applied to each channel.
  489. /// The channels that are set to True or False must all meet their conditions
  490. /// simultaneously to produce a trigger. Channels set to DontCare are ignored.
  491. /// </summary>
  492. typedef enum enPS2000ATriggerState
  493. {
  494. PS2000A_CONDITION_DONT_CARE,
  495. PS2000A_CONDITION_TRUE,
  496. PS2000A_CONDITION_FALSE,
  497. PS2000A_CONDITION_MAX
  498. } PS2000A_TRIGGER_STATE;
  499. /// <summary>
  500. /// A structure of this type is passed to ps2000aSetTriggerChannelConditions in the
  501. /// conditions argument to specify the trigger conditions.
  502. /// </summary>
  503. #pragma pack(push,1)
  504. typedef struct tPS2000ATriggerConditions
  505. {
  506. PS2000A_TRIGGER_STATE channelA;
  507. PS2000A_TRIGGER_STATE channelB;
  508. PS2000A_TRIGGER_STATE channelC;
  509. PS2000A_TRIGGER_STATE channelD;
  510. PS2000A_TRIGGER_STATE external;
  511. PS2000A_TRIGGER_STATE aux;
  512. PS2000A_TRIGGER_STATE pulseWidthQualifier;
  513. PS2000A_TRIGGER_STATE digital;
  514. } PS2000A_TRIGGER_CONDITIONS;
  515. #pragma pack(pop)
  516. /// <summary>
  517. /// A structure of this type is passed to ps2000aSetPulseWidthQualifier in the
  518. /// conditions argument to specify the trigger conditions.
  519. /// Analog-input models only ( for MSOs use PwqConditionsV2)
  520. /// </summary>
  521. #pragma pack(push,1)
  522. typedef struct tPS2000APwqConditions
  523. {
  524. PS2000A_TRIGGER_STATE channelA;
  525. PS2000A_TRIGGER_STATE channelB;
  526. PS2000A_TRIGGER_STATE channelC;
  527. PS2000A_TRIGGER_STATE channelD;
  528. PS2000A_TRIGGER_STATE external;
  529. PS2000A_TRIGGER_STATE aux;
  530. PS2000A_TRIGGER_STATE digital;
  531. } PS2000A_PWQ_CONDITIONS;
  532. #pragma pack(pop)
  533. /// <summary>
  534. /// A structure of this type is passed to ps2000aSetTriggerChannelDirections in
  535. /// the directions argument to specify the trigger direction for a specified source.
  536. /// Not all driver series support this method.
  537. /// </summary>
  538. #pragma pack(push,1)
  539. typedef struct tPS2000ADigitalChannelDirections
  540. {
  541. /// <summary>
  542. /// The channel being configured. Channels supported by series SetChannel for allowable values.
  543. /// </summary>
  544. PS2000A_DIGITAL_CHANNEL channel;
  545. /// <summary>
  546. /// The trigger direction that should be applied to each channel.
  547. /// </summary>
  548. PS2000A_DIGITAL_DIRECTION direction;
  549. } PS2000A_DIGITAL_CHANNEL_DIRECTIONS;
  550. #pragma pack(pop)
  551. /// <summary>
  552. /// A structure of this type is passed to ps2000aSetTriggerChannelProperties in the
  553. /// channelProperties argument to specify the trigger mechanism.
  554. /// All values are scaled in 16-bit ADC counts at the currently selected range for that channel.
  555. /// </summary>
  556. #pragma pack(push,1)
  557. typedef struct tPS2000ATriggerChannelProperties
  558. {
  559. /// <summary>
  560. /// The upper threshold at which the trigger must fire
  561. /// </summary>
  562. int16_t thresholdUpper;
  563. /// <summary>
  564. /// The hysteresis by which the trigger must exceed the upper threshold before it will fire.
  565. /// </summary>
  566. uint16_t thresholdUpperHysteresis;
  567. /// <summary>
  568. /// The lower threshold at which the trigger must fire.
  569. /// </summary>
  570. int16_t thresholdLower;
  571. /// <summary>
  572. /// The hysteresis by which the trigger must exceed the lower threshold before it will fire.
  573. /// </summary>
  574. uint16_t thresholdLowerHysteresis;
  575. /// <summary>
  576. /// The channel to which the properties apply
  577. /// </summary>
  578. PS2000A_CHANNEL channel;
  579. /// <summary>
  580. /// Either a level or window trigger
  581. /// </summary>
  582. PS2000A_THRESHOLD_MODE thresholdMode;
  583. } PS2000A_TRIGGER_CHANNEL_PROPERTIES;
  584. #pragma pack(pop)
  585. /// <summary>
  586. /// Various methods of data reduction.
  587. /// Note that a single call to setting the buffers (ie. ps2000aSetDataBuffer) can only
  588. /// associate one buffer with one downsampling mode. If you intend to retrieve more than one
  589. /// downsampling mode from the get values functions, you must call set data buffer several
  590. /// times to associate a separate buffer with each channel and downsampling mode.
  591. /// </summary>
  592. typedef enum enPS2000ARatioMode
  593. {
  594. /// <summary>
  595. /// No downsampling. Returns the raw data values.
  596. /// </summary>
  597. PS2000A_RATIO_MODE_NONE,
  598. /// <summary>
  599. /// Reduces every block of n values to just two values: a minimum and a maximum.
  600. /// The minimum and maximum values are returned in two separate buffers.
  601. /// </summary>
  602. PS2000A_RATIO_MODE_AGGREGATE = 1,
  603. /// <summary>
  604. /// Reduces every block of n values to a single value representing the
  605. /// average (arithmetic mean) of all the values.
  606. /// </summary>
  607. PS2000A_RATIO_MODE_DECIMATE = 2,
  608. /// <summary>
  609. /// Reduces every block of n values to just the first value in the block,
  610. /// discarding all the other values.
  611. /// </summary>
  612. PS2000A_RATIO_MODE_AVERAGE = 4,
  613. } PS2000A_RATIO_MODE;
  614. /// <summary>
  615. /// The pulse-width type.
  616. /// </summary>
  617. typedef enum enPS2000APulseWidthType
  618. {
  619. /// <summary>
  620. /// Do not use the pulse width qualifier
  621. /// </summary>
  622. PS2000A_PW_TYPE_NONE,
  623. /// <summary>
  624. /// Pulse width less than lower pulse width counter
  625. /// </summary>
  626. PS2000A_PW_TYPE_LESS_THAN,
  627. /// <summary>
  628. /// Pulse width greater than lower pulse width counter
  629. /// </summary>
  630. PS2000A_PW_TYPE_GREATER_THAN,
  631. /// <summary>
  632. /// Pulse width between lower and upper pulsee width counter
  633. /// </summary>
  634. PS2000A_PW_TYPE_IN_RANGE,
  635. /// <summary>
  636. /// Pulse width not between lower and upper pulse width counter
  637. /// </summary>
  638. PS2000A_PW_TYPE_OUT_OF_RANGE
  639. } PS2000A_PULSE_WIDTH_TYPE;
  640. typedef enum enPS2000AHoldOffType
  641. {
  642. PS2000A_TIME,
  643. PS2000A_MAX_HOLDOFF_TYPE
  644. } PS2000A_HOLDOFF_TYPE;
  645. #pragma pack(push,1)
  646. typedef struct tPS2000AScalingFactors
  647. {
  648. PS2000A_CHANNEL channelOrPort;
  649. PS2000A_RANGE range;
  650. int16_t offset;
  651. double scalingFactor;
  652. }PS2000A_SCALING_FACTORS_VALUES;
  653. #pragma pack(pop)
  654. /// <summary>
  655. /// This callback function is part of your application. You register it with the ps3000a
  656. /// driver using series RunBlock, and the driver calls it back when block-mode data is
  657. /// ready. You can then download the data using series GetValues.
  658. /// </summary>
  659. /// <param name="handle">Device identifier returned by OpenUnit.</param>
  660. /// <param name="status">Indicates whether an error occurred during collection of the data.</param>
  661. /// <param name="pParameter">A void pointer passed from series RunBlock. Your callback function can write to this
  662. /// location to send any data, such as a status flag, back to your application.</param>
  663. typedef void (__stdcall *ps2000aBlockReady)
  664. (
  665. int16_t handle,
  666. PICO_STATUS status,
  667. void * pParameter
  668. );
  669. /// <summary>
  670. /// This callback function is part of your application. You register it with the driver using
  671. /// series GetStreamingLatestValues, and the driver calls it back when streaming- mode data is
  672. /// ready. You can then download the data using the series GetValuesAsync function.
  673. /// </summary>
  674. /// <param name="handle">Device identifier returned by OpenUnit.</param>
  675. /// <param name="noOfSamples">The number of samples available.</param>
  676. /// <param name="startIndex">An index to the first valid sample in the buffer. This is
  677. /// the buffer that was previously passed to series SetDataBuffer.</param>
  678. /// <param name="overflow">Returns a set of flags that indicate whether an overvoltage has occurred
  679. /// on any of the channels.It is a bit pattern with bit 0 denoting Channel.</param>
  680. /// <param name="triggerAt">An index to the buffer indicating the location of the trigger point relative
  681. /// to startIndex.This parameter is valid only when triggered is non-zero.</param>
  682. /// <param name="triggered">A flag indicating whether a trigger occurred. If non-zero,
  683. /// a trigger occurred at the location indicated by triggerAt.</param>
  684. /// <param name="autoStop">The flag that was set in the call to series RunStreaming.</param>
  685. /// <param name="pParameter">a void pointer passed from series GetStreamingLatestValues.
  686. /// The callback function can write to this locatio.</param>
  687. typedef void (__stdcall *ps2000aStreamingReady)
  688. (
  689. int16_t handle,
  690. int32_t noOfSamples,
  691. uint32_t startIndex,
  692. int16_t overflow,
  693. uint32_t triggerAt,
  694. int16_t triggered,
  695. int16_t autoStop,
  696. void * pParameter
  697. );
  698. /// <summary>
  699. /// This is a callback function that you write to collect data from the driver. You supply a
  700. /// pointer to the function when you call ps3000aGetValuesAsync, and the driver calls
  701. /// your function back when the data is ready.
  702. /// </summary>
  703. /// <param name="handle">Device identifier returned by OpenUnit.</param>
  704. /// <param name="status">Indicates whether an error occurred during collection of the data.</param>
  705. /// <param name="noOfSamples">the number of samples collected.</param>
  706. /// <param name="overflow">A set of flags that indicates whether an overvoltage has
  707. /// occurred and on which channels.It is a bit field with bit 0 representing Channel A.</param>
  708. /// <param name="pParameter">A void pointer passed from ps3000aGetValuesAsync. The callback function can
  709. /// write to this location to send any data, such as a status flag, back to the application.
  710. /// The data type is defined by the application programmer.</param>
  711. typedef void (__stdcall *ps2000aDataReady)
  712. (
  713. int16_t handle,
  714. PICO_STATUS status,
  715. uint32_t noOfSamples,
  716. int16_t overflow,
  717. void * pParameter
  718. );
  719. /// <summary>
  720. /// This function opens a PicoScope 2000 Series (A API) scope attached to the computer.
  721. /// The maximum number of units that can be opened depends on the operating system, the kernel driver and the computer.
  722. /// </summary>
  723. /// <param name="handle"> on exit, the result of the attempt to open a scope:
  724. /// -1 : if the scope fails to open
  725. /// 0 : if no scope is found
  726. /// > 0 : a number that uniquely identifies the scope
  727. /// If a valid handle is returned, it must be used in all subsequent calls
  728. /// to API functions to identify this scope.</param>
  729. /// <param name="serial">on entry, a null-terminated string containing the serial
  730. /// number of the scope to be opened.If serial is NULL then the
  731. /// function opens the first scope found; otherwise, it tries to open the
  732. /// scope that matches the string.</param>
  733. /// <returns>
  734. /// PICO_OK
  735. /// PICO_OS_NOT_SUPPORTED
  736. /// PICO_OPEN_OPERATION_IN_PROGRESS
  737. /// PICO_EEPROM_CORRUPT
  738. /// PICO_KERNEL_DRIVER_TOO_OLD
  739. /// PICO_FPGA_FAIL
  740. /// PICO_MEMORY_CLOCK_FREQUENCY
  741. /// PICO_FW_FAIL
  742. /// PICO_MAX_UNITS_OPENED
  743. /// PICO_NOT_FOUND(if the specified unit was not found)
  744. /// PICO_NOT_RESPONDING
  745. /// PICO_MEMORY_FAIL
  746. /// PICO_ANALOG_BOARD
  747. /// PICO_CONFIG_FAIL_AWG
  748. /// PICO_INITIALISE_FPGA
  749. /// </returns>
  750. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aOpenUnit)
  751. (
  752. int16_t * handle,
  753. int8_t * serial
  754. );
  755. /// <summary>
  756. /// This function opens a scope without blocking the calling thread. You can find out when
  757. /// it has finished by periodically calling ps2000aOpenUnitProgress until that function
  758. /// returns a non - zero value.
  759. /// </summary>
  760. /// <param name="status">a status code:
  761. /// 0 if the open operation was disallowed because another open
  762. /// operation is in progress. 1 if the open operation was successfully.</param>
  763. /// <param name="serial">see ps2000aOpenUnit.</param>
  764. /// <returns>
  765. /// PICO_OK
  766. /// PICO_OPEN_OPERATION_IN_PROGRESS
  767. /// PICO_OPERATION_FAILED
  768. /// </returns>
  769. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aOpenUnitAsync)
  770. (
  771. int16_t * status,
  772. int8_t * serial
  773. );
  774. /// <summary>
  775. /// This function checks on the progress of a request made to ps2000aOpenUnitAsync to
  776. /// open a scope.
  777. /// </summary>
  778. /// <param name="handle">This handle is valid only if the function returns PICO_OK.</param>
  779. /// <param name="progressPercent">On exit, the percentage progress towards
  780. /// opening the scope. 100% implies that the open operation is complete.</param>
  781. /// <param name="complete">Set to 1 when the open operation has finished.</param>
  782. /// <returns>
  783. /// PICO_OK
  784. /// PICO_NULL_PARAMETER
  785. /// PICO_OPERATION_FAILED
  786. /// </returns>
  787. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aOpenUnitProgress)
  788. (
  789. int16_t * handle,
  790. int16_t * progressPercent,
  791. int16_t * complete
  792. );
  793. /// <summary>
  794. /// This function retrieves information about the specified oscilloscope. If the device fails
  795. /// to open, or no device is opened only the driver version is available.
  796. /// </summary>
  797. /// <param name="handle">device identifier returned by ps2000aOpenUnit. If an invalid
  798. /// handle is passed, only the driver versions can be read.</param>
  799. /// <param name="string">On exit, the unit information string selected specified by
  800. /// the info argument.If string is NULL, only requiredSize is returned.</param>
  801. /// <param name="stringLength">The maximum number of chars that may be written to string.</param>
  802. /// <param name="requiredSize">On exit, the required length of the string array.</param>
  803. /// <param name="info">a number specifying what information is required.
  804. /// The possible values are listed in the table below.</param>
  805. /// <returns>
  806. /// PICO_OK
  807. /// PICO_INVALID_HANDLE
  808. /// PICO_NULL_PARAMETER
  809. /// PICO_INVALID_INFO
  810. /// PICO_INFO_UNAVAILABLE
  811. /// PICO_DRIVER_FUNCTION
  812. /// </returns>
  813. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetUnitInfo)
  814. (
  815. int16_t handle,
  816. int8_t * string,
  817. int16_t stringLength,
  818. int16_t * requiredSize,
  819. PICO_INFO info
  820. );
  821. /// <summary>
  822. /// This function flashes the LED on the front of the scope without blocking the calling
  823. /// thread.Calls to ps2000aRunStreaming and ps2000aRunBlock cancel any flashing
  824. /// started by this function.It is not possible to set the LED to be constantly illuminated,
  825. /// as this state is used to indicate that the scope has not been initialized.
  826. /// </summary>
  827. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  828. /// <param name="start">the action required:
  829. /// < 0 : flash the LED indefinitely
  830. /// 0 : stop the LED flashing
  831. /// > 0 : flash the LED start times.If the LED is already flashing
  832. /// on entry to this function, the flash count will be reset to start.</param>
  833. /// <returns>
  834. /// PICO_OK
  835. /// PICO_HANDLE_INVALID
  836. /// PICO_BUSY
  837. /// PICO_DRIVER_FUNCTION
  838. /// PICO_NOT_RESPONDING
  839. /// </returns>
  840. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aFlashLed)
  841. (
  842. int16_t handle,
  843. int16_t start
  844. );
  845. /// <summary>
  846. /// This function shuts down an oscilloscope.
  847. /// </summary>
  848. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  849. /// <returns>
  850. /// PICO_OK
  851. /// PICO_HANDLE_INVALID
  852. /// PICO_USER_CALLBACK
  853. /// PICO_DRIVER_FUNCTION
  854. /// </returns>
  855. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aCloseUnit)
  856. (
  857. int16_t handle
  858. );
  859. /// <summary>
  860. /// This function sets the number of memory segments that the scope will use. When the scope is opened,
  861. /// the number of segments defaults to 1, meaning that each capture fills the scope's available memory.
  862. /// This function allows you to divide the memory into a number of segments so that the scope can
  863. /// store several waveforms sequentially.
  864. /// </summary>
  865. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  866. /// <param name="nSegments">The number of segments required, from 1 to ps2000aGetMaxSegments.</param>
  867. /// <param name="nMaxSamples">on exit, the number of samples available in each segment.This is
  868. /// the total number over all channels, so if more than one channel is in use then the number
  869. /// of samples available to each channel is nMaxSamples divided by the number of channels.</param>
  870. /// <returns>
  871. /// PICO_OK
  872. /// PICO_USER_CALLBACK
  873. /// PICO_INVALID_HANDLE
  874. /// PICO_TOO_MANY_SEGMENTS
  875. /// PICO_MEMORY
  876. /// PICO_DRIVER_FUNCTION
  877. /// </returns>
  878. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aMemorySegments)
  879. (
  880. int16_t handle,
  881. uint32_t nSegments,
  882. int32_t * nMaxSamples
  883. );
  884. /// <summary>
  885. /// This function specifies whether an input channel is to be enabled, its input coupling
  886. /// type, voltage range, analog offset.
  887. /// </summary>
  888. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  889. /// <param name="channel">, the channel to be configured. The values are:
  890. /// PS2000A_CHANNEL_A: Channel A input
  891. /// PS2000A_CHANNEL_B : Channel B input
  892. /// PS2000A_CHANNEL_C : Channel C input
  893. /// PS2000A_CHANNEL_D : Channel D input</param>
  894. /// <param name="enabled">Whether or not to enable the channel. The values are:
  895. /// TRUE: enable
  896. /// FALSE : do not enable</param>
  897. /// <param name="type">the impedance and coupling type. The values are:
  898. /// PS2000A_AC: 1 megohm impedance, AC coupling.The channel accepts input frequencies
  899. /// from about 1 hertz up to its maximum analog bandwidth.
  900. /// PS2000A_DC: 1 megohm impedance, DC coupling.The channel accepts all input frequencies
  901. /// from zero(DC) up to its maximum analog bandwidth.</param>
  902. /// <param name="range">The input voltage range.</param>
  903. /// <param name="analogOffset">a voltage to add to the input channel before digitization.
  904. /// The allowable range of offsets can be obtained from ps2000aGetAnalogueOffset and depends
  905. /// on the input range selected for the channel.This argument is ignored if the device is a
  906. /// PicoScope 2205 MSO.</param>
  907. /// <returns>
  908. /// PICO_OK
  909. /// PICO_USER_CALLBACK
  910. /// PICO_INVALID_HANDLE
  911. /// PICO_INVALID_CHANNEL
  912. /// PICO_INVALID_VOLTAGE_RANGE
  913. /// PICO_INVALID_COUPLING
  914. /// PICO_INVALID_ANALOGUE_OFFSET
  915. /// PICO_DRIVER_FUNCTION
  916. /// </returns>
  917. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetChannel)
  918. (
  919. int16_t handle,
  920. PS2000A_CHANNEL channel,
  921. int16_t enabled,
  922. PS2000A_COUPLING type,
  923. PS2000A_RANGE range,
  924. float analogOffset
  925. );
  926. /// <summary>
  927. /// This function is used to enable the digital ports of an MSO and set the logic level (the
  928. /// voltage point at which the state transitions from 0 to 1).
  929. /// </summary>
  930. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  931. /// <param name="port">the digital port to be configured:
  932. /// PS2000A_DIGITAL_PORT0 = 0x80 (D0 to D7)
  933. /// PS2000A_DIGITAL_PORT1 = 0x81 (D8 to D15)</param>
  934. /// <param name="enabled">Whether or not to enable the channel. The values are:
  935. /// TRUE: enable
  936. /// FALSE : do not enable</param>
  937. /// <param name="logicLevel">The logic threshold voltage. Range: �32767 (�5 V) to 32767 (5 V).</param>
  938. /// <returns>
  939. /// PICO_OK
  940. /// PICO_INVALID_HANDLE
  941. /// PICO_INVALID_CHANNEL
  942. /// PICO_RATIO_MODE_NOT_SUPPORTED
  943. /// PICO_SEGMENT_OUT_OF_RANGE
  944. /// PICO_DRIVER_FUNCTION
  945. /// PICO_INVALID_PARAMETER
  946. /// </returns>
  947. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetDigitalPort)
  948. (
  949. int16_t handle,
  950. PS2000A_DIGITAL_PORT port,
  951. int16_t enabled,
  952. int16_t logicLevel
  953. );
  954. /// <summary>
  955. /// This function sets the number of captures to be collected in one run of rapid block
  956. /// mode.If you do not call this function before a run, the driver will capture only one
  957. /// waveform.Once a value has been set, the value remains constant unless changed.
  958. /// </summary>
  959. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  960. /// <param name="nCaptures">The number of waveforms to capture in one run.</param>
  961. /// <returns>
  962. /// PICO_OK
  963. /// PICO_INVALID_HANDLE
  964. /// PICO_INVALID_PARAMETER
  965. /// PICO_DRIVER_FUNCTION
  966. /// </returns>
  967. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetNoOfCaptures)
  968. (
  969. int16_t handle,
  970. uint32_t nCaptures
  971. );
  972. /// <summary>
  973. /// This function calculates the sampling rate and maximum number of samples for a
  974. /// given timebase under the specified conditions.The result will depend on the number of
  975. /// channels enabled by the last call to ps2000aSetChannel.
  976. ///
  977. /// This function is provided for use with programming languages that do not support the
  978. /// float data type.The value returned in the timeIntervalNanoseconds argument is
  979. /// restricted to integers.If your programming language supports the float type, we
  980. /// recommend that you use ps2000aGetTimebase2 instead.
  981. ///
  982. /// To use ps2000aGetTimebase or ps2000aGetTimebase2, first estimate the timebase
  983. /// number that you require using the information in the timebase guide.Next, call one of
  984. /// these functions with the timebase that you have just chosen and verify that the
  985. /// timeIntervalNanoseconds argument that the function returns is the value that you
  986. /// require.You may need to iterate this process until you obtain the time interval that you need.
  987. /// </summary>
  988. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  989. /// <param name="timebase">The timebase guide.</param>
  990. /// <param name="noSamples">The number of samples required.</param>
  991. /// <param name="timeIntervalNanoseconds">On exit, the time interval between readings at the
  992. /// selected timebase.Use NULL if not required.In ETS mode this argument is not valid;
  993. /// use the sample time returned by ps2000aSetEts.</param>
  994. /// <param name="oversample">Not used.</param>
  995. /// <param name="maxSamples">On exit, the maximum number of samples available. The scope allocates
  996. /// a certain amount of memory for internal overheads and this may vary depending on the number of
  997. /// segments, number of channels enabled, and the timebase chosen.Use NULL if not required.</param>
  998. /// <param name="segmentIndex">The index of the memory segment to use.</param>
  999. /// <returns>
  1000. /// /// PICO_OK
  1001. /// PICO_INVALID_HANDLE
  1002. /// PICO_TOO_MANY_SAMPLES
  1003. /// PICO_INVALID_CHANNEL
  1004. /// PICO_INVALID_TIMEBASE
  1005. /// PICO_INVALID_PARAMETER
  1006. /// PICO_SEGMENT_OUT_OF_RANGE
  1007. /// PICO_DRIVER_FUNCTION
  1008. /// </returns>
  1009. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetTimebase)
  1010. (
  1011. int16_t handle,
  1012. uint32_t timebase,
  1013. int32_t noSamples,
  1014. int32_t * timeIntervalNanoseconds,
  1015. int16_t oversample,
  1016. int32_t * maxSamples,
  1017. uint32_t segmentIndex
  1018. );
  1019. /// <summary>
  1020. /// This function is an upgraded version of ps2000aGetTimebase, and returns the time
  1021. /// interval as a float rather than a long.This allows it to return sub - nanosecond time
  1022. /// intervals.See ps2000aGetTimebase for a full description.
  1023. /// </summary>
  1024. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1025. /// <param name="timebase">The timebase guide.</param>
  1026. /// <param name="noSamples">The number of samples required.</param>
  1027. /// <param name="timeIntervalNanoseconds">A pointer to the time interval between readings at
  1028. /// the selected timebase.If a null pointer is passed, the parameter will be ignored.</param>
  1029. /// <param name="oversample">Not used.</param>
  1030. /// <param name="maxSamples">On exit, the maximum number of samples available. The scope allocates
  1031. /// a certain amount of memory for internal overheads and this may vary depending on the number of
  1032. /// segments, number of channels enabled, and the timebase chosen.Use NULL if not required.</param>
  1033. /// <param name="segmentIndex">The index of the memory segment to use.</param>
  1034. /// <returns>
  1035. /// PICO_OK
  1036. /// PICO_INVALID_HANDLE
  1037. /// PICO_TOO_MANY_SAMPLES
  1038. /// PICO_INVALID_CHANNEL
  1039. /// PICO_INVALID_TIMEBASE
  1040. /// PICO_INVALID_PARAMETER
  1041. /// PICO_SEGMENT_OUT_OF_RANGE
  1042. /// PICO_DRIVER_FUNCTION
  1043. /// </returns>
  1044. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetTimebase2)
  1045. (
  1046. int16_t handle,
  1047. uint32_t timebase,
  1048. int32_t noSamples,
  1049. float * timeIntervalNanoseconds,
  1050. int16_t oversample,
  1051. int32_t * maxSamples,
  1052. uint32_t segmentIndex
  1053. );
  1054. /// <summary>
  1055. /// This function programs the signal generator to produce an arbitrary waveform. The arbitrary waveform
  1056. /// generator uses direct digital synthesis (DDS). It maintains a 32 - bit phase accumulator that
  1057. /// indicates the present location in the waveform.The top bits of the phase accumulator are used as
  1058. /// an index into a buffer containing the arbitrary waveform.The remaining bits act as the fractional
  1059. /// part of the index, enabling high - resolution control of output frequency and allowing the
  1060. /// generation of lower frequencies.
  1061. ///
  1062. /// The phase accumulator initially increments by startDeltaPhase.If the AWG is set to sweep mode, the
  1063. /// phase increment is increased at specified intervals until it reaches stopDeltaPhase. The easiest way
  1064. /// to obtain the values of startDeltaPhase and stopDeltaPhase necessary to generate the desired frequency
  1065. /// is to call ps2000aSigGenFrequencyToPhase.
  1066. /// </summary>
  1067. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1068. /// <param name="offsetVoltage">The voltage offset, in microvolts, to be applied to the waveform.</param>
  1069. /// <param name="pkToPk">The peak-to-peak voltage, in microvolts, of the waveform signal.</param>
  1070. /// <param name="startDeltaPhase">The initial value added to the phase accumulator as the generator
  1071. /// begins to step through the waveform buffer.Calculate this value from the information above, or use
  1072. /// ps2000aSigGenFrequencyToPhase.</param>
  1073. /// <param name="stopDeltaPhase">The final value added to the phase accumulator before the generator
  1074. /// restarts or reverses the sweep.When frequency sweeping is not required, set equal to startDeltaPhase.</param>
  1075. /// <param name="deltaPhaseIncrement">the amount added to the delta phase value every time the dwellCount
  1076. /// period expires.This determines the amount by which the generator sweeps the output frequency in each
  1077. /// dwell period.When frequency sweeping is not required, set to zero.</param>
  1078. /// <param name="dwellCount">the time, in multiples of ddsPeriod, between successive additions of
  1079. /// deltaPhaseIncrement to the delta phase accumulator.This determines the rate at which the generator
  1080. /// sweeps the output frequency.Minimum value : PS2000A_MIN_DWELL_COUNT.</param>
  1081. /// <param name="arbitaryWaveform">A buffer that holds the waveform pattern as a set of samples equally
  1082. /// spaced in time.Each sample is scaled to an output voltage as follows:
  1083. ///
  1084. /// vOUT = 1 �V *(pkToPk / 2) *(sample_value / 32767) + offsetVoltage
  1085. ///
  1086. /// and clipped to the overall �2 V range of the AWG.</param>
  1087. /// <param name="arbitaryWaveformSize">the size of the arbitrary waveform buffer, in samples, in the range:
  1088. /// [minArbitraryWaveformSize, maxArbitraryWaveformSize] where minArbitraryWaveformSize and
  1089. /// maxArbitraryWaveformSize are the values returned by ps2000aSigGenArbitraryMinMaxValues.</param>
  1090. /// <param name="sweepType">, determines whether the startDeltaPhase is swept up to the stopDeltaPhase,
  1091. /// or down to it, or repeatedly swept up and down.</param>
  1092. /// <param name="operation">The type of waveform to be produced.</param>
  1093. /// <param name="indexMode">Specifies how the signal will be formed from the arbitrary waveform data.
  1094. /// Single and dual index modes are possible.</param>
  1095. /// <param name="shots">0: sweep the frequency as specified by sweeps
  1096. /// 1...PS2000A_MAX_SWEEPS_SHOTS: the number of cycles of the waveform to be
  1097. /// produced after a trigger event.sweeps must be zero.
  1098. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN : start and run continuously after trigger
  1099. /// occurs(not PicoScope 2205 MSO).</param>
  1100. /// <param name="sweeps">0: produce number of cycles specified by shots
  1101. /// 1..PS2000A_MAX_SWEEPS_SHOTS: the number of times to sweep the frequency after a trigger event,
  1102. /// according to sweepType.shots must be zero.
  1103. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN: start a sweep and continue after trigger
  1104. /// occurs(not PicoScope 2205 MSO).</param>
  1105. /// <param name="triggerType">The type of trigger that will be applied to the signal generator.</param>
  1106. /// <param name="triggerSource">The source that will trigger the signal generator.
  1107. /// If a trigger source other than P2000A_SIGGEN_NONE is specified, then either shots or sweeps,
  1108. /// but not both, must be non - zero.</param>
  1109. /// <param name="extInThreshold">Trigger level, in ADC counts, for external trigger.</param>
  1110. /// <returns>
  1111. /// PICO_OK
  1112. /// PICO_AWG_NOT_SUPPORTED
  1113. /// PICO_BUSY
  1114. /// PICO_INVALID_HANDLE
  1115. /// PICO_SIG_GEN_PARAM
  1116. /// PICO_SHOTS_SWEEPS_WARNING
  1117. /// PICO_NOT_RESPONDING
  1118. /// PICO_WARNING_EXT_THRESHOLD_CONFLICT
  1119. /// PICO_NO_SIGNAL_GENERATOR
  1120. /// PICO_SIGGEN_OFFSET_VOLTAGE
  1121. /// PICO_SIGGEN_PK_TO_PK
  1122. /// PICO_SIGGEN_OUTPUT_OVER_VOLTAGE
  1123. /// PICO_DRIVER_FUNCTION
  1124. /// PICO_SIGGEN_WAVEFORM_SETUP_FAILED
  1125. /// </returns>
  1126. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetSigGenArbitrary)
  1127. (
  1128. int16_t handle,
  1129. int32_t offsetVoltage,
  1130. uint32_t pkToPk,
  1131. uint32_t startDeltaPhase,
  1132. uint32_t stopDeltaPhase,
  1133. uint32_t deltaPhaseIncrement,
  1134. uint32_t dwellCount,
  1135. int16_t * arbitraryWaveform,
  1136. int32_t arbitraryWaveformSize,
  1137. PS2000A_SWEEP_TYPE sweepType,
  1138. PS2000A_EXTRA_OPERATIONS operation,
  1139. PS2000A_INDEX_MODE indexMode,
  1140. uint32_t shots,
  1141. uint32_t sweeps,
  1142. PS2000A_SIGGEN_TRIG_TYPE triggerType,
  1143. PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
  1144. int16_t extInThreshold
  1145. );
  1146. /// <summary>
  1147. /// This function sets up the signal generator to produce a signal from a list of built-in
  1148. /// waveforms.If different start and stop frequencies are specified, the device will sweep
  1149. /// either up, down, or up and down.
  1150. /// </summary>
  1151. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1152. /// <param name="offsetVoltage">The voltage offset, in microvolts, to be applied to the waveform</param>
  1153. /// <param name="pkToPk">The peak-to-peak voltage, in microvolts, of the waveform signal.
  1154. ///
  1155. /// Note: if the signal voltages described by the combination of offsetVoltage and pkToPk
  1156. /// extend outside the voltage range of the signal generator, the output waveform will be clipped.</param>
  1157. /// <param name="waveType">The type of waveform to be generated.</param>
  1158. /// <param name="startFrequency">The frequency that the signal generator will initially produce. See
  1159. /// #defines above.</param>
  1160. /// <param name="stopFrequency">The frequency at which the sweep reverses direction or returns to
  1161. /// the initial frequency.</param>
  1162. /// <param name="increment">The amount of frequency increase or decrease in sweep mode.</param>
  1163. /// <param name="dwellTime">The time for which the sweep stays at each frequency, in seconds.</param>
  1164. /// <param name="sweepType">whether the frequency will sweep from startFrequency to stopFrequency,
  1165. /// or in the opposite direction, or repeatedly reverse direction.</param>
  1166. /// <param name="operation">the type of waveform to be produced, specified by one of the following
  1167. /// enumerated types :
  1168. /// PS2000A_ES_OFF, normal signal generator operation specified by waveType.PS2000A_WHITENOISE,
  1169. /// the signal generator produces white noise and ignores all settings except pkToPk and offsetVoltage.
  1170. /// PS2000A_PRBS, produces a random bitstream with a bit rate specified by the start and stop
  1171. /// frequency(not available on PicoScope 2205 MSO).</param>
  1172. /// <param name="shots">0: sweep the frequency as specified by sweeps
  1173. /// 1...PS2000A_MAX_SWEEPS_SHOTS: the number of cycles of the waveform to be
  1174. /// produced after a trigger event.sweeps must be zero.
  1175. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN : start and run continuously after trigger
  1176. /// occurs(not PicoScope 2205 MSO)./param>
  1177. /// <param name="sweeps">0: produce number of cycles specified by shots
  1178. /// 1..PS2000A_MAX_SWEEPS_SHOTS: the number of times to sweep the frequency after a trigger event,
  1179. /// according to sweepType.shots must be zero.
  1180. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN: start a sweep and continue after trigger
  1181. /// occurs(not PicoScope 2205 MSO).</param>
  1182. /// <param name="triggerType">The type of trigger that will be applied to the signal generator.</param>
  1183. /// <param name="triggerSource">The source that will trigger the signal generator.
  1184. /// If a trigger source other than P2000A_SIGGEN_NONE is specified, then either shots or sweeps,
  1185. /// but not both, must be non - zero.</param>
  1186. /// <param name="extInThreshold">Trigger level, in ADC counts, for external trigger.</param>
  1187. /// <returns>
  1188. /// PICO_OK
  1189. /// PICO_BUSY
  1190. /// PICO_INVALID_HANDLE
  1191. /// PICO_SIG_GEN_PARAM
  1192. /// PICO_SHOTS_SWEEPS_WARNING
  1193. /// PICO_NOT_RESPONDING
  1194. /// PICO_WARNING_AUX_OUTPUT_CONFLICT
  1195. /// PICO_WARNING_EXT_THRESHOLD_CONFLICT
  1196. /// PICO_NO_SIGNAL_GENERATOR
  1197. /// PICO_SIGGEN_OFFSET_VOLTAGE
  1198. /// PICO_SIGGEN_PK_TO_PK
  1199. /// PICO_SIGGEN_OUTPUT_OVER_VOLTAGE
  1200. /// PICO_DRIVER_FUNCTION
  1201. /// PICO_SIGGEN_WAVEFORM_SETUP_FAILED
  1202. /// PICO_NOT_RESPONDING
  1203. /// </returns>
  1204. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSetSigGenBuiltIn)
  1205. (
  1206. int16_t handle,
  1207. int32_t offsetVoltage,
  1208. uint32_t pkToPk,
  1209. int16_t waveType,
  1210. float startFrequency,
  1211. float stopFrequency,
  1212. float increment,
  1213. float dwellTime,
  1214. PS2000A_SWEEP_TYPE sweepType,
  1215. PS2000A_EXTRA_OPERATIONS operation,
  1216. uint32_t shots,
  1217. uint32_t sweeps,
  1218. PS2000A_SIGGEN_TRIG_TYPE triggerType,
  1219. PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
  1220. int16_t extInThreshold
  1221. );
  1222. /// <summary>
  1223. /// This function sets up the signal generator. It differs from ps2000SetSigGenBuiltIn in
  1224. /// having double - precision arguments instead of floats, giving greater resolution when
  1225. /// setting the output frequency.
  1226. /// </summary>
  1227. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1228. /// <param name="offsetVoltage">The voltage offset, in microvolts, to be applied to the waveform.</param>
  1229. /// <param name="pkToPk">The peak-to-peak voltage, in microvolts, of the waveform signal.
  1230. ///
  1231. /// Note: if the signal voltages described by the combination of offsetVoltage and pkToPk
  1232. /// extend outside the voltage range of the signal generator, the output waveform will be clipped.</param>
  1233. /// <param name="waveType">The type of waveform to be generated.</param>
  1234. /// <param name="startFrequency">The frequency that the signal generator will initially produce. See
  1235. /// #defines above.</param>
  1236. /// <param name="stopFrequency">The frequency at which the sweep reverses direction or returns to
  1237. /// the initial frequency.</param>
  1238. /// <param name="increment">The amount of frequency increase or decrease in sweep mode.</param>
  1239. /// <param name="dwellTime">The time for which the sweep stays at each frequency, in seconds.</param>
  1240. /// <param name="sweepType">whether the frequency will sweep from startFrequency to stopFrequency,
  1241. /// or in the opposite direction, or repeatedly reverse direction.</param>
  1242. /// <param name="operation">the type of waveform to be produced, specified by one of the following
  1243. /// enumerated types :
  1244. /// PS2000A_ES_OFF, normal signal generator operation specified by waveType.PS2000A_WHITENOISE,
  1245. /// the signal generator produces white noise and ignores all settings except pkToPk and offsetVoltage.
  1246. /// PS2000A_PRBS, produces a random bitstream with a bit rate specified by the start and stop
  1247. /// frequency(not available on PicoScope 2205 MSO).</param>
  1248. /// <param name="shots">0: sweep the frequency as specified by sweeps
  1249. /// 1...PS2000A_MAX_SWEEPS_SHOTS: the number of cycles of the waveform to be
  1250. /// produced after a trigger event.sweeps must be zero.
  1251. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN : start and run continuously after trigger
  1252. /// occurs(not PicoScope 2205 MSO).</param>
  1253. /// <param name="sweeps">0: produce number of cycles specified by shots
  1254. /// 1..PS2000A_MAX_SWEEPS_SHOTS: the number of times to sweep the frequency after a trigger event,
  1255. /// according to sweepType.shots must be zero.
  1256. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN: start a sweep and continue after trigger
  1257. /// occurs(not PicoScope 2205 MSO).</param>
  1258. /// <param name="triggerType">The type of trigger that will be applied to the signal generator.</param>
  1259. /// <param name="triggerSource">The source that will trigger the signal generator.
  1260. /// If a trigger source other than P2000A_SIGGEN_NONE is specified, then either shots or sweeps,
  1261. /// but not both, must be non - zero.</param>
  1262. /// <param name="extInThreshold">Trigger level, in ADC counts, for external trigger.</param>
  1263. /// <returns>
  1264. /// PICO_OK
  1265. /// PICO_BUSY
  1266. /// PICO_INVALID_HANDLE
  1267. /// PICO_SIG_GEN_PARAM
  1268. /// PICO_SHOTS_SWEEPS_WARNING
  1269. /// PICO_NOT_RESPONDING
  1270. /// PICO_WARNING_AUX_OUTPUT_CONFLICT
  1271. /// PICO_WARNING_EXT_THRESHOLD_CONFLICT
  1272. /// PICO_NO_SIGNAL_GENERATOR
  1273. /// PICO_SIGGEN_OFFSET_VOLTAGE
  1274. /// PICO_SIGGEN_PK_TO_PK
  1275. /// PICO_SIGGEN_OUTPUT_OVER_VOLTAGE
  1276. /// PICO_DRIVER_FUNCTION
  1277. /// PICO_SIGGEN_WAVEFORM_SETUP_FAILED
  1278. /// PICO_NOT_RESPONDING
  1279. /// </returns>
  1280. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSetSigGenBuiltInV2)
  1281. (
  1282. int16_t handle,
  1283. int32_t offsetVoltage,
  1284. uint32_t pkToPk,
  1285. int16_t waveType,
  1286. double startFrequency,
  1287. double stopFrequency,
  1288. double increment,
  1289. double dwellTime,
  1290. PS2000A_SWEEP_TYPE sweepType,
  1291. PS2000A_EXTRA_OPERATIONS operation,
  1292. uint32_t shots,
  1293. uint32_t sweeps,
  1294. PS2000A_SIGGEN_TRIG_TYPE triggerType,
  1295. PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
  1296. int16_t extInThreshold
  1297. );
  1298. /// <summary>
  1299. /// This function reprograms the arbitrary waveform generator. All values can be reprogrammed while
  1300. /// the signal generator is waiting for a trigger.
  1301. /// </summary>
  1302. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1303. /// <param name="startDeltaPhase">The initial value added to the phase accumulator as the generator
  1304. /// begins to step through the waveform buffer.Calculate this value from the information above, or use
  1305. /// ps2000aSigGenFrequencyToPhase.</param>
  1306. /// <param name="stopDeltaPhase">The final value added to the phase accumulator before the generator
  1307. /// restarts or reverses the sweep.When frequency sweeping is not required, set equal to startDeltaPhase.</param>
  1308. /// <param name="deltaPhaseIncrement">the amount added to the delta phase value every time the dwellCount
  1309. /// period expires.This determines the amount by which the generator sweeps the output frequency in each
  1310. /// dwell period.When frequency sweeping is not required, set to zero.</param>
  1311. /// <param name="dwellCount">the time, in multiples of ddsPeriod, between successive additions of
  1312. /// deltaPhaseIncrement to the delta phase accumulator.This determines the rate at which the generator
  1313. /// sweeps the output frequency.Minimum value : PS2000A_MIN_DWELL_COUNT.</param>
  1314. /// <param name="arbitaryWaveform">A buffer that holds the waveform pattern as a set of samples equally
  1315. /// spaced in time.Each sample is scaled to an output voltage as follows:
  1316. ///
  1317. /// vOUT = 1 �V *(pkToPk / 2) *(sample_value / 32767) + offsetVoltage
  1318. ///
  1319. /// and clipped to the overall �2 V range of the AWG.</param>
  1320. /// <param name="arbitaryWaveformSize">the size of the arbitrary waveform buffer, in samples, in the range:
  1321. /// [minArbitraryWaveformSize, maxArbitraryWaveformSize] where minArbitraryWaveformSize and
  1322. /// maxArbitraryWaveformSize are the values returned by ps2000aSigGenArbitraryMinMaxValues.</param>
  1323. /// <param name="sweepType">, determines whether the startDeltaPhase is swept up to the stopDeltaPhase,
  1324. /// or down to it, or repeatedly swept up and down.</param>
  1325. /// <param name="operation">The type of waveform to be produced.</param>
  1326. /// <param name="indexMode">Specifies how the signal will be formed from the arbitrary waveform data.
  1327. /// Single and dual index modes are possible.</param>
  1328. /// <param name="shots">0: sweep the frequency as specified by sweeps
  1329. /// 1...PS2000A_MAX_SWEEPS_SHOTS: the number of cycles of the waveform to be
  1330. /// produced after a trigger event.sweeps must be zero.
  1331. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN : start and run continuously after trigger
  1332. /// occurs(not PicoScope 2205 MSO).</param>
  1333. /// <param name="sweeps">0: produce number of cycles specified by shots
  1334. /// 1..PS2000A_MAX_SWEEPS_SHOTS: the number of times to sweep the frequency after a trigger event,
  1335. /// according to sweepType.shots must be zero.
  1336. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN: start a sweep and continue after trigger
  1337. /// occurs(not PicoScope 2205 MSO).</param>
  1338. /// <param name="triggerType">The type of trigger that will be applied to the signal generator.</param>
  1339. /// <param name="triggerSource">The source that will trigger the signal generator.
  1340. /// If a trigger source other than P2000A_SIGGEN_NONE is specified, then either shots or sweeps,
  1341. /// but not both, must be non - zero.</param>
  1342. /// <param name="extInThreshold">Trigger level, in ADC counts, for external trigger.</param>
  1343. /// <returns>
  1344. /// PICO_OK if successful
  1345. /// PICO_INVALID_HANDLE
  1346. /// PICO_NO_SIGNAL_GENERATOR
  1347. /// PICO_DRIVER_FUNCTION
  1348. /// PICO_AWG_NOT_SUPPORTED
  1349. /// PICO_SIGGEN_OFFSET_VOLTAGE
  1350. /// PICO_SIGGEN_PK_TO_PK
  1351. /// PICO_SIGGEN_OUTPUT_OVER_VOLTAGE
  1352. /// PICO_SIG_GEN_PARAM
  1353. /// PICO_SHOTS_SWEEPS_WARNING
  1354. /// PICO_WARNING_EXT_THRESHOLD_CONFLICT
  1355. /// PICO_BUSY
  1356. /// PICO_SIGGEN_WAVEFORM_SETUP_FAILED
  1357. /// PICO_NOT_RESPONDING
  1358. /// </returns>
  1359. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetSigGenPropertiesArbitrary)
  1360. (
  1361. int16_t handle,
  1362. uint32_t startDeltaPhase,
  1363. uint32_t stopDeltaPhase,
  1364. uint32_t deltaPhaseIncrement,
  1365. uint32_t dwellCount,
  1366. PS2000A_SWEEP_TYPE sweepType,
  1367. uint32_t shots,
  1368. uint32_t sweeps,
  1369. PS2000A_SIGGEN_TRIG_TYPE triggerType,
  1370. PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
  1371. int16_t extInThreshold
  1372. );
  1373. /// <summary>
  1374. /// This function reprograms the signal generator. Values can be changed while the signal
  1375. /// generator is waiting for a trigger.
  1376. /// </summary>
  1377. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1378. /// <param name="startFrequency">The frequency that the signal generator will initially produce. See
  1379. /// #defines above.</param>
  1380. /// <param name="stopFrequency">The frequency at which the sweep reverses direction or returns to
  1381. /// the initial frequency.</param>
  1382. /// <param name="increment">The amount of frequency increase or decrease in sweep mode.</param>
  1383. /// <param name="dwellTime">The time for which the sweep stays at each frequency, in seconds.</param>
  1384. /// <param name="sweepType">whether the frequency will sweep from startFrequency to stopFrequency,
  1385. /// or in the opposite direction, or repeatedly reverse direction.</param>
  1386. /// <param name="operation">the type of waveform to be produced, specified by one of the following
  1387. /// enumerated types :
  1388. /// PS2000A_ES_OFF, normal signal generator operation specified by waveType.PS2000A_WHITENOISE,
  1389. /// the signal generator produces white noise and ignores all settings except pkToPk and offsetVoltage.
  1390. /// PS2000A_PRBS, produces a random bitstream with a bit rate specified by the start and stop
  1391. /// frequency(not available on PicoScope 2205 MSO).</param>
  1392. /// <param name="shots">0: sweep the frequency as specified by sweeps
  1393. /// 1...PS2000A_MAX_SWEEPS_SHOTS: the number of cycles of the waveform to be
  1394. /// produced after a trigger event.sweeps must be zero.
  1395. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN : start and run continuously after trigger
  1396. /// occurs(not PicoScope 2205 MSO).</param>
  1397. /// <param name="sweeps">0: produce number of cycles specified by shots
  1398. /// 1..PS2000A_MAX_SWEEPS_SHOTS: the number of times to sweep the frequency after a trigger event,
  1399. /// according to sweepType.shots must be zero.
  1400. /// PS2000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN: start a sweep and continue after trigger
  1401. /// occurs(not PicoScope 2205 MSO).</param>
  1402. /// <param name="triggerType">The type of trigger that will be applied to the signal generator.</param>
  1403. /// <param name="triggerSource">The source that will trigger the signal generator.
  1404. /// If a trigger source other than P2000A_SIGGEN_NONE is specified, then either shots or sweeps,
  1405. /// but not both, must be non - zero.</param>
  1406. /// <param name="extInThreshold">Trigger level, in ADC counts, for external trigger.</param>
  1407. /// <returns>
  1408. /// PICO_OK if successful
  1409. /// PICO_INVALID_HANDLE
  1410. /// PICO_NO_SIGNAL_GENERATOR
  1411. /// PICO_DRIVER_FUNCTION
  1412. /// PICO_WARNING_EXT_THRESHOLD_CONFLICT
  1413. /// PICO_SIGGEN_OFFSET_VOLTAGE
  1414. /// PICO_SIGGEN_PK_TO_PK
  1415. /// PICO_SIGGEN_OUTPUT_OVER_VOLTAGE
  1416. /// PICO_SIG_GEN_PARAM
  1417. /// PICO_SHOTS_SWEEPS_WARNING
  1418. /// PICO_WARNING_EXT_THRESHOLD_CONFLICT
  1419. /// PICO_BUSY
  1420. /// PICO_SIGGEN_WAVEFORM_SETUP_FAILED
  1421. /// PICO_NOT_RESPONDING
  1422. /// </returns>
  1423. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSetSigGenPropertiesBuiltIn)
  1424. (
  1425. int16_t handle,
  1426. double startFrequency,
  1427. double stopFrequency,
  1428. double increment,
  1429. double dwellTime,
  1430. PS2000A_SWEEP_TYPE sweepType,
  1431. uint32_t shots,
  1432. uint32_t sweeps,
  1433. PS2000A_SIGGEN_TRIG_TYPE triggerType,
  1434. PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
  1435. int16_t extInThreshold
  1436. );
  1437. /// <summary>
  1438. /// This function converts a frequency to a phase count for use with the arbitrary waveform
  1439. /// generator setup functions ps2000aSetSigGenArbitrary and ps2000aSetSigGenPropertiesArbitrary.
  1440. /// The value returned depends on the length of the buffer, the index mode passed and the device model.
  1441. /// </summary>
  1442. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1443. /// <param name="frequency">The required AWG output frequency.</param>
  1444. /// <param name="indexMode">See AWG index modes.</param>
  1445. /// <param name="bufferLength">The number of samples in the AWG buffer.</param>
  1446. /// <param name="phase">On exit, the deltaPhase argument to be sent to the AWG setup function.</param>
  1447. /// <returns>
  1448. /// PICO_OK
  1449. /// PICO_NOT_SUPPORTED_BY_THIS_DEVICE, if the device does not have an AWG.
  1450. /// PICO_SIGGEN_FREQUENCY_OUT_OF_RANGE, if the frequency is out of range.
  1451. /// PICO_NULL_PARAMETER, if phase is a NULL pointer.
  1452. /// PICO_SIG_GEN_PARAM, if indexMode or bufferLength is out of range.
  1453. /// PICO_INVALID_HANDLE
  1454. /// PICO_DRIVER_FUNCTION
  1455. /// </returns>
  1456. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSigGenFrequencyToPhase)
  1457. (
  1458. int16_t handle,
  1459. double frequency,
  1460. PS2000A_INDEX_MODE indexMode,
  1461. uint32_t bufferLength,
  1462. uint32_t * phase
  1463. );
  1464. /// <summary>
  1465. /// This function returns the range of possible sample values and waveform buffer sizes
  1466. /// that can be supplied to ps2000aSetSigGenArbitrary for setting up the arbitrary
  1467. /// waveform generator(AWG).These values may vary between models.
  1468. /// </summary>
  1469. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1470. /// <param name="minArbitraryWaveformValue">On exit, the lowest sample value allowed in the
  1471. /// arbitraryWaveform buffer supplied to ps2000aSetChannelInfoSigGenArbitrary.</param>
  1472. /// <param name="maxArbitraryWaveformValue">On exit, the highest sample value allowed in the
  1473. /// arbitraryWaveform buffer supplied to ps2000aSetSigGenArbitrary.</param>
  1474. /// <param name="minArbitraryWaveformSize">On exit, the minimum value allowed for the
  1475. /// arbitraryWaveformSize argument supplied to ps2000aSetSigGenArbitrary.</param>
  1476. /// <param name="maxArbitraryWaveformSize">On exit, the maximum value allowed for the
  1477. /// arbitraryWaveformSize argument supplied to ps2000aSetSigGenArbitrary.</param>
  1478. /// <returns>
  1479. /// PICO_OK
  1480. /// PICO_NOT_SUPPORTED_BY_THIS_DEVICE, if the device does not have an arbitrary waveform generator.
  1481. /// PICO_NULL_PARAMETER, if all the parameter pointers are NULL.
  1482. /// PICO_INVALID_HANDLE
  1483. /// PICO_DRIVER_FUNCTION
  1484. /// </returns>
  1485. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSigGenArbitraryMinMaxValues)
  1486. (
  1487. int16_t handle,
  1488. int16_t * minArbitraryWaveformValue,
  1489. int16_t * maxArbitraryWaveformValue,
  1490. uint32_t * minArbitraryWaveformSize,
  1491. uint32_t * maxArbitraryWaveformSize
  1492. );
  1493. /// <summary>
  1494. /// This function causes a trigger event, or starts and stops gating. Use it as follows:
  1495. /// 1. Call ps2000aSetSigGenBuiltIn or ps2000aSetSigGenArbitrary to set up the signal generator,
  1496. /// setting the triggerSource argument to SIGGEN_SOFT_TRIG.
  1497. /// 2. (a)If you set the signal generator triggerType to edge triggering (PS2000A_SIGGEN_RISING or
  1498. /// PS2000A_SIGGEN_FALLING), call ps2000aSigGenSoftwareControl once to trigger a capture.
  1499. /// (b)If you set the signal generator triggerType to gated triggering (PS2000A_SIGGEN_GATE_HIGH
  1500. /// or PS2000A_SIGGEN_GATE_LOW), call ps2000aSigGenSoftwareControl with state set to 0 to start
  1501. /// capture, and then again with state set to 1 to stop capture.
  1502. /// </summary>
  1503. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1504. /// <param name="state">specifies whether to start or stop capture. Effective only when the signal
  1505. /// generator triggerType is set to SIGGEN_GATE_HIGH or SIGGEN_GATE_LOW.Ignored for other trigger types.
  1506. /// 0: to start capture
  1507. /// <> 0 : to stop </param>
  1508. /// <returns>
  1509. /// PICO_OK
  1510. /// PICO_INVALID_HANDLE
  1511. /// PICO_NO_SIGNAL_GENERATOR
  1512. /// PICO_SIGGEN_TRIGGER_SOURCE
  1513. /// PICO_DRIVER_FUNCTION
  1514. /// PICO_NOT_RESPONDING
  1515. /// </returns>
  1516. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSigGenSoftwareControl)
  1517. (
  1518. int16_t handle,
  1519. int16_t state
  1520. );
  1521. /// <summary>
  1522. /// This function is used to enable or disable ETS (equivalent-time sampling) and to set
  1523. /// the ETS parameters.See ETS overview for an explanation of ETS mode.
  1524. /// </summary>
  1525. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1526. /// <param name="mode">The ETS mode.</param>
  1527. /// <param name="etsCycles">the number of cycles to store: the computer can then select etsInterleave
  1528. /// cycles to give the most uniform spread of samples.Range: between two and five times the value of
  1529. /// etsInterleave, and not more than the appropriate MAX_ETS_CYCLES constant:
  1530. /// see #defines above.</param>
  1531. /// <param name="etsInterleave">the number of waveforms to combine into a single ETS capture.
  1532. /// see #defines above for Maximum value.</param>
  1533. /// <param name="sampleTimePicoseconds">on exit, the effective sampling interval of the ETS data.
  1534. /// For example, if the captured sample time is 4 ns and etsInterleave is 10, then the effective
  1535. /// sample time in ETS mode is 400 ps.</param>
  1536. /// <returns>
  1537. /// PICO_OK
  1538. /// PICO_USER_CALLBACK
  1539. /// PICO_INVALID_HANDLE
  1540. /// PICO_INVALID_PARAMETER
  1541. /// PICO_DRIVER_FUNCTION
  1542. /// </returns>
  1543. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetEts)
  1544. (
  1545. int16_t handle,
  1546. PS2000A_ETS_MODE mode,
  1547. int16_t etsCycles,
  1548. int16_t etsInterleave,
  1549. int32_t * sampleTimePicoseconds
  1550. );
  1551. /// <summary>
  1552. /// This function simplifies arming the trigger. It supports only the LEVEL trigger types
  1553. /// and does not allow more than one channel to have a trigger applied to it.Any previous
  1554. /// pulse width qualifier is canceled.
  1555. /// </summary>
  1556. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1557. /// <param name="enable">Zero to disable the trigger, any non-zero value to set the trigger.</param>
  1558. /// <param name="source">The channel on which to trigger.</param>
  1559. /// <param name="threshold">The ADC count at which the trigger will fire.</param>
  1560. /// <param name="direction">The direction in which the signal must move to cause a trigger.</param>
  1561. /// <param name="delay">The time between the trigger occurring and the first sample being taken.
  1562. /// For example, if delay = 100 then the scope would wait 100 sample periods before sampling.</param>
  1563. /// <param name="autoTrigger_ms">the number of milliseconds the device will wait if no trigger occurs.
  1564. /// If this is set to zero, the scope device will wait indefinitely for a trigger.</param>
  1565. /// <returns>
  1566. /// PICO_OK
  1567. /// PICO_INVALID_CHANNEL
  1568. /// PICO_INVALID_PARAMETER
  1569. /// PICO_MEMORY
  1570. /// PICO_CONDITIONS
  1571. /// PICO_INVALID_HANDLE
  1572. /// PICO_USER_CALLBACK
  1573. /// PICO_DRIVER_FUNCTION
  1574. /// </returns>
  1575. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetSimpleTrigger)
  1576. (
  1577. int16_t handle,
  1578. int16_t enable,
  1579. PS2000A_CHANNEL source,
  1580. int16_t threshold,
  1581. PS2000A_THRESHOLD_DIRECTION direction,
  1582. uint32_t delay,
  1583. int16_t autoTrigger_ms
  1584. );
  1585. /// <summary>
  1586. /// This function will set the individual Digital channels trigger directions. Each trigger
  1587. /// direction consists of a channel name and a direction.If the channel is not included in
  1588. /// the array of PS2000A_DIGITAL_CHANNEL_DIRECTIONS the driver assumes the digital
  1589. /// channel's trigger direction is PS2000A_DIGITAL_DONT_CARE.
  1590. /// </summary>
  1591. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1592. /// <param name="directions">a pointer to an array of PS2000A_DIGITAL_CHANNEL_DIRECTIONS
  1593. /// structures describing the requested properties.The array can contain a single element
  1594. /// describing the properties of one channel, or a number of elements describing several
  1595. /// digital channels.If directions is NULL, digital triggering is switched off.A digital
  1596. /// channel that is not included in the array will be set to PS2000A_DIGITAL_DONT_CARE.</param>
  1597. /// <param name="nDirections">The number of digital channel directions being passed to the driver.</param>
  1598. /// <returns>
  1599. /// PICO_OK
  1600. /// PICO_INVALID_HANDLE
  1601. /// PICO_DRIVER_FUNCTION
  1602. /// PICO_INVALID_DIGITAL_CHANNEL
  1603. /// PICO_INVALID_DIGITAL_TRIGGER_DIRECTION
  1604. /// </returns>
  1605. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetTriggerDigitalPortProperties)
  1606. (
  1607. int16_t handle,
  1608. PS2000A_DIGITAL_CHANNEL_DIRECTIONS * directions,
  1609. int16_t nDirections
  1610. );
  1611. /// <summary>
  1612. /// Mixed-signal (MSO) models in this series have two independent triggers, one for the
  1613. /// analog input channels and another for the digital inputs.This function defines how the
  1614. /// two triggers are combined.
  1615. /// </summary>
  1616. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1617. /// <param name="operand">How the analogue and digital triggers will interact with each other.</param>
  1618. /// <returns>
  1619. /// PICO_OK
  1620. /// PICO_INVALID_HANDLE
  1621. /// PICO_DRIVER_FUNCTION
  1622. /// PICO_NOT_USED
  1623. /// PICO_INVALID_PARAMETER
  1624. /// </returns>
  1625. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetDigitalAnalogTriggerOperand)
  1626. (
  1627. int16_t handle,
  1628. PS2000A_TRIGGER_OPERAND operand
  1629. );
  1630. /// <summary>
  1631. /// This function will set the individual digital channels' pulse-width trigger directions.
  1632. /// Each trigger direction consists of a channel name and a direction. If the channel is not
  1633. /// included in the array of PS2000A_DIGITAL_CHANNEL_DIRECTIONS the driver assumes the digital
  1634. /// channel's pulse-width trigger direction is PS2000A_DIGITAL_DONT_CARE.
  1635. /// </summary>
  1636. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1637. /// <param name="directions">A pointer to an array of PS2000A_DIGITAL_CHANNEL_DIRECTIONS structures
  1638. /// describing the requested properties.The array can contain a single element describing the
  1639. /// properties of one channel, or a number of elements describing several digital channels.
  1640. /// If directions is NULL, digital pulse - width triggering is switched off. A digital channel that
  1641. /// is not included in the array will be set to PS2000A_DIGITAL_DONT_CARE.</param>
  1642. /// <param name="nDirections">the number of digital channel directions being passed to the driver.</param>
  1643. /// <returns>
  1644. /// PICO_OK
  1645. /// PICO_INVALID_HANDLE
  1646. /// PICO_DRIVER_FUNCTION
  1647. /// PICO_INVALID_DIGITAL_CHANNEL
  1648. /// PICO_INVALID_DIGITAL_TRIGGER_DIRECTION
  1649. /// </returns>
  1650. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetPulseWidthDigitalPortProperties)
  1651. (
  1652. int16_t handle,
  1653. PS2000A_DIGITAL_CHANNEL_DIRECTIONS *directions,
  1654. int16_t nDirections
  1655. );
  1656. /// <summary>
  1657. /// This function is used to enable or disable triggering and set its parameters.
  1658. /// </summary>
  1659. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1660. /// <param name="channelProperties">A pointer to an array of PS2000A_TRIGGER_CHANNEL_PROPERTIES
  1661. /// structures describing the requested properties.The array can contain a single element
  1662. /// describing the properties of one channel, or a number of elements describing several channels.
  1663. /// If NULL is passed, triggering is switched off.</param>
  1664. /// <param name="nChannelProperties">The size of the channelProperties array. If zero, triggering
  1665. /// is switched off.</param>
  1666. /// <param name="auxOutputEnable">Not used.</param>
  1667. /// <param name="autoTriggerMilliseconds">The time in milliseconds for which the scope device will
  1668. /// wait before collecting data if no trigger event occurs.If this is set to zero, the scope
  1669. /// device will wait indefinitely for a trigger.</param>
  1670. /// <returns>
  1671. /// PICO_OK
  1672. /// PICO_INVALID_HANDLE
  1673. /// PICO_USER_CALLBACK
  1674. /// PICO_TRIGGER_ERROR
  1675. /// PICO_MEMORY
  1676. /// PICO_INVALID_TRIGGER_PROPERTY
  1677. /// PICO_DRIVER_FUNCTION
  1678. /// PICO_INVALID_PARAMETER
  1679. /// </returns>
  1680. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetTriggerChannelProperties)
  1681. (
  1682. int16_t handle,
  1683. PS2000A_TRIGGER_CHANNEL_PROPERTIES * channelProperties,
  1684. int16_t nChannelProperties,
  1685. int16_t auxOutputEnable,
  1686. int32_t autoTriggerMilliseconds
  1687. );
  1688. /// <summary>
  1689. /// This function sets up trigger conditions on the scope's inputs. The trigger is defined by
  1690. /// one or more PS2000A_TRIGGER_CONDITIONS structures that are then ORed together. Each structure
  1691. /// is itself the AND of the states of one or more of the inputs.This AND - OR logic allows
  1692. /// you to create any possible Boolean function of the scope's inputs.
  1693. ///
  1694. /// If complex triggering is not required, use ps2000aSetSimpleTrigger.
  1695. /// </summary>
  1696. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1697. /// <param name="conditions">An array of PS2000A_TRIGGER_CONDITIONS structures specifying the
  1698. /// conditions that should be applied to each channel. In the simplest case, the array consists
  1699. /// of a single element.When there is more than one element, the overall trigger condition is
  1700. /// the logical OR of all the elements.</param>
  1701. /// <param name="nConditions">The number of elements in the conditions array. If nConditions is zero
  1702. /// then triggering is switched.</param>
  1703. /// <returns>
  1704. /// PICO_OK
  1705. /// PICO_INVALID_HANDLE
  1706. /// PICO_USER_CALLBACK
  1707. /// PICO_CONDITIONS
  1708. /// PICO_MEMORY
  1709. /// PICO_DRIVER_FUNCTION
  1710. /// </returns>
  1711. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetTriggerChannelConditions)
  1712. (
  1713. int16_t handle,
  1714. PS2000A_TRIGGER_CONDITIONS * conditions,
  1715. int16_t nConditions
  1716. );
  1717. /// <summary>
  1718. /// This function sets the direction of the trigger for each channel.
  1719. ///
  1720. /// If using a level trigger in conjunction with a pulse - width trigger, see the
  1721. /// description of the direction argument to ps2000aSetPulseWidthQualifier for more information.
  1722. /// </summary>
  1723. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1724. /// <param name="channelA">The direction in which the signal must pass through the threshold
  1725. /// to activate the trigger.</param>
  1726. /// <param name="channelB">The direction in which the signal must pass through the threshold
  1727. /// to activate the trigger.</param>
  1728. /// <param name="channelC">The direction in which the signal must pass through the threshold
  1729. /// to activate the trigger. Four channel variants only.</param>
  1730. /// <param name="channelD">The direction in which the signal must pass through the threshold
  1731. /// to activate the trigger. Four channel variants only.</param>
  1732. /// <param name="ext">The direction in which the signal must pass through the threshold
  1733. /// to activate the trigger.</param></param>
  1734. /// <param name="aux">Not used.</param></param>
  1735. /// <returns>
  1736. /// PICO_OK
  1737. /// PICO_INVALID_HANDLE
  1738. /// PICO_USER_CALLBACK
  1739. /// PICO_INVALID_PARAMETER
  1740. /// </returns>
  1741. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetTriggerChannelDirections)
  1742. (
  1743. int16_t handle,
  1744. PS2000A_THRESHOLD_DIRECTION channelA,
  1745. PS2000A_THRESHOLD_DIRECTION channelB,
  1746. PS2000A_THRESHOLD_DIRECTION channelC,
  1747. PS2000A_THRESHOLD_DIRECTION channelD,
  1748. PS2000A_THRESHOLD_DIRECTION ext,
  1749. PS2000A_THRESHOLD_DIRECTION aux
  1750. );
  1751. /// <summary>
  1752. /// This function sets the post-trigger delay, which causes capture to start a defined time
  1753. /// after the trigger event.
  1754. /// </summary>
  1755. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1756. /// <param name="delay">The time between the trigger occurring and the first sample. For example,
  1757. /// if delay=100 then the scope would wait 100 sample periods before sampling.At a timebase of
  1758. /// 1GS/s, or 1ns per sample, the total delay would then be 100 x 1 ns = 100 ns.Range:
  1759. /// 0 to MAX_DELAY_COUNT.</param>
  1760. /// <returns>
  1761. /// PICO_OK
  1762. /// PICO_INVALID_HANDLE
  1763. /// PICO_USER_CALLBACK
  1764. /// PICO_DRIVER_FUNCTION
  1765. /// </returns>
  1766. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetTriggerDelay)
  1767. (
  1768. int16_t handle,
  1769. uint32_t delay
  1770. );
  1771. /// <summary>
  1772. /// This function sets up the conditions for pulse width qualification, which is used with
  1773. /// either threshold triggering, level triggering or window triggering to produce
  1774. /// time - qualified triggers.
  1775. /// </summary>
  1776. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1777. /// <param name="conditions">This function sets up the conditions for pulse width qualification,
  1778. /// which is used with either threshold triggering, level triggering or window triggering to
  1779. /// produce time - qualified triggers.</param>
  1780. /// <param name="nConditions">The number of elements in the conditions array. If nConditions is
  1781. /// zero then the pulse-width qualifier is not used. Range:
  1782. /// 0 to PS2000A_MAX_PULSE_WIDTH_QUALIFIER_COUNT.</param>
  1783. /// <param name="directions">the direction of the signal required for the pulse width trigger to
  1784. /// fire.See PS2000A_THRESHOLD_DIRECTION constants for the list of possible values.Each channel
  1785. /// of the oscilloscope(except the EXT input) has two thresholds for each direction�for example,
  1786. /// PS2000A_RISING and PS2000A_RISING_LOWER � so that one can be used for the pulse - width
  1787. /// qualifier and the other for the level trigger.The driver will not let you use the same
  1788. /// threshold for both triggers; so, for example, you cannot use PS2000A_RISING as the direction
  1789. /// argument for both ps2000aSetTriggerConditions and ps2000aSetPulseWidthQualifier at the same
  1790. /// time. There is no such restriction when using window triggers.</param>
  1791. /// <param name="lower">The lower limit of the pulse-width counter, measured in sample periods.</param>
  1792. /// <param name="upper">The upper limit of the pulse-width counter, measured in sample periods.
  1793. /// This parameter is used only when the type is set to PS2000A_PW_TYPE_IN_RANGE or
  1794. /// PS2000A_PW_TYPE_OUT_OF_RANGE.</param>
  1795. /// <param name="type">The pulse-width type.</param>
  1796. /// <returns>
  1797. /// PICO_OK
  1798. /// PICO_INVALID_HANDLE
  1799. /// PICO_USER_CALLBACK
  1800. /// PICO_DRIVER_FUNCTION
  1801. /// </returns>
  1802. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetPulseWidthQualifier)
  1803. (
  1804. int16_t handle,
  1805. PS2000A_PWQ_CONDITIONS * conditions,
  1806. int16_t nConditions,
  1807. PS2000A_THRESHOLD_DIRECTION direction,
  1808. uint32_t lower,
  1809. uint32_t upper,
  1810. PS2000A_PULSE_WIDTH_TYPE type
  1811. );
  1812. /// <summary>
  1813. /// This function discovers whether a trigger, or pulse width triggering, is enabled.
  1814. /// </summary>
  1815. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1816. /// <param name="triggerEnabled">on exit, indicates whether the trigger will successfully
  1817. /// be set when ps2000aRunBlock or ps2000aRunStreaming is called.A non - zero value indicates
  1818. /// that the trigger is set, zero that the trigger is not set.</param>
  1819. /// <param name="pulseWidthQualifierEnabled">on exit, indicates whether the pulse width
  1820. /// qualifier will successfully be set when ps2000aRunBlock or ps2000aRunStreaming is
  1821. /// called.A non - zero value indicates that the pulse width qualifier is set, zero that
  1822. /// the pulse width qualifier is not set.</param>
  1823. /// <returns>
  1824. /// PICO_OK
  1825. /// PICO_INVALID_HANDLE
  1826. /// PICO_NULL_PARAMETER
  1827. /// PICO_DRIVER_FUNCTION
  1828. /// </returns>
  1829. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aIsTriggerOrPulseWidthQualifierEnabled)
  1830. (
  1831. int16_t handle,
  1832. int16_t * triggerEnabled,
  1833. int16_t * pulseWidthQualifierEnabled
  1834. );
  1835. /// <summary>
  1836. /// This function gets the time, as two 4-byte values, at which the trigger occurred. Call it
  1837. /// after block - mode data has been captured or when data has been retrieved from a
  1838. /// previous block - mode capture.A 64 - bit version of this function,
  1839. /// ps2000aGetTriggerTimeOffset64, is also available.
  1840. /// </summary>
  1841. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1842. /// <param name="timeUpper">on exit, the upper 32 bits of the time at which the trigger point occurred.</param>
  1843. /// <param name="timeLower">on exit, the lower 32 bits of the time at which the trigger point occurred.</param>
  1844. /// <param name="timeUnits">returns the time units in which timeUpper and timeLower are measured.</param>
  1845. /// <param name="segmentIndex">the number of the memory segment for which the information is required.</param>
  1846. /// <returns>
  1847. /// PICO_OK
  1848. /// PICO_INVALID_HANDLE
  1849. /// PICO_DEVICE_SAMPLING
  1850. /// PICO_SEGMENT_OUT_OF_RANGE
  1851. /// PICO_NOT_USED_IN_THIS_CAPTURE_MODE
  1852. /// PICO_NOT_RESPONDING
  1853. /// PICO_NULL_PARAMETER
  1854. /// PICO_NO_SAMPLES_AVAILABLE
  1855. /// PICO_DRIVER_FUNCTION
  1856. /// </returns>
  1857. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetTriggerTimeOffset)
  1858. (
  1859. int16_t handle,
  1860. uint32_t * timeUpper,
  1861. uint32_t * timeLower,
  1862. PS2000A_TIME_UNITS * timeUnits,
  1863. uint32_t segmentIndex
  1864. );
  1865. /// <summary>
  1866. /// This function gets the time, as a single 64-bit value, at which the trigger occurred. Call
  1867. /// it after block - mode data has been captured or when data has been retrieved from a
  1868. /// previous block - mode capture.A 32 - bit version of this function, ps2000aGetTriggerTimeOffset,
  1869. /// is also available.
  1870. /// </summary>
  1871. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1872. /// <param name="time">On exit, the time at which the trigger point occurred.</param>
  1873. /// <param name="timeUnits">On exit, the time units in which time is measured.</param>
  1874. /// <param name="segmentIndex">Yhe number of the memory segment for which the information is required.</param>
  1875. /// <returns>
  1876. /// </returns>
  1877. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetTriggerTimeOffset64)
  1878. (
  1879. int16_t handle,
  1880. int64_t * time,
  1881. PS2000A_TIME_UNITS * timeUnits,
  1882. uint32_t segmentIndex
  1883. );
  1884. /// <summary>
  1885. /// This function retrieves the time offsets, as lower and upper 32-bit values, for
  1886. /// waveforms obtained in rapid block mode.The time offset of a waveform is the delay
  1887. /// from the trigger sampling instant to the time at which the driver estimates the
  1888. /// waveform to have crossed the trigger threshold.You can add this offset to the time of
  1889. /// each sample in the waveform to reduce trigger jitter.Without using the time offset,
  1890. /// trigger jitter can be up to 1 sample period; adding the time offset reduces jitter to a
  1891. /// small fraction of a sample period.This function is provided for use in programming
  1892. /// environments that do not support 64 - bit integers.If your programming environment
  1893. /// supports this data type, it is easier to use ps2000aGetValuesTriggerTimeOffsetBulk64.
  1894. /// </summary>
  1895. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1896. /// <param name="timeUpper">An array of integers. On exit, the most significant 32
  1897. /// bits of the time offset for each requested segment index.times[0] will hold the
  1898. /// fromSegmentIndex time offset and the last times index will hold the toSegmentIndex
  1899. /// time offset.The array must be long enough to hold the number of requested times.</param>
  1900. /// <param name="timeLower">An array of integers. On exit, the least significant 32 bits
  1901. /// of the time offset for each requested segment index.times[0] will hold the
  1902. /// fromSegmentIndex time offset and the last times index will hold the toSegmentIndex
  1903. /// time offset.The array size must be long enough to hold the number of requested times.</param>
  1904. /// <param name="timeUnits">An array of integers. The array must be long enough to hold
  1905. /// the number of requested times.On exit, timeUnits[0] will contain the time unit for
  1906. /// fromSegmentIndex and the last element will contain the time unit for toSegmentIndex.
  1907. /// Refer to ps2000aGetTriggerTimeOffset for allowable values.</param>
  1908. /// <param name="fromSegmentIndex">The first segment for which the time offset is required</param>
  1909. /// <param name="toSegmentIndex">The last segment for which the time offset is required.
  1910. /// If toSegmentIndex is less than fromSegmentIndex then the driver will wrap around
  1911. /// from the last segment to the first.</param>
  1912. /// <returns>
  1913. /// PICO_OK
  1914. /// PICO_INVALID_HANDLE
  1915. /// PICO_NOT_USED_IN_THIS_CAPTURE_MODE
  1916. /// PICO_NOT_RESPONDING
  1917. /// PICO_NULL_PARAMETER
  1918. /// PICO_DEVICE_SAMPLING
  1919. /// PICO_SEGMENT_OUT_OF_RANGE
  1920. /// PICO_NO_SAMPLES_AVAILABLE
  1921. /// PICO_DRIVER_FUNCTION
  1922. /// </returns>
  1923. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValuesTriggerTimeOffsetBulk)
  1924. (
  1925. int16_t handle,
  1926. uint32_t * timesUpper,
  1927. uint32_t * timesLower,
  1928. PS2000A_TIME_UNITS * timeUnits,
  1929. uint32_t fromSegmentIndex,
  1930. uint32_t toSegmentIndex
  1931. );
  1932. /// <summary>
  1933. /// This function retrieves the 64-bit time offsets for waveforms captured in rapid block mode.
  1934. /// A 32 - bit version of this function, ps2000aGetValuesTriggerTimeOffsetBulk, is available
  1935. /// for use with programming languages that do not support 64 - bit integers.
  1936. /// </summary>
  1937. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1938. /// <param name="times">an array of integers. On exit, this will hold the time offset
  1939. /// for each requested segment index.times[0] will hold the time offset for fromSegmentIndex,
  1940. /// and the last times index will hold the time offset for toSegmentIndex.The array must be
  1941. /// long enough to hold the number of times requested.</param>
  1942. /// <param name="timeUnits">an array of integers long enough to hold the number of requested
  1943. /// times.timeUnits[0] will contain the time unit for fromSegmentIndex, and the last element
  1944. /// will contain the toSegmentIndex. Refer to ps2000aGetTriggerTimeOffset64 for specific
  1945. /// figures.</param>
  1946. /// <param name="fromSegmentIndex">the first segment for which the time offset is required.
  1947. /// The results for this segment will be placed in times[0] and timeUnits[0].</param>
  1948. /// <param name="toSegmentIndex">the last segment for which the time offset is required.
  1949. /// The results for this segment will be placed in the last elements of the times and
  1950. /// timeUnits arrays.If toSegmentIndex is less than fromSegmentIndex then the driver
  1951. /// will wrap around from the last segment to the first.</param>
  1952. /// <returns>
  1953. /// PICO_OK
  1954. /// PICO_INVALID_HANDLE
  1955. /// PICO_NOT_USED_IN_THIS_CAPTURE_MODE
  1956. /// PICO_NOT_RESPONDING
  1957. /// PICO_NULL_PARAMETER
  1958. /// PICO_DEVICE_SAMPLING
  1959. /// PICO_SEGMENT_OUT_OF_RANGE
  1960. /// PICO_NO_SAMPLES_AVAILABLE
  1961. /// PICO_DRIVER_FUNCTION
  1962. /// </returns>
  1963. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValuesTriggerTimeOffsetBulk64)
  1964. (
  1965. int16_t handle,
  1966. int64_t * times,
  1967. PS2000A_TIME_UNITS * timeUnits,
  1968. uint32_t fromSegmentIndex,
  1969. uint32_t toSegmentIndex
  1970. );
  1971. /// <summary>
  1972. /// This function sets the number of captures to be collected in one run of rapid block
  1973. /// mode. If you do not call this function before a run, the driver will capture only one
  1974. /// waveform. Once a value has been set, the value remains constant unless changed.
  1975. /// </summary>
  1976. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1977. /// <param name="">the number of waveforms to capture in one run.</param>
  1978. /// <returns>
  1979. /// PICO_OK
  1980. /// PICO_INVALID_HANDLE
  1981. /// PICO_INVALID_PARAMETER
  1982. /// PICO_DRIVER_FUNCTION
  1983. /// </returns>
  1984. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetNoOfCaptures)
  1985. (
  1986. int16_t handle,
  1987. uint32_t * nCaptures
  1988. );
  1989. /// <summary>
  1990. /// This function finds out how many captures in rapid block mode have been processed
  1991. /// after ps2000aRunBlock has been called when either the collection completed or the
  1992. /// collection of waveforms was interrupted by calling ps2000aStop.The returned value
  1993. /// (nCaptures) can then be used to iterate through the number of segments using
  1994. /// ps2000aGetValues, or in a single call to ps2000aGetValuesBulk where it is used to
  1995. /// calculate the toSegmentIndex parameter.
  1996. /// </summary>
  1997. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  1998. /// <param name="nProcessedCaptures">Output: the number of available captures that has
  1999. /// been collected from calling ps2000aRunBlock.</param>
  2000. /// <returns>
  2001. /// PICO_OK
  2002. /// PICO_DRIVER_FUNCTION
  2003. /// PICO_INVALID_HANDLE
  2004. /// PICO_NO_SAMPLES_AVAILABLE
  2005. /// PICO_NULL_PARAMETER
  2006. /// PICO_INVALID_PARAMETER
  2007. /// PICO_SEGMENT_OUT_OF_RANGE
  2008. /// PICO_TOO_MANY_SAMPLES
  2009. /// </returns>
  2010. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetNoOfProcessedCaptures)
  2011. (
  2012. int16_t handle,
  2013. uint32_t * nProcessedCaptures
  2014. );
  2015. /// <summary>
  2016. /// This function tells the driver where to store the data, either unprocessed or
  2017. /// downsampled, that will be returned after the next call to one of the GetValues
  2018. /// functions.The function allows you to specify only a single buffer, so for aggregation
  2019. /// mode, which requires two buffers, you need to call ps2000aSetDataBuffers instead.
  2020. ///
  2021. /// You must allocate memory for the buffer before calling this function.
  2022. /// </summary>
  2023. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2024. /// <param name="channelOrPort">The analogue channel you want to use with the buffer.
  2025. /// To set the buffer for a digital port (MSO models only), use one of these values :
  2026. /// PS2000A_DIGITAL_PORT0 = 0x80
  2027. /// PS2000A_DIGITAL_PORT1 = 0x81</param>
  2028. /// <param name="buffer">The location of the buffer.</param>
  2029. /// <param name="bufferLth">The size of the buffer array.</param>
  2030. /// <param name="segmentIndex">The number of the memory segment to be used.</param>
  2031. /// <param name="mode">The downsampling mode. See PS2000A_RATIO_MODE for the available modes.</param>
  2032. /// <returns>
  2033. /// PICO_OK
  2034. /// PICO_INVALID_HANDLE
  2035. /// PICO_INVALID_CHANNEL
  2036. /// PICO_RATIO_MODE_NOT_SUPPORTED
  2037. /// PICO_SEGMENT_OUT_OF_RANGE
  2038. /// PICO_DRIVER_FUNCTION
  2039. /// PICO_INVALID_PARAMETER
  2040. /// </returns>
  2041. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetDataBuffer)
  2042. (
  2043. int16_t handle,
  2044. int32_t channelOrPort,
  2045. int16_t * buffer,
  2046. int32_t bufferLth,
  2047. uint32_t segmentIndex,
  2048. PS2000A_RATIO_MODE mode
  2049. );
  2050. /// <summary>
  2051. /// This function tells the driver the location of one or two buffers for receiving data. You
  2052. /// need to allocate memory for the buffers before calling this function.If you do not need
  2053. /// two buffers, because you are not using aggregate mode, you can optionally use
  2054. /// ps2000aSetDataBuffer instead.
  2055. /// </summary>
  2056. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2057. /// <param name="channelOrPort">The analogue channel you want to use with the buffer.
  2058. /// To set the buffer for a digital port (MSO models only), use one of these values :
  2059. /// PS2000A_DIGITAL_PORT0 = 0x80
  2060. /// PS2000A_DIGITAL_PORT1 = 0x81</param>
  2061. /// <param name="bufferMax">A buffer to receive the maximum data values in aggregation mode,
  2062. /// or the non - aggregated values otherwise.</param>
  2063. /// <param name="bufferMin">A buffer to receive the minimum aggregated data values. Not used
  2064. /// in other downsampling modes.</param>
  2065. /// <param name="bufferLth">The size of the buffer array.</param>
  2066. /// <param name="segmentIndex">The number of the memory segment to be used.</param>
  2067. /// <param name="mode">The downsampling mode. See PS2000A_RATIO_MODE for the available modes.</param>
  2068. /// <returns>
  2069. /// PICO_OK
  2070. /// PICO_INVALID_HANDLE
  2071. /// PICO_INVALID_CHANNEL
  2072. /// PICO_RATIO_MODE_NOT_SUPPORTED
  2073. /// PICO_SEGMENT_OUT_OF_RANGE
  2074. /// PICO_DRIVER_FUNCTION
  2075. /// PICO_INVALID_PARAMETER
  2076. /// </returns>
  2077. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetDataBuffers)
  2078. (
  2079. int16_t handle,
  2080. int32_t channelOrPort,
  2081. int16_t * bufferMax,
  2082. int16_t * bufferMin,
  2083. int32_t bufferLth,
  2084. uint32_t segmentIndex,
  2085. PS2000A_RATIO_MODE mode
  2086. );
  2087. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSetUnscaledDataBuffers)
  2088. (
  2089. int16_t handle,
  2090. PS2000A_CHANNEL channelOrPort,
  2091. int8_t *bufferMax,
  2092. int8_t *bufferMin,
  2093. int32_t bufferLth,
  2094. uint32_t segmentIndex,
  2095. PS2000A_RATIO_MODE mode
  2096. );
  2097. /// <summary>
  2098. /// This function tells the driver where to find your application's ETS time buffers. These
  2099. /// buffers contain the 64 - bit timing information for each ETS sample after you run a
  2100. /// block - mode ETS capture.
  2101. /// </summary>
  2102. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2103. /// <param name="buffer">An array of 64-bit words, each representing the time in
  2104. /// femtoseconds(10^-15s) at which the sample was captured.</param>
  2105. /// <param name="bufferLth">The size of the buffer array.</param>
  2106. /// <returns>
  2107. /// PICO_OK
  2108. /// PICO_INVALID_HANDLE
  2109. /// PICO_NULL_PARAMETER
  2110. /// PICO_DRIVER_FUNCTION
  2111. /// </returns>
  2112. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetEtsTimeBuffer)
  2113. (
  2114. int16_t handle,
  2115. int64_t * buffer,
  2116. int32_t bufferLth
  2117. );
  2118. /// <summary>
  2119. /// This function tells the driver where to find your application's ETS time buffers. These
  2120. /// buffers contain the timing information for each ETS sample after you run a block - mode
  2121. /// ETS capture.There are two buffers containing the upper and lower 32 - bit parts of the
  2122. /// timing information, to allow programming languages that do not support 64 - bit data to
  2123. /// retrieve the timings.
  2124. /// If your programming language supports 64 - bit data then you can use ps2000aSetEtsTimeBuffer
  2125. /// instead.
  2126. /// </summary>
  2127. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2128. /// <param name="timeUpper">An array of 32-bit words, each representing the upper
  2129. /// 32 bits of the time in femtoseconds(10^�15s) at which the sample was captured.</param>
  2130. /// <param name="timeLower">An array of 32-bit words, each representing the lower
  2131. /// 32 bits of the time in femtoseconds(10^�15s) at which the sample was captured.</param>
  2132. /// <param name="bufferLth">The size of the timeUpper and timeLower arrays.</param>
  2133. /// <returns>
  2134. /// PICO_OK
  2135. /// PICO_INVALID_HANDLE
  2136. /// PICO_NULL_PARAMETER
  2137. /// PICO_DRIVER_FUNCTION
  2138. /// </returns>
  2139. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aSetEtsTimeBuffers)
  2140. (
  2141. int16_t handle,
  2142. uint32_t * timeUpper,
  2143. uint32_t * timeLower,
  2144. int32_t bufferLth
  2145. );
  2146. /// <summary>
  2147. /// This function may be used instead of a callback function to receive data from
  2148. /// ps2000aRunBlock.To use this method, pass a NULL pointer as the lpReady argument
  2149. /// to ps2000aRunBlock.You must then poll the driver to see if it has finished collecting
  2150. /// the requested samples.
  2151. /// </summary>
  2152. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2153. /// <param name="ready">Output: indicates the state of the collection. If zero, the
  2154. /// device is still collecting.If non - zero, the device has finished collecting and
  2155. /// ps2000aGetValues can be used to retrieve the data.</param>
  2156. /// <returns>
  2157. /// PICO_OK
  2158. /// PICO_INVALID_HANDLE
  2159. /// PICO_DRIVER_FUNCTION
  2160. /// PICO_NULL_PARAMETER
  2161. /// PICO_NO_SAMPLES_AVAILABLE
  2162. /// PICO_CANCELLED
  2163. /// PICO_NOT_RESPONDING
  2164. /// </returns>
  2165. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aIsReady)
  2166. (
  2167. int16_t handle,
  2168. int16_t * ready
  2169. );
  2170. /// <summary>
  2171. /// This function starts collecting data in block mode. For a step-by-step guide to this
  2172. /// process, see Using block mode.The number of samples is determined by noOfPreTriggerSamples
  2173. /// and noOfPostTriggerSamples(see below for details).The total number of samples must
  2174. /// not be more than the size of the segment referred to by segmentIndex.
  2175. /// </summary>
  2176. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2177. /// <param name="noOfPreTriggerSamples">The number of samples to store before the trigger event.</param>
  2178. /// <param name="noOfPostTriggerSamples">The number of samples to store after the trigger event.
  2179. /// Note: the maximum number of samples returned is always noOfPreTriggerSamples +
  2180. /// noOfPostTriggerSamples. This is true even if no trigger event has been set.</param>
  2181. /// <param name="timebase">A number in the range 0 to 2 32�1.See the guide to calculating timebase
  2182. /// values.This argument is ignore.</param>
  2183. /// <param name="oversample">Not used.</param>
  2184. /// <param name="timeIndisposedMs">On exit, the time, in milliseconds, that the scope will spend
  2185. /// collecting samples.This does not include any auto trigger timeout. It is not valid in ETS
  2186. /// capture mode.The pointer can be set to null if a value is not required.</param>
  2187. /// <param name="segmentIndex">Zero-based, which memory segment to use.</param>
  2188. /// <param name="lpReady">A pointer to the ps2000aBlockReady callback function that the driver
  2189. /// will call when the data has been collected.To use the ps2000aIsReady polling method instead
  2190. /// of a callback function, set this pointer to NULL.</param>
  2191. /// <param name="pParameter">a void pointer that is passed to the ps2000aBlockReady callback
  2192. /// function.The callback can use this pointer to return arbitrary data to the application.</param>
  2193. /// <returns>
  2194. /// PICO_OK
  2195. /// PICO_BUFFERS_NOT_SET(in Overlapped mode)
  2196. /// PICO_INVALID_HANDLE
  2197. /// PICO_USER_CALLBACK
  2198. /// PICO_SEGMENT_OUT_OF_RANGE
  2199. /// PICO_INVALID_CHANNEL
  2200. /// PICO_INVALID_TRIGGER_CHANNEL
  2201. /// PICO_INVALID_CONDITION_CHANNEL
  2202. /// PICO_TOO_MANY_SAMPLES
  2203. /// PICO_INVALID_TIMEBASE
  2204. /// PICO_NOT_RESPONDING
  2205. /// PICO_CONFIG_FAIL
  2206. /// PICO_INVALID_PARAMETER
  2207. /// PICO_NOT_RESPONDING
  2208. /// PICO_TRIGGER_ERROR
  2209. /// PICO_DRIVER_FUNCTION
  2210. /// PICO_FW_FAIL
  2211. /// PICO_NOT_ENOUGH_SEGMENTS(in Bulk mode)
  2212. /// PICO_PULSE_WIDTH_QUALIFIER
  2213. /// PICO_SEGMENT_OUT_OF_RANGE(in Overlapped mode)
  2214. /// PICO_STARTINDEX_INVALID(in Overlapped mode)
  2215. /// PICO_INVALID_SAMPLERATIO(in Overlapped mode)
  2216. /// PICO_CONFIG_FAIL
  2217. /// </returns>
  2218. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aRunBlock)
  2219. (
  2220. int16_t handle,
  2221. int32_t noOfPreTriggerSamples,
  2222. int32_t noOfPostTriggerSamples,
  2223. uint32_t timebase,
  2224. int16_t oversample,
  2225. int32_t * timeIndisposedMs,
  2226. uint32_t segmentIndex,
  2227. ps2000aBlockReady lpReady,
  2228. void * pParameter
  2229. );
  2230. /// <summary>
  2231. /// This function tells the oscilloscope to start collecting data in streaming mode. When
  2232. /// data has been collected from the device it is downsampled if necessary and then
  2233. /// delivered to the application.Call ps2000aGetStreamingLatestValues to retrieve the
  2234. /// data. See Using streaming mode for a step - by - step guide to this process.When a
  2235. /// trigger is set, the total number of samples stored in the driver is the sum of
  2236. /// maxPreTriggerSamples and maxPostTriggerSamples.If autoStop is false, this will
  2237. /// become the maximum number of samples without downsampling.
  2238. /// </summary>
  2239. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2240. /// <param name="sampleInterval">On entry, the requested time interval between samples; on exit, the actual
  2241. /// time interval used.</param>
  2242. /// <param name="sampleIntervalTimeUnits">The maximum number of raw samples before a trigger event for each enabled
  2243. /// channel.If no trigger condition is set this argument is ignored.</param>
  2244. /// <param name="maxPreTriggerSamples">The maximum number of raw samples after a trigger event for each enabled channel.
  2245. /// If no trigger condition is set, this argument states the maximum number of samples to be stored.</param>
  2246. /// <param name="maxPostPreTriggerSamples">A flag that specifies if the streaming should stop when all of maxSamples
  2247. /// have been captured.</param>
  2248. /// <param name="autoStop">A flag that specifies if the streaming should stop when all of maxSamples have
  2249. /// been captured.</param>
  2250. /// <param name="downSampleRatio">The downsampling factor that will be applied to the raw data.</param>
  2251. /// <param name="downSampleRatioMode">See PS2000A_RATIO_MODE for available modes.</param>
  2252. /// <param name="overviewBufferSize">The size of the overview buffers. These are temporary buffers used for storing
  2253. /// the data before returning it to the application.The size is the same as the bufferLth value passed
  2254. /// to ps2000aSetDataBuffer.</param>
  2255. /// <returns>
  2256. /// PICO_OK
  2257. /// PICO_INVALID_HANDLE
  2258. /// PICO_ETS_MODE_SET
  2259. /// PICO_USER_CALLBACK
  2260. /// PICO_NULL_PARAMETER
  2261. /// PICO_INVALID_PARAMETER
  2262. /// PICO_STREAMING_FAILED
  2263. /// PICO_NOT_RESPONDING
  2264. /// PICO_TRIGGER_ERROR
  2265. /// PICO_INVALID_SAMPLE_INTERVAL
  2266. /// PICO_INVALID_BUFFER
  2267. /// PICO_DRIVER_FUNCTION
  2268. /// PICO_FW_FAIL
  2269. /// PICO_MEMORY
  2270. /// </returns>
  2271. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aRunStreaming)
  2272. (
  2273. int16_t handle,
  2274. uint32_t * sampleInterval,
  2275. PS2000A_TIME_UNITS sampleIntervalTimeUnits,
  2276. uint32_t maxPreTriggerSamples,
  2277. uint32_t maxPostPreTriggerSamples,
  2278. int16_t autoStop,
  2279. uint32_t downSampleRatio,
  2280. PS2000A_RATIO_MODE downSampleRatioMode,
  2281. uint32_t overviewBufferSize
  2282. );
  2283. /// <summary>
  2284. /// This function instructs the driver to return the next block of values to your
  2285. /// ps2000aStreamingReady callback function.You must have previously called
  2286. /// ps2000aRunStreaming beforehand to set up streaming.
  2287. /// </summary>
  2288. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2289. /// <param name="lpPs2000aReady">a pointer to your ps2000aStreamingReady callback function.</param>
  2290. /// <param name="pParameter">a void pointer that will be passed to the ps2000aStreamingReady
  2291. /// callback function.The callback function may optionally use this pointer to return
  2292. /// information to the application.</param>
  2293. /// <returns>
  2294. /// PICO_OK
  2295. /// PICO_INVALID_HANDLE
  2296. /// PICO_NO_SAMPLES_AVAILABLE
  2297. /// PICO_INVALID_CALL
  2298. /// PICO_BUSY
  2299. /// PICO_NOT_RESPONDING
  2300. /// PICO_DRIVER_FUNCTION
  2301. /// </returns>
  2302. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetStreamingLatestValues)
  2303. (
  2304. int16_t handle,
  2305. ps2000aStreamingReady lpPs2000aReady,
  2306. void * pParameter
  2307. );
  2308. /// <summary>
  2309. /// This function returns the number of samples available after data collection in
  2310. /// streaming mode.Call it after calling ps2000aStop.
  2311. /// </summary>
  2312. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2313. /// <param name="noOfValues">On exit, the number of samples.</param>
  2314. /// <returns>
  2315. /// PICO_OK
  2316. /// PICO_INVALID_HANDLE
  2317. /// PICO_NULL_PARAMETER
  2318. /// PICO_NO_SAMPLES_AVAILABLE
  2319. /// PICO_NOT_USED
  2320. /// PICO_BUSY
  2321. /// PICO_DRIVER_FUNCTION
  2322. /// </returns>
  2323. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aNoOfStreamingValues)
  2324. (
  2325. int16_t handle,
  2326. uint32_t * noOfValues
  2327. );
  2328. /// <summary>
  2329. /// This function returns the maximum downsampling ratio that can be used for a given
  2330. /// number of samples in a given downsampling mode
  2331. /// </summary>
  2332. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2333. /// <param name="noOfUnaggreatedSamples">The number of unprocessed samples to be downsampled.</param>
  2334. /// <param name="maxDownSampleRatio">The maximum possible downsampling ratio output.</param>
  2335. /// <param name="downSampleRatioMode">See PS2000A_RATIO_MODE available modes.</param>
  2336. /// <param name="segmentIndex">The memory segment where the data is stored.</param>
  2337. /// <returns>
  2338. /// PICO_OK
  2339. /// PICO_INVALID_HANDLE
  2340. /// PICO_NO_SAMPLES_AVAILABLE
  2341. /// PICO_NULL_PARAMETER
  2342. /// PICO_INVALID_PARAMETER
  2343. /// PICO_SEGMENT_OUT_OF_RANGE
  2344. /// PICO_TOO_MANY_SAMPLES
  2345. /// </returns>
  2346. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetMaxDownSampleRatio)
  2347. (
  2348. int16_t handle,
  2349. uint32_t noOfUnaggreatedSamples,
  2350. uint32_t * maxDownSampleRatio,
  2351. PS2000A_RATIO_MODE downSampleRatioMode,
  2352. uint32_t segmentIndex
  2353. );
  2354. /// <summary>
  2355. /// This function returns block-mode data, with or without downsampling, starting at the
  2356. /// specified sample number.It is used to get the stored data from the driver after data
  2357. /// collection has stopped.
  2358. /// </summary>
  2359. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2360. /// <param name="startIndex">A zero-based index that indicates the start point for
  2361. /// data collection.It is measured in sample intervals from the start of the buffer.</param>
  2362. /// <param name="noOfSamples">On entry, the number of samples required. On exit,
  2363. /// the actual number retrieved. The number of samples retrieved will not be more than the
  2364. /// number requested, and the data retrieved starts at startIndex.</param>
  2365. /// <param name="downSampleRatio">The downsampling factor that will be applied to the raw data.</param>
  2366. /// <param name="downSampleRatioMode">Downsampling mode to use. The available values are :
  2367. /// PS2000A_RATIO_MODE_NONE(downSampleRatio is ignored)
  2368. /// PS2000A_RATIO_MODE_AGGREGATE
  2369. /// PS2000A_RATIO_MODE_AVERAGE
  2370. /// PS2000A_RATIO_MODE_DECIMATE
  2371. /// AGGREGATE, AVERAGE, DECIMATE are single - bit constants that can be ORed to apply multiple
  2372. /// downsampling modes to the same data.</param>
  2373. /// <param name="segmentIndex">The zero-based number of the memory segment where the data is stored.</param>
  2374. /// <param name="overflow">On exit, a set of flags that indicate whether an overvoltage has occurred
  2375. /// on any of the channels.It is a bit field with bit 0 denoting Channel.</param>
  2376. /// <returns>
  2377. /// PICO_OK
  2378. /// PICO_INVALID_HANDLE
  2379. /// PICO_NO_SAMPLES_AVAILABLE
  2380. /// PICO_DEVICE_SAMPLING
  2381. /// PICO_NULL_PARAMETER
  2382. /// PICO_SEGMENT_OUT_OF_RANGE
  2383. /// PICO_STARTINDEX_INVALID
  2384. /// PICO_ETS_NOT_RUNNING
  2385. /// PICO_BUFFERS_NOT_SET
  2386. /// PICO_INVALID_PARAMETER
  2387. /// PICO_TOO_MANY_SAMPLES
  2388. /// PICO_DATA_NOT_AVAILABLE
  2389. /// PICO_STARTINDEX_INVALID
  2390. /// PICO_INVALID_SAMPLERATIO
  2391. /// PICO_INVALID_CALL
  2392. /// PICO_NOT_RESPONDING
  2393. /// PICO_MEMORY
  2394. /// PICO_RATIO_MODE_NOT_SUPPORTED
  2395. /// PICO_DRIVER_FUNCTION
  2396. /// </returns>
  2397. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValues)
  2398. (
  2399. int16_t handle,
  2400. uint32_t startIndex,
  2401. uint32_t * noOfSamples,
  2402. uint32_t downSampleRatio,
  2403. PS2000A_RATIO_MODE downSampleRatioMode,
  2404. uint32_t segmentIndex,
  2405. int16_t * overflow
  2406. );
  2407. /// <summary>
  2408. /// This function retrieves waveforms captured using rapid block mode. The waveforms
  2409. /// must have been collected sequentially and in the same run.
  2410. /// </summary>
  2411. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2412. /// <param name="noOfSamples">On entry, the number of samples required; on exit, the actual
  2413. /// number retrieved. The number of samples retrieved will not be more than the number
  2414. /// requested.The data retrieved always starts with the first sample captured.</param>
  2415. /// <param name="fromSegmentIndex">The first segment from which the waveform should be retrieved.</param>
  2416. /// <param name="toSegmentIndex">The last segment from which the waveform should be retrieved.</param>
  2417. /// <param name="downSampleRatio">The downsampling factor that will be applied to the raw data.</param>
  2418. /// <param name="downSampleRatioMode">See PS2000A_RATIO_MODE for available modes.</param>
  2419. /// <param name="overflow">An array of integers equal to or larger than the number of waveforms to
  2420. /// be retrieved.Each segment index has a corresponding entry in the overflow array, with overflow[0]
  2421. /// containing the flags for the segment numbered fromSegmentIndex and the last element in the
  2422. /// array containing the flags for the segment numbered toSegmentIndex. Each element in the array
  2423. /// is a bit field.</param>
  2424. /// <returns>
  2425. /// PICO_OK
  2426. /// PICO_INVALID_HANDLE
  2427. /// PICO_INVALID_PARAMETER
  2428. /// PICO_INVALID_SAMPLERATIO
  2429. /// PICO_ETS_NOT_RUNNING
  2430. /// PICO_BUFFERS_NOT_SET
  2431. /// PICO_TOO_MANY_SAMPLES
  2432. /// PICO_SEGMENT_OUT_OF_RANGE
  2433. /// PICO_NO_SAMPLES_AVAILABLE
  2434. /// PICO_NOT_RESPONDING
  2435. /// PICO_DRIVER_FUNCTION
  2436. /// </returns>
  2437. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValuesBulk)
  2438. (
  2439. int16_t handle,
  2440. uint32_t * noOfSamples,
  2441. uint32_t fromSegmentIndex,
  2442. uint32_t toSegmentIndex,
  2443. uint32_t downSampleRatio,
  2444. PS2000A_RATIO_MODE downSampleRatioMode,
  2445. int16_t * overflow
  2446. );
  2447. /// <summary>
  2448. /// This function returns data either with or without downsampling, starting at the
  2449. /// specified sample number.It is used to get the stored data from the scope after data
  2450. /// collection has stopped.It returns the data using a callback.
  2451. /// </summary>
  2452. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2453. /// <param name="startIndex">A zero-based index that indicates the start point for data collection.
  2454. /// It is measured in sample intervals from the start of the buffer.</param>
  2455. /// <param name="noOfSamples">On entry, the number of samples required. On exit, the actual number
  2456. /// retrieved. The number of samples retrieved will not be more than the number requested, and the
  2457. /// data retrieved starts at startIndex.</param>
  2458. /// <param name="downSampleRatio">See The downsampling factor that will be applied to the raw data.</param>
  2459. /// <param name="downSampleRatioMode">See PS2000A_RATIO_MODE fro available modes.</param>
  2460. /// <param name="segmentIndex">The zero-based number of the memory segment where the data is stored.</param>
  2461. /// <param name="lpDataReady">A pointer to the user-supplied function that will be
  2462. /// called when the data is ready.This will be a ps2000aDataReady function for
  2463. /// block - mode data or a ps2000aStreamingReady function for streaming - mode data.</param>
  2464. /// <param name="pParameter">a void pointer that will be passed to the callback function.The
  2465. /// data type is determined by the application.</param>
  2466. /// <returns>
  2467. /// PICO_OK
  2468. /// PICO_INVALID_HANDLE
  2469. /// PICO_NO_SAMPLES_AVAILABLE
  2470. /// PICO_DEVICE_SAMPLING
  2471. /// PICO_NULL_PARAMETER
  2472. /// PICO_STARTINDEX_INVALID
  2473. /// PICO_SEGMENT_OUT_OF_RANGE
  2474. /// PICO_INVALID_PARAMETER
  2475. /// PICO_DATA_NOT_AVAILABLE
  2476. /// PICO_INVALID_SAMPLERATIO
  2477. /// PICO_INVALID_CALL
  2478. /// PICO_DRIVER_FUNCTION
  2479. /// </returns>
  2480. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValuesAsync)
  2481. (
  2482. int16_t handle,
  2483. uint32_t startIndex,
  2484. uint32_t noOfSamples,
  2485. uint32_t downSampleRatio,
  2486. PS2000A_RATIO_MODE downSampleRatioMode,
  2487. uint32_t segmentIndex,
  2488. void * lpDataReady,
  2489. void * pParameter
  2490. );
  2491. /// <summary>
  2492. /// This function allows you to make a deferred data-collection request in block mode. The
  2493. /// request will be executed, and the arguments validated, when you call
  2494. /// ps2000aRunBlock.The advantage of this function is that the driver makes contact with
  2495. /// the scope only once, when you call ps2000aRunBlock, compared with the two contacts
  2496. /// that occur when you use the conventional ps2000aRunBlock, ps2000aGetValues
  2497. /// calling sequence.This slightly reduces the dead time between successive captures in
  2498. /// block mode.
  2499. ///
  2500. /// After calling ps2000aRunBlock, you can optionally use ps2000aGetValues to request
  2501. /// further copies of the data.This might be required if you wish to display the data with
  2502. /// different data reduction settings.
  2503. /// </summary>
  2504. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2505. /// <param name="startIndex">A zero-based index that indicates the start point for data
  2506. /// collection.It is measured in sample intervals from the start of the buffer</param>
  2507. /// <param name="noOfSamples">n entry, the number of raw samples to be collected before any
  2508. /// downsampling is applied.On exit, the actual number stored in the buffer.The number of
  2509. /// samples retrieved will not be more than the number requested, and the data retrieved
  2510. /// starts at startIndex.</param>
  2511. /// <param name="downSampleRatio">The downsampling factor that will be applied to the raw data.</param>
  2512. /// <param name="downSampleRatioMode">See PS2000A_RATIO_MODE for available modes.</param>
  2513. /// <param name="segmentIndex">The zero-based number of the memory segment where the data is stored.</param>
  2514. /// <param name="overflow">An array of integers equal to or larger than the number of waveforms to
  2515. /// be retrieved.Each segment index has a corresponding entry in the overflow array, with overflow[0]
  2516. /// containing the flags for the segment numbered fromSegmentIndex and the last element in the array
  2517. /// containing the flags for the segment numbered toSegmentIndex.Each element in the array is a bit field</param>
  2518. /// <returns>
  2519. /// PICO_OK
  2520. /// PICO_INVALID_HANDLE
  2521. /// PICO_INVALID_PARAMETER
  2522. /// PICO_DRIVER_FUNCTION
  2523. /// </returns>
  2524. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValuesOverlapped)
  2525. (
  2526. int16_t handle,
  2527. uint32_t startIndex,
  2528. uint32_t * noOfSamples,
  2529. uint32_t downSampleRatio,
  2530. PS2000A_RATIO_MODE downSampleRatioMode,
  2531. uint32_t segmentIndex,
  2532. int16_t * overflow
  2533. );
  2534. /// <summary>
  2535. /// This function allows you to make a deferred data-collection request, which will later be
  2536. /// executed, and the arguments validated, when you call ps2000aRunBlock in rapid block
  2537. /// mode.The advantage of this method is that the driver makes contact with the scope
  2538. /// only once, when you call ps2000aRunBlock, compared with the two contacts that occur
  2539. /// when you use the conventional ps2000aRunBlock, ps2000aGetValuesBulk calling
  2540. /// sequence.This slightly reduces the dead time between successive captures in rapid
  2541. /// block mode.
  2542. ///
  2543. /// After calling ps2000aRunBlock, you can optionally use ps2000aGetValues to request
  2544. /// further copies of the data.This might be required if you wish to display the data with
  2545. /// different data reduction settings.
  2546. /// </summary>
  2547. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2548. /// <param name="startIndex">A zero-based index that indicates the start point for data
  2549. /// collection.It is measured in sample intervals from the start of the buffer</param>
  2550. /// <param name="noOfSamples">On entry, the number of samples required; on exit, the actual
  2551. /// number retrieved. The number of samples retrieved will not be more than the number
  2552. /// requested.The data retrieved always starts with the first sample captured.</param>
  2553. /// <param name="downSampleRatio">The downsampling factor that will be applied to the raw data.</param>
  2554. /// <param name="downSampleRatioMode">See PS2000A_RATIO_MODE for available modes.</param>
  2555. /// <param name="fromSegmentIndex">The first segment from which the waveform should be retrieved.</param>
  2556. /// <param name="toSegmentIndex">The last segment from which the waveform should be retrieved.</param>
  2557. /// <param name="overflow">An array of integers equal to or larger than the number of waveforms to
  2558. /// be retrieved.Each segment index has a corresponding entry in the overflow array, with overflow[0]
  2559. /// containing the flags for the segment numbered fromSegmentIndex and the last element in the
  2560. /// array containing the flags for the segment numbered toSegmentIndex. Each element in the array
  2561. /// is a bit field.</param>
  2562. /// <returns>
  2563. /// PICO_OK
  2564. /// PICO_INVALID_HANDLE
  2565. /// PICO_INVALID_PARAMETER
  2566. /// PICO_DRIVER_FUNCTION
  2567. /// </returns>
  2568. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetValuesOverlappedBulk)
  2569. (
  2570. int16_t handle,
  2571. uint32_t startIndex,
  2572. uint32_t * noOfSamples,
  2573. uint32_t downSampleRatio,
  2574. PS2000A_RATIO_MODE downSampleRatioMode,
  2575. uint32_t fromSegmentIndex,
  2576. uint32_t toSegmentIndex,
  2577. int16_t * overflow
  2578. );
  2579. /// <summary>
  2580. /// This function stops the scope device from sampling data. If this function is called
  2581. /// before a trigger event occurs, the oscilloscope may not contain valid data. Always
  2582. /// call this function after the end of a capture to ensure that the scope is ready
  2583. /// for the next capture.
  2584. /// </summary>
  2585. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2586. /// <returns>
  2587. /// PICO_OK
  2588. /// PICO_INVALID_HANDLE
  2589. /// PICO_USER_CALLBACK
  2590. /// PICO_DRIVER_FUNCTION
  2591. /// </returns>
  2592. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aStop)
  2593. (
  2594. int16_t handle
  2595. );
  2596. /// <summary>
  2597. /// This function has no effect and is reserved for future use.
  2598. /// </summary>
  2599. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2600. /// <param name="holdoff">Reserved for future use.</param>
  2601. /// <param name="type">Reserved for future use.</param>
  2602. /// <returns>
  2603. /// PICO_OK
  2604. /// PICO_INVALID_HANDLE
  2605. /// PICO_NULL_PARAMETER
  2606. /// PICO_NO_SAMPLES_AVAILABLE
  2607. /// PICO_NOT_USED
  2608. /// PICO_BUSY
  2609. /// PICO_DRIVER_FUNCTION
  2610. /// </returns>
  2611. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aHoldOff)
  2612. (
  2613. int16_t handle,
  2614. uint64_t holdoff,
  2615. PS2000A_HOLDOFF_TYPE type
  2616. );
  2617. /// <summary>
  2618. /// This function queries which ranges are available on a scope device.
  2619. /// </summary>
  2620. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2621. /// <param name="info">The type of information required.
  2622. /// The following value iscurrently supported : PS2000A_CI_RANGES</param>
  2623. /// <param name="probe">Not used, must be set to 0.</param>
  2624. /// <param name="ranges">An array that will be populated with available PS2000A_RANGE
  2625. /// values for the given info.If NULL, length is set tothe number of ranges available.</param>
  2626. /// <param name="length">Input: length of ranges array; output: number of elements
  2627. /// written to ranges.</param>
  2628. /// <param name="channels">The channel for which the information is required.</param>
  2629. /// <returns>
  2630. /// PICO_OK
  2631. /// PICO_HANDLE_INVALID
  2632. /// PICO_BUSY
  2633. /// PICO_DRIVER_FUNCTION
  2634. /// PICO_NOT_RESPONDING
  2635. /// PICO_NULL_PARAMETER
  2636. /// PICO_INVALID_CHANNEL
  2637. /// PICO_INVALID_INFO
  2638. /// </returns>
  2639. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetChannelInformation)
  2640. (
  2641. int16_t handle,
  2642. PS2000A_CHANNEL_INFO info,
  2643. int32_t probe,
  2644. int32_t * ranges,
  2645. int32_t * length,
  2646. int32_t channels
  2647. );
  2648. /// <summary>
  2649. /// This function counts the number of PicoScope 2000 Series (A API) units connected to
  2650. /// the computer, and returns a list of serial numbers as a string.
  2651. /// </summary>
  2652. /// <param name="count">On exit, the number of ps2000a units found.</param>
  2653. /// <param name="serials">On exit, a list of serial numbers separated by commas and terminated
  2654. /// by a final null.
  2655. ///
  2656. /// Example: AQ005 / 139, VDR61 / 356, ZOR14 / 107
  2657. ///
  2658. /// Can be NULL on entry if serial numbers are not required.</param>
  2659. /// <param name="serialLth">On entry, the length of the char buffer pointed to by serials;
  2660. /// on exit, the length of the string written to serials.</param>
  2661. /// <returns>
  2662. /// PICO_OK
  2663. /// PICO_BUSY
  2664. /// PICO_NULL_PARAMETER
  2665. /// PICO_FW_FAIL
  2666. /// PICO_CONFIG_FAIL
  2667. /// PICO_MEMORY_FAIL
  2668. /// PICO_CONFIG_FAIL_AWG
  2669. /// PICO_INITIALISE_FPGA
  2670. /// </returns>
  2671. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aEnumerateUnits)
  2672. (
  2673. int16_t * count,
  2674. int8_t * serials,
  2675. int16_t * serialLth
  2676. );
  2677. /// <summary>
  2678. /// This function can be used to check that the already opened device is still connected to
  2679. /// the USB port and communication is successful.
  2680. /// </summary>
  2681. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2682. /// <returns>
  2683. /// PICO_OK
  2684. /// PICO_INVALID_HANDLE
  2685. /// PICO_DRIVER_FUNCTION
  2686. /// PICO_BUSY
  2687. /// PICO_NOT_RESPONDING
  2688. /// </returns>
  2689. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aPingUnit)
  2690. (
  2691. int16_t handle
  2692. );
  2693. /// <summary>
  2694. /// This function returns the maximum ADC count returned by calls to the "GetValues"
  2695. /// functions.
  2696. /// </summary>
  2697. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2698. /// <param name="value">Output: the maximum ADC value.</param>
  2699. /// <returns>
  2700. /// PICO_OK
  2701. /// PICO_USER_CALLBACK
  2702. /// PICO_INVALID_HANDLE
  2703. /// PICO_TOO_MANY_SEGMENTS
  2704. /// PICO_MEMORY
  2705. /// PICO_DRIVER_FUNCTION
  2706. /// </returns>
  2707. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aMaximumValue)
  2708. (
  2709. int16_t handle,
  2710. int16_t * value
  2711. );
  2712. /// <summary>
  2713. /// This function returns the minimum ADC count returned by calls to the GetValues
  2714. /// functions
  2715. /// </summary>
  2716. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2717. /// <param name="value">Output: the minimum ADC value.</param>
  2718. /// <returns>
  2719. /// PICO_OK
  2720. /// PICO_USER_CALLBACK
  2721. /// PICO_INVALID_HANDLE
  2722. /// PICO_TOO_MANY_SEGMENTS
  2723. /// PICO_MEMORY
  2724. /// PICO_DRIVER_FUNCTION
  2725. /// </returns>
  2726. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aMinimumValue)
  2727. (
  2728. int16_t handle,
  2729. int16_t * value
  2730. );
  2731. /// <summary>
  2732. /// This function is used to get the maximum and minimum allowable analog offset for a
  2733. /// specific voltage range.
  2734. ///
  2735. /// If both maximumVoltage and minimumVoltage are NULL, the driver will return PICO_NULL_PARAMETER
  2736. /// </summary>
  2737. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2738. /// <param name="range">The voltage range to be used when gathering the min and max information.</param>
  2739. /// <param name="coupling">The type of AC/DC coupling used</param>
  2740. /// <param name="maximumVoltage">Output: maximum voltage allowed for the range. Pointer will be
  2741. /// ignored if NULL.If device does not support analog offset, zero will be returned.</param>
  2742. /// <param name="minimumVoltage">Output: minimum voltage allowed for the range. Pointer will
  2743. /// be ignored if NULL. If device does not support analog offset, zero will be returned.</param>
  2744. /// <returns>
  2745. /// PICO_OK
  2746. /// PICO_INVALID_HANDLE
  2747. /// PICO_DRIVER_FUNCTION
  2748. /// PICO_INVALID_VOLTAGE_RANGE
  2749. /// PICO_NULL_PARAMETER
  2750. /// </returns>
  2751. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetAnalogueOffset)
  2752. (
  2753. int16_t handle,
  2754. PS2000A_RANGE range,
  2755. PS2000A_COUPLING coupling,
  2756. float * maximumVoltage,
  2757. float * minimumVoltage
  2758. );
  2759. /// <summary>
  2760. /// This function returns the maximum number of segments allowed for the opened
  2761. /// variant.Refer to ps2000aMemorySegments for specific figures.
  2762. /// </summary>
  2763. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2764. /// <param name="maxSegments">Output: maximum number of segments allowed.</param>
  2765. /// <returns>
  2766. /// PICO_OK
  2767. /// PICO_INVALID_HANDLE
  2768. /// PICO_DRIVER_FUNCTION
  2769. /// PICO_NULL_PARAMETER
  2770. /// </returns>
  2771. PREF0 PREF1 PICO_STATUS PREF2 PREF3 (ps2000aGetMaxSegments)
  2772. (
  2773. int16_t handle,
  2774. uint32_t * maxSegments
  2775. );
  2776. /// <summary>
  2777. /// Retrieves the current state of the output edge detect flag
  2778. /// </summary>
  2779. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2780. /// <param name="state">Output: The current of the output edge detect</param>
  2781. /// <returns>
  2782. /// PICO_OK
  2783. /// PICO_NOT_USED
  2784. /// PICO_NULL_PARAMETER
  2785. /// PICO_NOT_SUPPORTED_BY_THIS_DEVICE
  2786. /// PICO_INVALID_HANDLE
  2787. /// PICO_DRIVER_FUNCTION
  2788. /// </returns>
  2789. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aQueryOutputEdgeDetect)
  2790. (
  2791. int16_t handle,
  2792. int16_t * state
  2793. );
  2794. /// <summary>
  2795. /// Sets the state of the output edge detect flag, Default value is TRUE
  2796. /// </summary>
  2797. /// <param name="handle">Device identifier returned by ps2000aOpenUnit.</param>
  2798. /// <param name="state">The output edge detect state to be set:
  2799. /// any none 0 value: enable
  2800. /// 0: disable</param>
  2801. /// <returns>
  2802. /// PICO_OK
  2803. /// PICO_NOT_USED
  2804. /// PICO_NULL_PARAMETER
  2805. /// PICO_NOT_SUPPORTED_BY_THIS_DEVICE
  2806. /// PICO_INVALID_HANDLE
  2807. /// PICO_DRIVER_FUNCTION
  2808. /// </returns>
  2809. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aSetOutputEdgeDetect)
  2810. (
  2811. int16_t handle,
  2812. int16_t state
  2813. );
  2814. PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps2000aGetScalingValues)
  2815. (
  2816. int16_t handle,
  2817. PS2000A_SCALING_FACTORS_VALUES *scalingValues,
  2818. int16_t nChannels
  2819. );
  2820. #endif