-
Notifications
You must be signed in to change notification settings - Fork 1
/
WX218x_DLL.py
1690 lines (1616 loc) · 65.3 KB
/
WX218x_DLL.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 26 Sep 2016
@author: Tom Barrett
'''
from ctypes import *
from pyvisa.ctwrapper.functions import get_attribute
from jinja2._stringdefs import combine
from DAQ import High_Hysteresis
# #if defined(_VI_INT64_UINT64_DEFINED)
# typedef ViUInt64 _VI_PTR ViPUInt64;
# typedef ViUInt64 _VI_PTR ViAUInt64;
# typedef ViInt64 _VI_PTR ViPInt64;
# typedef ViInt64 _VI_PTR ViAInt64;
# #endif
#
# #if defined(LONG_MAX) && (LONG_MAX > 0x7FFFFFFFL)
# typedef unsigned int ViUInt32;
# typedef _VI_SIGNED int ViInt32;
# #else
# typedef unsigned long ViUInt32;
# typedef _VI_SIGNED long ViInt32;
# #endif
#
# typedef ViUInt32 _VI_PTR ViPUInt32;
# typedef ViUInt32 _VI_PTR ViAUInt32;
# typedef ViInt32 _VI_PTR ViPInt32;
# typedef ViInt32 _VI_PTR ViAInt32;
#
# typedef unsigned short ViUInt16;
# typedef ViUInt16 _VI_PTR ViPUInt16;
# typedef ViUInt16 _VI_PTR ViAUInt16;
#
# typedef _VI_SIGNED short ViInt16;
# typedef ViInt16 _VI_PTR ViPInt16;
# typedef ViInt16 _VI_PTR ViAInt16;
#
# typedef unsigned char ViUInt8;
# typedef ViUInt8 _VI_PTR ViPUInt8;
# typedef ViUInt8 _VI_PTR ViAUInt8;
#
# typedef _VI_SIGNED char ViInt8;
# typedef ViInt8 _VI_PTR ViPInt8;
# typedef ViInt8 _VI_PTR ViAInt8;
#
# typedef char ViChar;
# typedef ViChar _VI_PTR ViPChar;
# typedef ViChar _VI_PTR ViAChar;
#
# typedef unsigned char ViByte;
# typedef ViByte _VI_PTR ViPByte;
# typedef ViByte _VI_PTR ViAByte;
#
# typedef void _VI_PTR ViAddr;
# typedef ViAddr _VI_PTR ViPAddr;
# typedef ViAddr _VI_PTR ViAAddr;
#
# typedef float ViReal32;
# typedef ViReal32 _VI_PTR ViPReal32;
# typedef ViReal32 _VI_PTR ViAReal32;
#
# typedef double ViReal64;
# typedef ViReal64 _VI_PTR ViPReal64;
# typedef ViReal64 _VI_PTR ViAReal64;
#
# typedef ViPByte ViBuf;
# typedef ViPByte ViPBuf;
# typedef ViPByte _VI_PTR ViABuf;
#
# typedef ViPChar ViString;
# typedef ViPChar ViPString;
# typedef ViPChar _VI_PTR ViAString;
#
# typedef ViString ViRsrc;
# typedef ViString ViPRsrc;
# typedef ViString _VI_PTR ViARsrc;
#
# typedef ViUInt16 ViBoolean;
# typedef ViBoolean _VI_PTR ViPBoolean;
# typedef ViBoolean _VI_PTR ViABoolean;
#
# typedef ViInt32 ViStatus;
# typedef ViStatus _VI_PTR ViPStatus;
# typedef ViStatus _VI_PTR ViAStatus;
#
# typedef ViUInt32 ViVersion;
# typedef ViVersion _VI_PTR ViPVersion;
# typedef ViVersion _VI_PTR ViAVersion;
#
# typedef ViUInt32 ViObject;
# typedef ViObject _VI_PTR ViPObject;
# typedef ViObject _VI_PTR ViAObject;
#
# typedef ViObject ViSession;
# typedef ViSession _VI_PTR ViPSession;
# typedef ViSession _VI_PTR ViASession;
#
# typedef ViUInt32 ViAttr;
#
# #ifndef _VI_CONST_STRING_DEFINED
# typedef const ViChar * ViConstString;
# #define _VI_CONST_STRING_DEFINED
# #endif
#
# /*- Completion and Error Codes ----------------------------------------------*/
#
# #define VI_SUCCESS (0L)
#
# /*- Other VISA Definitions --------------------------------------------------*/
#
# #define VI_NULL (0)
#
# #define VI_TRUE (1)
# #define VI_FALSE (0)
#
# #endif
# /*- VISA Types --------------------------------------------------------------*/
# typedef unsigned long ViUInt32;
#
# typedef signed long ViInt32;
#
# typedef unsigned short ViUInt16;
#
# typedef signed short ViInt16;
#
# typedef unsigned char ViUInt8;
#
# typedef signed char ViInt8;
#
# typedef char ViChar;
#
# typedef unsigned char ViByte;
#
# typedef void* ViAddr;
#
# typedef float ViReal32;
#
# typedef double ViReal64;
#
# typedef ViByte* ViBuf;
#
# typedef ViChar* ViString;
#
# typedef ViString ViRsrc;
#
# typedef ViUInt16 ViBoolean;
#
# typedef ViInt32 ViStatus;
#
# typedef ViUInt32 ViVersion;
#
# typedef ViUInt32 ViObject;
#
# typedef ViObject ViSession;
#
# typedef ViUInt32 ViAttr;
#
# typedef const ViChar * ViConstString;
#
# /*- Other VISA Definitions --------------------------------------------------*/
# #define VI_SUCCESS (0L)
#
# #define VI_NULL (0)
#
# #define VI_TRUE (1)
#
# #define VI_FALSE (0)
#
# #endif
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
# Some predefined mappings from Vi*** types to #
# the c_types these correspond to. #
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
ViRsrc = c_char_p
ViBoolean = c_ushort
ViSession = c_uint
ViConstString = c_char_p
ViInt16 = c_short
ViInt32 = c_int32
ViReal64 = c_double
ViChar = c_char
ViStatus = c_int32
class WX218x_DigPatternDelayMode(object):
(
COMMON, # Sets delay mode as Common for Digital Pattern Output.
SEPARATE # Sets delay mode as Separate for Digital Pattern Output.
) = map(c_int, xrange(2))
class WX218x_MarkerSource(object):
(
WAVE, # Wave marker source.
USER # User marker source.
) = map(c_int, xrange(2))
class WX218x_OperationMode(object):
'''
Commented out values are only in the WX218X_ATTR_OPERATION_MODE2 attribute
which I don't use.
'''
(
CONTINUOUS, # Generate output continuously.
BURST, # Generate a burst of waveforms when a trigger occurs.
TRIGGER, # Trigger operation mode. NOTE: THIS SEEMS TO BE THE MODE THAT RESPECTS THE BURST COUNT SETTINGS!
GATE # Gate operation mode.
) = map(c_int, xrange(4))
class WX218x_OutputMode(object):
'''
Commented out values are only in the WX218X_ATTR_OUTPUT_MODE2 attribute
which I don't use.
'''
(
FUNCTION, # Selects the standard waveform shapes.
ARBITRARY, # Selects the arbitrary waveform shapes.
SEQUENCE, # Selects the sequenced waveform output. (Not for WS8351,WS8352)
# ASEQUENCE, # Selects the advanced sequencing waveform output. (Not for WS8351,WS8352)
# MODULATION, # Selects the modulated waveforms.
# PULSE, # Selects the digital pulse function.
# PATTERN # Sets pattern output mode. (Not for WX2181,WX2182)
) = map(c_int, xrange(3))
class WX218x_SequenceAdvanceMode(object):
(
AUTO, # Specifies continuous advance where the generator steps continuously
# to the end of the sequence table and repeats the sequence from the
# start.
ONCE, # Selects the once sequence advance mode, where the generator steps
# through the sequence table automatically once except if the
# seq:once:coun programmed a value greater than 1.
STEP # Specifies the stepped sequence advance mode, where the generator
# steps to the next waveform only when a valid event signal has been
# received.
) = map(c_int32, xrange(3))
class WX218x_TraceMode(object):
(
SINGLE, # Selects the Single trace mode for download waveforms.
DUPLICATE, # Selects the Duplicate trace mode for download waveforms.
ZERO, # Selects the Zero trace mode for download waveforms.
COMBINE # Selects the Combine trace mode for download waveforms.
) = map(c_int32, xrange(4))
class WX218x_TriggerImpedance(object):
(
LOW, # Sets the trigger impedance to 50 Ohms.
HIGH # Sets the trigger impedance to 10k Ohms.
) = map(c_int32, xrange(2))
class WX218x_TriggerMode(object):
(
EXTERNAL, # Selects the TRIG IN connector as the input source. The manual
# trigger can be used in case external triggers are not available.
# All other inputs are ignored.
SOFTWARE, # Selects the remote controller as the trigger source. Only
# software commands are accepted; TRIG IN, Event IN and manual
# triggers are ignored.
TIMER, # Activates the built in internal trigger generator. BUS and
# external trigger are ignored. The period of the internal trigger
# is programmable and can be used to replace an external trigger source.
EVENT # Selects the Event IN connector as the input source. All other inputs
# are ignored.
) = map(c_int32, [1,2,4,5])
class WX218x_TriggerSlope(object):
(
POSITIVE, # Selects the positive going edge.
NEGATIVE, # Selects the negative going edge.
EITHER # Selects both positive and negative going edges.Not supported for WX2184.
) = map(c_int32, xrange(3))
class WX218x_Waveform(object):
(
SINE, # Configures the function generator to produce a sinusoid waveform.
SQUARE, # Configures the function generator to produce a square waveform.
TRIANGLE, # Configures the function generator to produce a triangle waveform.
RAMP_UP, # Configures the function generator to produce a ramp waveform.
RAMP_DOWN, # Configures the function generator to produce a ramp waveform.
DC, # Configures the function generator to produce a dc waveform.
SINC, # Configures the function generator to produce a sinc waveform.
GAUSSIAN, # Configures the function generator to produce a gaussian waveform.
EXPONENTIAL,# Configures the function generator to produce a exponential waveform.
NOISE # Configures the function generator to produce a noise waveform.
) = map(c_int32, xrange(1,11))
class WX218x_DLL(object):
"""
ctypes funcs to talk to wx218x.dll.
"""
wx218x_dll = windll.LoadLibrary('C:\\Users\\apc\\Documents\\Python Scripts\\Cold Control Heavy\\dlls\\IVI Foundation\\IVI\\Bin\\wx218x_64.dll')
# ///////////////////////////////////////////////////////////////////////////
# /*!
# Opens the I/O session to the instrument. Driver methods and properties that
# access the instrument are only accessible after Initialize is called.
# Initialize optionally performs a Reset and queries the instrument to
# validate the instrument model.
#
# Parameters
# ResourceName
# An IVI logical name or an instrument specific string that identifies
# the address of the instrument, such as a VISA resource descriptor
# string.
# IdQuery
# Specifies whether to verify the ID of the instrument.
# Reset
# Specifies whether to reset the instrument.
# Vi
# Unique identifier for an IVI session.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_init(
# ViRsrc ResourceName,
# ViBoolean IdQuery,
# ViBoolean Reset,
# ViSession* Vi
# );
init = wx218x_dll.wx218x_init
init.restype = c_int
init.argtypes = (ViRsrc, ViBoolean, ViBoolean, POINTER(ViSession))
# ///////////////////////////////////////////////////////////////////////////
# /*!
# Opens the I/O session to the instrument. Driver methods and properties that
# access the instrument are only accessible after Initialize is called.
# Initialize optionally performs a Reset and queries the instrument to validate
# the instrument model.
#
# Parameters
# ResourceName
# An IVI logical name or an instrument specific string that identifies
# the address of the instrument, such as a VISA resource descriptor
# string.
# IdQuery
# Specifies whether to verify the ID of the instrument.
# Reset
# Specifies whether to reset the instrument.
# OptionsString
# The user can use the OptionsString parameter to specify the initial
# values of certain IVI inherent attributes for the session. The
# format of an assignment in the OptionsString parameteris "Name=Value",
# where Name is one of: RangeCheck, QuerytInstrStatus, Cache, Simulate,
# RecordCoercions, InterchangeCheck,or DriverSetup. Value is either true
# or false except for DriverSetup. If the Options String parameter
# contains an assignment for the Driver Setup attribute, the Initialize
# function assumes that everything following "DriverSetup=" is part of
# the assignment.
# Vi
# Unique identifier for an IVI session.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_InitWithOptions(
# ViRsrc ResourceName,
# ViBoolean IdQuery,
# ViBoolean Reset,
# ViConstString OptionsString,
# ViSession* Vi
# );
init_with_options = wx218x_dll.wx218x_InitWithOptions
init_with_options.restype = c_int
init_with_options.argtypes = (ViRsrc, ViBoolean, ViBoolean, ViConstString, POINTER(ViSession))
# ///////////////////////////////////////////////////////////////////////////
# /*!
# Closes the I/O session to the instrument. Driver methods and properties that
# access the instrument are not accessible after Close is called.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_close(
# ViSession Vi
# );
close = wx218x_dll.wx218x_close
close.restype = c_int32
close.argtypes = (ViSession,)
# ///////////////////////////////////////////////////////////////////////////
# Places the instrument in a known state and configures instrument options on
# which the IVI specific driver depends (for example, enabling/disabling
# headers). For an IEEE 488.2 instrument, Reset sends the command string
# *RST to the instrument.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
#
# Return Value
# Success or failure code.
#
# ViStatus wx218x_reset(
# ViSession Vi
# );
reset = wx218x_dll.wx218x_reset
reset.restype = c_int32
reset.argtypes = (ViSession,)
# ///////////////////////////////////////////////////////////////////////////
# /*!
# Closes the I/O session to the instrument. Driver methods and properties that
# access the instrument are not accessible after Close is called.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
# ChannelName
# The name of the channel to enable or disable.
# Enabled
# Specifies whether the signal the function generator produces
# appears at the channel's output connector.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_ConfigureOutputEnabled(
# ViSession Vi,
# ViConstString ChannelName,
# ViBoolean Enabled
# );
'''
Not working as expected last I tried - configure seems to do the same job
(but actually do it).
'''
configure_output_enabled = wx218x_dll.wx218x_ConfigureOutputEnabled
configure_output_enabled.restype = c_int
configure_output_enabled.argtypes = (ViSession, ViConstString, ViBoolean)
# ///////////////////////////////////////////////////////////////////////////
# Sets the output terminal impedance of one of the function generator's channels.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or
# IviFgen_InitWithOptions function. The handle identifies a particular
# instrument session.
# ChannelName
# The name of the channel on which to configure the output impedance.
# For valid values, see the Channel repeated capability.
# Impedance
# Specifies the output terminal impedance. The driver uses this value
# to set the Output Impedance Attribute. See the attribute description
# for more details.
#
# Return Value
# Success or failure code.
#
# */
# ViStatus wx218x_ConfigureOutputImpedance(
# ViSession Vi,
# ViConstString ChannelName,
# ViReal64 Impedance
# );
configure_output_impedance = wx218x_dll.wx218x_ConfigureOutputImpedance
configure_output_impedance.restype = c_int
configure_output_impedance.argtypes = (ViSession, ViConstString, ViReal64)
# ///////////////////////////////////////////////////////////////////////////
# This method load waveform from file and create an arbitrary waveform.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a particular
# instrument session.
# Channel
# The physical or virtual repeated capability identifier. Pass VI_NULL if
# the operation does not apply to a repeated capability. You can also pass
# VI_NULL if the device only has a single channel.For valid values, see the
# Channel repeated capability.
# FileNameBufferSize
# Number of elements in FileName.
# FileName
# Path of the arbitrary waveform you want to download with extension ".wav",
# ".asc" or ".txt"
# Val
# Handle that identifies that waveform.
#
# Return Value
# Success or failure code.
#
# */
# ViStatus wx218x_LoadArbWfmFromFile(
# ViSession Vi,
# ViConstString Channel,
# ViInt32 FileNameBufferSize,
# ViConstString FileName,
# ViInt32* Val
# );
load_arb_wfm_from_file = wx218x_dll.wx218x_LoadArbWfmFromFile
load_arb_wfm_from_file.restype = c_int
load_arb_wfm_from_file.argtypes = (ViSession, ViConstString, ViInt32, ViConstString, POINTER(ViInt32))
# ///////////////////////////////////////////////////////////////////////////
# This method load csv waveform from file and create an arbitrary
# waveform.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init
# or IviDriver_InitWithOptions function. The handle identifies
# a particular instrument session.
# Channel
# The physical or virtual repeated capability identifier. Pass
# VI_NULL or empty string if operation does not apply to a
# repeated capability.For valid values, see the Channel
# repeated capability.
# FileNameBufferSize
# Number of elements in FileName.
# FileName
# Path of the arbitrary waveform you want to download.
# Val
# Handle that identifies that waveform.
#
# Return Value
# Success or failure code.
#
# */
# ViStatus wx218x_LoadCSVFile(
# ViSession Vi,
# ViConstString Channel,
# ViInt32 FileNameBufferSize,
# ViConstString FileName,
# ViInt32* Val
# );
load_csv_file = wx218x_dll.wx218x_LoadAsciiArbWfmFromFile
load_csv_file.restype = c_int
load_csv_file.argtypes = (ViSession, ViConstString, ViInt32, ViConstString, POINTER(ViInt32))
# ///////////////////////////////////////////////////////////////////////////
# This method creates an arbitrary waveform from array of Data values.
#
# Function Tree Node: \WX218x\Instrument Specific\Arbitrary\Waveform\Create Arbitrary Waveform
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
# DataBufferSize
# Number of elements in Data.
# Data
# Array of data you want to use for the new arbitrary waveform.
# You must normalize the data points in the array to be between
# -1.00 and +1.00.
# Val
# Handle that identifies that waveform.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_CreateArbitraryWaveform(
# ViSession Vi,
# ViInt32 DataBufferSize,
# ViReal64[] Data,
# ViInt32* Val
# );
create_arbitrary_waveform = wx218x_dll.wx218x_CreateArbitraryWaveform
create_arbitrary_waveform.restype = c_int
create_arbitrary_waveform.argtypes = (ViSession, ViInt32, POINTER(ViReal64), POINTER(ViInt32))
create_arbitrary_waveform_custom = wx218x_dll.wx218x_CreateArbitraryWaveformCustom
create_arbitrary_waveform_custom.restype = c_int
create_arbitrary_waveform_custom.argtypes = (ViSession, ViInt32, POINTER(ViInt16), POINTER(ViInt32))
# ///////////////////////////////////////////////////////////////////////////
# This method download an arbitrary waveform from arrays of Data
# (short) values,that are already in range from 0 to 16383 in
# to the both channels(Channel1 and Channel2,Channel3 and Channel4)
# when trace mode is Double or Combine (only for 4Ch. models).
#
# Function Tree Node: \WX218x\Instrument Specific\Arbitrary\Waveform\Create Custom Adv
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
# Data1BufferSize
# Number of elements in Data1.
# Data1
# Array of data you want to use for the new arbitrary waveform.
# You must normalize the data points in the array to be between
# -1.00 and +1.00.
# Data2BufferSize
# Number of elements in Data2.
# Data2
# Array of data you want to use for the new arbitrary waveform.
# You must normalize the data points in the array to be between
# -1.00 and +1.00.
# Handle1
# Handle that identifies that waveform for the first channel set.
# Handle2
# Handle that identifies that waveform for the second channel set.
#
# Return Value
# Success or failure code.
#
# */
# ViStatus wx218x_CreateCustomAdv(
# ViSession Vi,
# ViInt32 Data1BufferSize,
# ViInt16[] Data1,
# ViInt32 Data2BufferSize,
# ViInt16[] Data2,
# ViInt32* Handle1,
# ViInt32* Handle2
# );
create_custom_adv = wx218x_dll.wx218x_CreateCustomAdv
create_custom_adv.restype = c_int
create_custom_adv.argtypes = (ViSession, ViInt32, POINTER(ViInt16), ViInt32, POINTER(ViInt16), POINTER(ViInt32), POINTER(ViInt32))
# ///////////////////////////////////////////////////////////////////////////
# Specifies the factor by which the function generator scales the arbitrary
# waveforms.
#
# Function Tree Node: \WX218x\Instrument Specific\Arbitrary\Configure Arb Gain
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
# Channel
# The physical or virtual repeated capability identifier. Pass VI_NULL
# or empty string if operation does not apply to a repeated capability.
# For valid values, see the Channel repeated capability.
# Gain
#
# Return Value
# Success or failure code.
#
# Remarks
# Gain Valid Range:
# 50E-3 to 2 (WX2181,WX2182,WX2181B,WX2182B,WX2182C,WX1281B,WX1282B,
# WX2181B-D,WX2182B-D,WX1281B-D,WX1282B-D,WX2184,WX1284,
# WX2184C,WX1284C)
# 50E-3 to 4 (WS8351,WS8352)
#*/
# ViStatus wx218x_ConfigureArbGain(
# ViSession Vi,
# ViConstString Channel,
# ViReal64 Gain
# );
configure_arb_gain = wx218x_dll.wx218x_ConfigureArbGain
configure_arb_gain.restype = c_int
configure_arb_gain.argtypes = (ViSession, ViConstString, ViReal64)
# ///////////////////////////////////////////////////////////////////////////
# Configures how the function generator produces output on a channel.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or
# IviFgen_InitWithOptions function. The handle identifies a particular
# instrument session.
# ChannelName
# The name of the channel on which to configure the operation mode.
# For valid values, see the Channel repeated capability.
# OperationMode
# Specifies how the function generator produces output. The driver uses
# this value to set the Operation Mode attribute. See the attributE
# description for more details.
# Tom note: see WX218x_OperationMode enum at top of class for options.
#
# Return Value
# Success or failure code.
#
# ViStatus wx218x_ConfigureOperationMode(
# ViSession Vi,
# ViConstString ChannelName,
# ViInt32 OperationMode
# );
configure_operation_mode = wx218x_dll.wx218x_ConfigureOperationMode
configure_operation_mode.restype = c_int
configure_operation_mode.argtypes = (ViSession, ViConstString, ViInt32)
# ///////////////////////////////////////////////////////////////////////////
# Configures the output mode of the function generator. The output mode determines
# how the function generator produces waveforms.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or
# IviFgen_InitWithOptions function. The handle identifies a particular
# instrument session.
# OutputMode
# Specifies the output mode. The driver uses this value to set the Output
# Mode attribute. See the attribute description for more details.
# Tom note: see WX218x_OutputMode enum at top of class for options.
#
# Return Value
# Success or failure code.
#
# Defined Values For Parameter OutputMode
# WX218X_VAL_OUTPUT_FUNC:
# The driver uses the attributes and functions of the IviFgenStdFunc
# extension group to configure the function generator's output signal.
# WX218X_VAL_OUTPUT_ARB:
# The driver uses the attributes and functions of the IviFgenArbWfm
# extension group to configure the function generator's output signal.
# WX218X_VAL_OUTPUT_SEQ:
# The driver uses the attributes and functions of the IviFgenArbSeq
# extension group to configure the function generator's output signal.
#
# */
# ViStatus wx218x_ConfigureOutputMode(
# ViSession Vi,
# ViInt32 OutputMode
# );
configure_output_mode = wx218x_dll.wx218x_ConfigureOutputMode
configure_output_mode.restype = c_int
configure_output_mode.argtypes = (ViSession, ViInt32)
# ///////////////////////////////////////////////////////////////////////////
# Configures the function generator attributes that affect standard waveform generation.
# When the Waveform parameter is set to Waveform DC, this function ignores the Amplitude,
# Frequency, and Start Phase parameters.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or IviFgen_InitWithOptions
# function. The handle identifies a particular instrument session.
# ChannelName
# The ChannelName parameter may be a string defined by the driver or supplied as a
# virtual name in the configuration store. For single output instruments, the driver
# may define the empty string as valid ChannelName.For valid values, see the Channel
# repeated capability.
# Waveform
# Specifies the standard waveform. This value sets the Waveform property
# Amplitude
# Specifies the waveform amplitude. This value sets the Amplitude property
# DCOffset
# Specifies the waveform's DC offset. Tthis value sets the DC Offset attribute.
# Frequency
# Specifies the waveform frequency. Tthis value sets the Frequency attribute.
# StartPhase
# Specifies the waveform start phase. This value sets the Start Phase attribute.
#
# Return Value
# Success or failure code.
#
# */
# ViStatus wx218x_ConfigureStandardWaveform(
# ViSession Vi,
# ViConstString ChannelName,
# ViInt32 Waveform,
# ViReal64 Amplitude,
# ViReal64 DCOffset,
# ViReal64 Frequency,
# ViReal64 StartPhase
# );
configure_standard_waveform = wx218x_dll.wx218x_ConfigureStandardWaveform
configure_standard_waveform.restype = c_int
configure_standard_waveform.argtypes = (ViSession, ViConstString, ViInt32, ViReal64, ViReal64, ViReal64, ViReal64)
# ///////////////////////////////////////////////////////////////////////////
# This method configures the parameters of the function generator that
# affect standard waveform generation.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a particular
# instrument session.
# Channel
# The physical or virtual repeated capability identifier. Pass VI_NULL
# if the operation does not apply to a repeated capability. You can
# also pass VI_NULL if the device only has a single channel.For valid
# values, see the Channel repeated capability.
# Waveform
# Selects the standard waveform that you want the function generator
# to produce.
# Amplitude
# Sets the amplitude of the standard waveform.
# DCOffset
# Sets the DC offset of the standard waveform.
# Frequency
# Sets the frequency of the standard waveform.
# StartPhase
# Sets the horizontal offset of the standard waveform.
# Return Value
# Success or failure code.
#
# Remarks
#
# The Waveform parameter can take on any value in the WX218xWaveform enum
#
# Amplitude
# Valid Range:
# 50E-3 to 2 (WX2181,WX2182,WX2181B,WX2182B,WX2182C,WX1281B,WX1282B,
# WX2181B-D,WX2182B-D,WX1281B-D,WX1282B-D,WX2184,WX1284,
# WX2184C, WX1284C)
# 50E-3 to 4 (WS8351, WS8352)
# Default Value: 0.5
# DC Offset
# Valid Range:
# -1.0 to 1.0 (WX2184,WX1284,WX2184C,WX1284C)
# -1.5 to 1.5 (other models)
# Default Value: 0
# Frequency
# Valid Range:
# WX2181,WX2182,WX2181B,WX2182B,WX2181C,WX2182C,WX2181B-D,WX2182B-D,
# WX2184,WX1284,WX2184C,WX1284C : 10.0E3 to 1.0E9
# WX1281B,WX1282B,WX1281B-D,WX1282B-D,WX1284,WX1281C,WX1282C :
# 10.0E3 to 500.0E6
# WS8351B,WS8352B: 10.0E3 to 350.0E6
# Default Value: 10E6
# Start Phase
# Valid Range: 0 to 360.0
# Default Value: 0
#
# ViStatus wx218x_Configure(
# ViSession Vi,
# ViConstString Channel,
# ViInt32 Waveform,
# ViReal64 Amplitude,
# ViReal64 DCOffset,
# ViReal64 Frequency,
# ViReal64 StartPhase
# );
configure = wx218x_dll.wx218x_Configure
configure.restype = c_int
configure.argtypes = (ViSession, ViConstString, ViInt32, ViReal64, ViReal64, ViReal64, ViReal64)
# ///////////////////////////////////////////////////////////////////////////
# Use this method for an immediate and unconditional generation of the
# selected output waveform.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a particular
# instrument session.
#
# Return Value
# Success or failure code.
#
# */
# ViStatus wx218x_InitiateGeneration2(
# ViSession Vi
# );
initiate_generation_2 = wx218x_dll.wx218x_InitiateGeneration2
initiate_generation_2.restype = c_int
initiate_generation_2.argtypes = (ViSession,)
# ///////////////////////////////////////////////////////////////////////////
# If the function generator is in the Output Generation State, this function
# moves the function generator to the Configuration State. If the function
# generator is already in the Configuration State, the function does nothing
# and returns Success.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or
# IviFgen_InitWithOptions function. The handle identifies a particular
# instrument session.
#
# Return Value
# Success or failure code.
#
# ViStatus wx218x_AbortGeneration(
# ViSession Vi
# );
abort_generation = wx218x_dll.wx218x_AbortGeneration
abort_generation.restype = c_int
abort_generation.argtypes = (ViSession,)
# ///////////////////////////////////////////////////////////////////////////
# Sets the active channel for programming.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init
# or IviDriver_InitWithOptions function. The handle identifies
# a particular instrument session.
# ChNameBufferSize
# Number of elements in ChName.
# ChName
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_SetActiveChannel(
# ViSession Vi,
# ViInt32 ChNameBufferSize,
# ViConstString ChName
# );
set_active_channel = wx218x_dll.wx218x_SetActiveChannel
set_active_channel.restype = c_int
set_active_channel.argtypes = (ViSession, ViInt32, ViConstString)
# ///////////////////////////////////////////////////////////////////////////
# Configures the function generator's sample rate.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or
# IviFgen_InitWithOptions function. The handle identifies a
# particular instrument session.
# SampleRate
# Specifies the sample rate. The driver uses this value to set the
# Arbitrary Sample Rate attribute. See the attribute description for
# more details.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_ConfigureSampleRate(
# ViSession Vi,
# ViReal64 SampleRate
# );
configure_sample_rate = wx218x_dll.wx218x_ConfigureSampleRate
configure_sample_rate.restype = c_int
configure_sample_rate.argtypes = (ViSession, ViReal64)
# ///////////////////////////////////////////////////////////////////////////
# Use this method to configure the trace mode (only for 4Ch. models).
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviDriver_init or
# IviDriver_InitWithOptions function. The handle identifies a
# particular instrument session.
# TraceMode
# The TraceMode parameter can take on any value in the
# WX218xTraceMode enum
# Tom note: see WX218x_TraceMode enum for options.
#
# Return Value
# Success or failure code.
#
# Collapse imageRemarks
# */
# ViStatus wx218x_ConfigureArbWaveTraceMode(
# ViSession Vi,
# ViInt32 TraceMode
# );
configure_arb_wave_trace_mode = wx218x_dll.wx218x_ConfigureArbWaveTraceMode
configure_arb_wave_trace_mode.restype = c_int
configure_arb_wave_trace_mode.argtypes = (ViSession, ViInt32)
# ///////////////////////////////////////////////////////////////////////////
# Creates an arbitrary waveform sequence from an array of waveform handles
# and a corresponding array of loop counts, and returns a handle that
# identifies the sequence. The handle is used by the Configure, and
# Clear methods.
#
# Parameters
# Vi
# The ViSession handle that you obtain from the IviFgen_init or
# IviFgen_InitWithOptions function. The handle identifies a
# particular instrument session.
# Length
# WfmHandle
# Specifies the array of waveform handles for the new arbitrary
# sequence. Each WfmHandle array element has a corresponding
# LoopCount array element that specifies how many times that
# waveform is repeated.
# LoopCount
# Specifies the array of loop counts for the new arbitrary
# sequence. Each LoopCount array element corresponds to a
# WfmHandle array element and indicates how many times to repeat
# that waveform. Each element of the LoopCount array must be
# less than or equal to the maximum number of loop counts the
# function generator allows. The function generator's maximum
# loop count is stored in the Loop Count Max attribute.
# Handle
# Returns the handle that identifies the new arbitrary sequence.
#
# Return Value
# Success or failure code.
# */
# ViStatus wx218x_CreateArbSequence(
# ViSession Vi,
# ViInt32 Length,
# ViInt32[] WfmHandle,
# ViInt32[] LoopCount,