1PYTHONIVI(1) Python IVI PYTHONIVI(1)
2
3
4
6 pythonivi - Python IVI Documentation
7
8 Python IVI is a Python-based interpretation of the Interchangeable Vir‐
9 tual Instrument standard from the IVI foundation.
10
11 See also:
12
13 · Python IVI home page
14
15 · GitHub repository
16
17 · IVI Foundation
18
19 Contents:
20
22 Overview
23 Python IVI is a Python-based interpretation of the Interchangeable Vir‐
24 tual Instrument standard from the IVI foundation. The implementation
25 is pure Python and highly portable.
26
27 It is released under the MIT license, see LICENSE for more details.
28
29 Copyright (C) 2012-2014 Alex Forencich <alex@alexforencich.com>
30
31 See also:
32
33 · Python IVI home page
34
35 · GitHub repository
36
37 · IVI Foundation
38
39 Features
40 · Supports Python 2 and Python 3
41
42 · Pure Python
43
44 · Highly portable
45
46 · Communicates with instruments with various add-on modules
47
48 Requirements
49 · Python 2 or Python 3
50
51 · One or more communication extensions
52
53 Installation
54 To install the module for all users on the system, administrator rights
55 (root) are required.
56
57 From source
58 Download the archive, extract, and run:
59
60 python setup.py install
61
62 Packages
63 There are also packaged versions for some Linux distributions:
64
65 Arch Linux
66 Python IVI is available under the name "python-ivi-git" in the
67 AUR.
68
69 Instrument Communication Extensions
70 Python IVI does not contain any IO drivers itself. In order to commu‐
71 nicate with an instrument, you must install one or more of the follow‐
72 ing drivers:
73
74 Python VXI11
75 Python VXI11 provides a pure python TCP/IP driver for LAN based instru‐
76 ments that support the VXI11 protocol. This includes most LXI instru‐
77 ments and also devices like the Agilent E2050 GPIB to LAN converter.
78
79 Home page: http://www.alexforencich.com/wiki/en/python-vxi11/start
80
81 GitHub repository: https://github.com/alexforencich/python-vxi11
82
83 Python USBTMC
84 Python USBTMC provides a pure python USBTMC driver for instruments that
85 support the USB Test and Measurement Class. Python USBTMC uses PyUSB
86 to connect to the instrument in a platform-independent manner.
87
88 Home page: http://alexforencich.com/wiki/en/python-usbtmc/start
89
90 GitHub repository: https://github.com/alexforencich/python-usbtmc
91
92 Linux GPIB
93 Python IVI provides an interface wrapper for the Linux GPIB driver. If
94 the Linux GPIB driver and its included Python interface available,
95 Python IVI can use it to communicate with instruments via any GPIB
96 interface supported by Linux GPIB.
97
98 Home page: http://linux-gpib.sourceforge.net/
99
100 pySerial
101 Python IVI provides an interface wrapper for the pySerial library. If
102 pySerial is installed, Python IVI can use it to communicate with
103 instruments via the serial port.
104
105 Home page: http://pyserial.sourceforge.net/
106
108 Connecting to an Instrument
109 Connect to an Agilent MSO7104A oscilloscope over LXI (VXI11) on IP
110 address 192.168.1.104:
111
112 >>> import ivi
113 >>> mso = ivi.agilent.agilentMSO7104A("TCPIP::192.168.1.104::INSTR")
114 >>> mso.identity.instrument_model
115 'MSO7104A'
116
117 Connect to an Agilent E3649A via an HP 2050A GPIB LAN bridge:
118
119 >>> import ivi
120 >>> psu = ivi.agilent.agilentE3649A("TCPIP::192.168.1.105::gpib,5::INSTR")
121 >>> psu.identity.instrument_model
122 'E3649A'
123
124 Configuring instruments
125 Connect to an Agilent MSO7104A oscilloscope over LXI (VXI11) and con‐
126 figure a channel:
127
128 >>> import ivi
129 >>> mso = ivi.agilent.agilentMSO7104A("TCPIP0::192.168.1.104::INSTR")
130 >>> #mso = ivi.agilent.agilentMSO7104A("USB0::2391::5973::MY********::INSTR")
131 >>> mso.acquisition.time_per_record = 1e-3
132 >>> mso.trigger.type = 'edge'
133 >>> mso.trigger.source = 'channel1'
134 >>> mso.trigger.coupling = 'dc'
135 >>> mso.trigger.edge.slope = 'positive'
136 >>> mso.trigger.level = 0
137 >>> mso.channels['channel1'].enabled = True
138 >>> mso.channels['channel1'].offset = 0
139 >>> mso.channels['channel1'].range = 4
140 >>> mso.channels['channel1'].coupling = 'dc'
141 >>> mso.measurement.initiate()
142 >>> waveform = mso.channels[0].measurement.fetch_waveform()
143 >>> vpp = mso.channels[0].measurement.fetch_waveform_measurement("voltage_peak_to_peak")
144 >>> phase = mso.channels['channel1'].measurement.fetch_waveform_measurement("phase", "channel2")
145
146 Connect to a Tektronix AWG2021, generate a sinewave with numpy, and
147 transfer it to channel 1:
148
149 >>> import ivi
150 >>> from numpy import *
151 >>> #awg = ivi.tektronix.tektronixAWG2021("GPIB0::25::INSTR")
152 >>> awg = ivi.tektronix.tektronixAWG2021("TCPIP0::192.168.1.105::gpib,25::INSTR")
153 >>> #awg = ivi.tektronix.tektronixAWG2021("ASRL::/dev/ttyUSB0,9600::INSTR")
154 >>> n = 128
155 >>> f = 1
156 >>> a = 1
157 >>> wfm = a*sin(2*pi/n*f*arange(0,n))
158 >>> awg.outputs[0].arbitrary.create_waveform(wfm)
159 >>> awg.outputs[0].arbitrary.gain = 2.0
160 >>> awg.outputs[0].arbitrary.gain = 0.0
161 >>> arb.arbitrary.sample_rate = 128e6
162 >>> awg.outputs[0].enabled = True
163
164 Connect to an Agilent E3649A and configure an output:
165
166 >>> import ivi
167 >>> #psu = ivi.agilent.agilentE3649A("GPIB0::5::INSTR")
168 >>> psu = ivi.agilent.agilentE3649A("TCPIP0::192.168.1.105::gpib,5::INSTR")
169 >>> #psu = ivi.agilent.agilentE3649A("ASRL::/dev/ttyUSB0,9600::INSTR")
170 >>> psu.outputs[0].configure_range('voltage', 12)
171 >>> psu.outputs[0].voltage_level = 12.0
172 >>> psu.outputs[0].current_limit = 1.0
173 >>> psu.outputs[0].ovp_limit = 14.0
174 >>> psu.outputs[0].ovp_enabled = True
175 >>> psu.outptus[0].enabled = True
176
178 This module provides the base functionality of an IVI instrument
179 driver.
180
181 Functions and Exceptions
182 exception ivi.IviException
183 Exception raised on various occasions; argument is a string
184 describing what is wrong.
185
186 DriverOperation class
187 class ivi.DriverOperation(*args, **kwargs)
188 Bases: ivi.ivi.IviContainer
189
190 Inherent IVI methods for driver operation
191
192 DriverIdentity class
193 class ivi.DriverIdentity(*args, **kwargs)
194 Bases: ivi.ivi.IviContainer
195
196 Inherent IVI methods for identification
197
198 DriverUtility class
199 class ivi.DriverUtility(*args, **kwargs)
200 Bases: ivi.ivi.IviContainer
201
202 Inherent IVI utility methods
203
204 Driver class
205 class ivi.Driver(resource=None, id_query=False, reset=False, *args,
206 **kwargs)
207 Bases: ivi.ivi.DriverOperation, ivi.ivi.DriverIdentity,
208 ivi.ivi.DriverUtility
209
210 Inherent IVI methods for all instruments
211
212 doc(obj=None, itm=None, docs=None, prefix=None)
213 Python IVI documentation generator
214
215 help(itm=None, complete=False, indent=0)
216 Python IVI help system
217
218 ivi.close
219 When the user finishes using a Python IVI driver, the user
220 should call either the Close method or __del__. Note that
221 __del__ will call close automatically.
222
223 This function also does the following:
224
225 · Prevents the user from calling other functions in the
226 driver that access the instrument until the user calls the
227 Initialize function again.
228
229 · May deallocate internal resources used by the IVI session.
230
231 driver_operation.cache
232 If True, the specific driver caches the value of attributes,
233 and the IVI specific driver keeps track of the current
234 instrument settings so that it can avoid sending redundant
235 commands to the instrument. If False, the specific driver
236 does not cache the value of attributes.
237
238 The default value is True. When the user opens an instrument
239 session through an IVI class driver or uses a logical name to
240 initialize a specific driver, the user can override this
241 value by specifying a value in the IVI configuration store.
242 The Initialize function allows the user to override both the
243 default value and the value that the user specifies in the
244 IVI configuration store.
245
246 driver_operation.clear_interchange_warnings
247 This function clears the list of interchangeability warnings
248 that the IVI specific driver maintains.
249
250 When this function is called on an IVI class driver session,
251 the function clears the list of interchangeability warnings
252 that the class driver and the specific driver maintain.
253
254 Refer to the Interchange Check attribute for more information
255 on interchangeability checking.
256
257 driver_operation.driver_setup
258 Returns the driver setup string that the user specified in
259 the IVI configuration store when the instrument driver ses‐
260 sion was initialized or passes in the OptionString parameter
261 of the Initialize function. Refer to Section 6.14, Initial‐
262 ize, for the restrictions on the format of the driver setup
263 string.
264
265 The string that this attribute returns does not have a prede‐
266 fined maximum length.
267
268 driver_operation.get_next_coercion_record
269 If the Record Value Coercions attribute is set to True, the
270 IVI specific driver keeps a list of all value coercions it
271 makes on integer and floating point attributes. This function
272 obtains the coercion information associated with the IVI ses‐
273 sion. It retrieves and clears the oldest instance in which
274 the specific driver coerced a value the user specified to
275 another value.
276
277 The function returns an empty string in the CoercionRecord
278 parameter if no coercion records remain for the session.
279
280 The coercion record string shall contain the following infor‐
281 mation:
282
283 · The name of the attribute that was coerced. This can be the
284 generic name, the COM property name, or the C defined con‐
285 stant.
286
287 · If the attribute applies to a repeated capability, the name
288 of the virtual or physical repeated capability identifier.
289
290 · The value that the user specified for the attribute.
291
292 · The value to which the attribute was coerced.
293
294 A recommended format for the coercion record string is as
295 follows:
296
297 " Attribute " + <attribute name> + [" on <repeated capability> " +
298 <repeated capability identifier>] + " was coerced from " +
299 <desiredVal> + " to " + <coercedVal>
300
301 .
302
303 And example coercion record string is as follows:
304
305 Attribute TKTDS500_ATTR_VERTICAL_RANGE on channel ch1 was coerced from
306 9.0 to 10.0.
307
308 driver_operation.get_next_interchange_warning
309 If the Interchange Check attribute is set to True, the IVI
310 specific driver keeps a list of all interchangeability warn‐
311 ings that it encounters. This function returns the inter‐
312 changeability warnings associated with the IVI session. It
313 retrieves and clears the oldest interchangeability warning
314 from the list. Interchangeability warnings indicate that
315 using the application with a different instrument might cause
316 different behavior.
317
318 When this function is called on an IVI class driver session,
319 it may return interchangeability warnings generated by the
320 IVI class driver as well as interchangeability warnings gen‐
321 erated by the IVI specific driver. The IVI class driver
322 determines the relative order in which the IVI class driver
323 warnings are returned in relation to the IVI specific driver
324 warnings.
325
326 The function returns an empty string in the InterchangeWarn‐
327 ing parameter if no interchangeability warnings remain for
328 the session.
329
330 Refer to the Interchange Check attribute for more information
331 on interchangeability checking.
332
333 driver_operation.interchange_check
334 If True, the specific driver performs interchangeability
335 checking. If the Interchange Check attribute is enabled, the
336 specific driver maintains a record of each interchangeability
337 warning that it encounters. The user calls the Get Next
338 Interchange Warning function to extract and delete the oldest
339 interchangeability warning from the list. Refer to Section
340 6.11, Get Next Interchange Warning, Section 6.2, Clear Inter‐
341 change Warnings, and Section 6.18, Reset Interchange Check,
342 for more information. If False, the specific driver does not
343 perform interchangeability checking.
344
345 If the user opens an instrument session through an IVI class
346 driver and the Interchange Check attribute is enabled, the
347 IVI class driver may perform additional interchangeability
348 checking. The IVI class driver maintains a list of the inter‐
349 changeability warnings that it encounters. The user can
350 retrieve both class driver interchangeability warnings and
351 specific driver interchangeability warnings by calling the
352 Get Next Interchange Warning function on the class driver
353 session.
354
355 If the IVI specific driver does not implement interchange‐
356 ability checking, the specific driver returns the Value Not
357 Supported error when the user attempts to set the Interchange
358 Check attribute to True. If the specific driver does imple‐
359 ment interchangeability checking and the user opens an
360 instrument session through an IVI class driver, the IVI class
361 driver accepts True as a valid value for the Interchange
362 Check attribute even if the class driver does not implement
363 interchangeability checking capabilities of its own.
364
365 The default value is False. If the user opens an instrument
366 session through an IVI class driver or initializes an IVI
367 specific driver with a logical name, the user can override
368 this value in the IVI configuration store. The Initialize
369 function allows the user to override both the default value
370 and the value that the userspecifies in the IVI configuration
371 store.
372
373 driver_operation.invalidate_all_attributes
374 This function invalidates the cached values of all attributes
375 for the session.
376
377 driver_operation.io_resource_descriptor
378 Returns the resource descriptor that the user specified for
379 the physical device. The user specifies the resource descrip‐
380 tor by editing the IVI configuration store or by passing a
381 resource descriptor to the Initialize function of the spe‐
382 cific driver. Refer to Section 6.14, Initialize, for the
383 restrictions on the contents of the resource descriptor
384 string.
385
386 The string that this attribute returns contains a maximum of
387 256 characters including the NULL character.
388
389 driver_operation.logical_name
390 Returns the IVI logical name that the user passed to the Ini‐
391 tialize function. If the user initialized the IVI specific
392 driver directly and did not pass a logical name, then this
393 attribute returns an empty string. Refer to IVI-3.5: Config‐
394 uration Server Specification for restrictions on the format
395 of IVI logical names.
396
397 The string that this attribute returns contains a maximum of
398 256 characters including the NULL character.
399
400 driver_operation.query_instrument_status
401 If True, the IVI specific driver queries the instrument sta‐
402 tus at the end of each user operation. If False, the IVI spe‐
403 cific driver does not query the instrument status at the end
404 of each user operation. Querying the instrument status is
405 very useful for debugging. After validating the program, the
406 user can set this attribute to False to disable status check‐
407 ing and maximize performance. The user specifies this value
408 for the entire IVI driver session.
409
410 The default value is False. When the user opens an instrument
411 session through an IVI class driver or uses a logical name to
412 initialize an IVI specific driver, the user can override this
413 value by specifying a value in the IVI configuration store.
414 The Initialize function allows the user to override both the
415 default value and the value that the user specifies in the
416 IVI configuration store.
417
418 driver_operation.range_check
419 If True, the IVI specific driver validates attribute values
420 and function parameters. If False, the IVI specific driver
421 does not validate attribute values and function parameters.
422
423 If range check is enabled, the specific driver validates the
424 parameter values that users pass to driver functions. Vali‐
425 dating attribute values and function parameters is useful for
426 debugging. After validating the program, the user can set
427 this attribute to False to disable range checking and maxi‐
428 mize performance. The default value is True. When the user
429 opens an instrument session through an IVI class driver or
430 uses a logical name to initialize an IVI specific driver, the
431 user can override this value by specifying a value in the IVI
432 configuration store. The Initialize function allows the user
433 to override both the default value and the value that the
434 user specifies in the IVI configuration store.
435
436 driver_operation.record_coercions
437 If True, the IVI specific driver keeps a list of the value
438 coercions it makes for ViInt32 and ViReal64 attributes. If
439 False, the IVI specific driver does not keep a list of the
440 value coercions it makes for ViInt32 and ViReal64 attributes.
441
442 If the Record Value Coercions attribute is enabled, the spe‐
443 cific driver maintains a record of each coercion. The user
444 calls the Get Next Coercion Record function to extract and
445 delete the oldest coercion record from the list. Refer to
446 Section 6.10, Get Next Coercion Record, for more information.
447
448 If the IVI specific driver does not implement coercion
449 recording, the specific driver returns the Value Not Sup‐
450 ported error when the user attempts to set the Record Value
451 Coercions attribute to True.
452
453 The default value is False. When the user opens an instrument
454 session through an IVI class driver or uses a logical name to
455 initialize a IVI specific driver, the user can override this
456 value by specifying a value in the IVI configuration store.
457 The Initialize function allows the user to override both the
458 default value and the value that the user specifies in the
459 IVI configuration store.
460
461 driver_operation.reset_interchange_check
462 This function resets the interchangeability checking algo‐
463 rithms of the IVI specific driver so that specific driver
464 functions that execute prior to calling this function have no
465 effect on whether future calls to the specific driver gener‐
466 ate interchangeability warnings.
467
468 When developing a complex test system that consists of multi‐
469 ple test modules, it is generally a good idea to design the
470 test modules so that they can run in any order. To do so
471 requires ensuring that each test module completely configures
472 the state of each instrument it uses. If a particular test
473 module does not completely configure the state of an instru‐
474 ment, the state of the instrument depends on the configura‐
475 tion from a previously executed test module. If the test mod‐
476 ules execute in a different order, the behavior of the
477 instrument and therefore the entire test module is likely to
478 change. This change in behavior is generally instrument spe‐
479 cific and represents an interchangeability problem.
480
481 Users can use this function to test for such cases. By call‐
482 ing this function at the beginning of a test module, users
483 can determine whether the test module has dependencies on the
484 operation of previously executed test modules. Any inter‐
485 changeability warnings that occur after the user calls this
486 function indicate that the section of the test program that
487 executes after this function and prior to the generation of
488 the warning does not completely configure the instrument and
489 that the user is likely to experience different behavior if
490 the user changes the execution order of the test modules or
491 if the user changes instruments.
492
493 Note: This function does not clear interchangeability warn‐
494 ings from the list of interchangeability warnings. To guaran‐
495 tee that the Get Next Interchange Warning function returns
496 interchangeability warnings that occur only after the program
497 calls function, the user must clear the list of interchange‐
498 ability warnings by calling the Clear Interchange Warnings
499 function.
500
501 Refer to the Interchange Check attribute for more information
502 on interchangeability checking.
503
504 driver_operation.simulate
505 If True, the IVI specific driver simulates instrument driver
506 I/O operations. If False, the IVI specific driver communi‐
507 cates directly with the instrument.
508
509 If simulation is enabled, the specific driver functions do
510 not perform instrument I/O. For output parameters that repre‐
511 sent instrument data, the specific driver functions return
512 simulated values.
513
514 The default value is False. When the user opens an instrument
515 session through an IVI class driver or uses a logical name to
516 initialize an IVI specific driver, the user can override this
517 value by specifying a value in the IVI configuration store.
518 The Initialize function allows the user to override both the
519 default value and the value that the user specifies in the
520 IVI configuration store.
521
522 identity.description
523 Returns a brief description of the IVI software component.
524
525 The string that this attribute returns has no maximum size.
526
527 identity.get_group_capabilities
528 Returns a list of names of class capability groups that the
529 IVI specific driver implements. The items in the list are
530 capability group names that the IVI class specifications
531 define. The list is returned as a list of strings.
532
533 If the IVI specific driver does not comply with an IVI class
534 specification, the specific driver returns an array with zero
535 elements.
536
537 identity.get_supported_instrument_models
538 Returns a list of names of instrument models with which the
539 IVI specific driver is compatible. The list is returned as a
540 list of strings. For example, this attribute might return the
541 strings "TKTDS3012", "TKTDS3014", and "TKTDS3016" .
542
543 It is not necessary for the string to include the abbrevia‐
544 tion for the manufacturer if it is the same for all models.
545 In the example above, it is valid for the attribute to return
546 the strings "TDS3012", "TDS3014", and "TDS3016".
547
548 identity.group_capabilities
549 Returns a comma-separated list that identifies the class
550 capability groups that the IVI specific driver implements.
551 The items in the list are capability group names that the IVI
552 class specifications define. The string has no white space
553 except for white space that might be embedded in a capability
554 group name.
555
556 If the IVI specific driver does not comply with an IVI class
557 specification, the specific driver returns an empty string as
558 the value of this attribute.
559
560 The string that this attribute returns does not have a prede‐
561 fined maximum length.
562
563 identity.identifier
564 Returns the case-sensitive unique identifier of the IVI soft‐
565 ware component. The string that this attribute returns con‐
566 tains a maximum of 32 characters including the NULL charac‐
567 ter.
568
569 identity.instrument_firmware_revision
570 Returns an instrument specific string that contains the
571 firmware revision information of the physical instrument. The
572 IVI specific driver returns the value it queries from the
573 instrument as the value of this attribute or a string indi‐
574 cating that it cannot query the instrument identity.
575
576 In some cases, it is not possible for the specific driver to
577 query the firmware revision of the instrument. This can occur
578 when the Simulate attribute is set to True or if the instru‐
579 ment is not capable of returning the firmware revision. For
580 these cases, the specific driver returns defined strings for
581 this attribute. If the Simulate attribute is set to True, the
582 specific driver returns "Not available while simulating" as
583 the value of this attribute. If the instrument is not capable
584 of returning the firmware version and the Simulate attribute
585 is set to False, the specific driver returns "Cannot query
586 from instrument" as the value of this attribute.
587
588 The string that this attribute returns does not have a prede‐
589 fined maximum length.
590
591 identity.instrument_manufacturer
592 Returns the name of the manufacturer of the instrument. The
593 IVI specific driver returns the value it queries from the
594 instrument as the value of this attribute or a string indi‐
595 cating that it cannot query the instrument identity.
596
597 In some cases, it is not possible for the specific driver to
598 query the manufacturer of the instrument. This can occur when
599 the Simulate attribute is set to True or if the instrument is
600 not capable of returning the manufacturer. For these cases,
601 the specific driver returns defined strings for this
602 attribute. If the Simulate attribute is set to True, the spe‐
603 cific driver returns "Not available while simulating" as the
604 value of this attribute. If the instrument is not capable of
605 returning the manufacturer and the Simulate attribute is set
606 to False, the specific driver returns "Cannot query from
607 instrument" as the value of this attribute.
608
609 The string that this attribute returns does not have a prede‐
610 fined maximum length.
611
612 identity.instrument_model
613 Returns the model number or name of the physical instrument.
614 The IVI specific driver returns the value it queries from the
615 instrument or a string indicating that it cannot query the
616 instrument identity.
617
618 In some cases, it is not possible for the specific driver to
619 query the model of the instrument. This can occur when the
620 Simulate attribute is set to True or if the instrument is not
621 capable of returning the model. For these cases, the spe‐
622 cific driver returns defined strings for this attribute. If
623 the Simulate attribute is set to True, the specific driver
624 returns "Not available while simulating" as the value of this
625 attribute. If the instrument is not capable of returning the
626 model and the Simulate attribute is set to False, the spe‐
627 cific driver returns "Cannot query from instrument" as the
628 value of this attribute.
629
630 The string that this attribute returns does not have a prede‐
631 fined maximum length.
632
633 identity.revision
634 Returns version information about the IVI software component.
635 Refer to Section 3.1.2.2, Additional Compliance Rules for
636 Revision String Attributes, for additional rules regarding
637 this attribute.
638
639 The string that this attribute returns has no maximum size.
640
641 identity.specification_major_version
642 Returns the major version number of the class specification
643 in accordance with which the IVI software component was
644 developed. The value is a positive integer value.
645
646 If the software component is not compliant with a class spec‐
647 ification, the software component returns zero as the value
648 of this attribute.
649
650 identity.specification_minor_version
651 Returns the minor version number of the class specification
652 in accordance with which the IVI software component was
653 developed. The value is a positive integer value.
654
655 If the software component is not compliant with a class spec‐
656 ification, the software component returns zero as the value
657 of this attribute.
658
659 identity.supported_instrument_models
660 Returns a comma-separated list of names of instrument models
661 with which the IVI specific driver is compatible. The string
662 has no white space except possibly embedded in the instrument
663 model names. An example of a string that this attribute might
664 return is "TKTDS3012,TKTDS3014,TKTDS3016".
665
666 It is not necessary for the string to include the abbrevia‐
667 tion for the manufacturer if it is the same for all models.
668 In the example above, it is valid for the attribute to return
669 the string "TDS3012,TDS3014,TDS3016".
670
671 The string that this attribute returns does not have a prede‐
672 fined maximum length.
673
674 identity.vendor
675 Returns the name of the vendor that supplies the IVI software
676 component.
677
678 The string that this attribute returns has no maximum size.
679
680 ivi.initialize
681 The user must call the Initialize function prior to calling
682 other IVI driver functions that access the instrument. The
683 Initialize function is called automatically by the construc‐
684 tor if a resource string is passed as the first argument to
685 the constructor.
686
687 If simulation is disabled when the user calls the Initialize
688 function, the function performs the following actions:
689
690 · Opens and configures an I/O session to the instrument.
691
692 · If the user passes True for the IdQuery parameter, the
693 function queries the instrument for its ID and verifies
694 that the IVI specific driver supports the particular
695 instrument model. If the instrument cannot return its ID,
696 the specific driver returns the ID Query Not Supported
697 warning.
698
699 · If the user passes True for the Reset parameter, the func‐
700 tion places the instrument in a known state. In an IEEE
701 488.2 instrument, the function sends the command string "
702 *
703 RST" to the instrument. If the instrument cannot perform a
704 reset, the IVI specific driver returns the Reset Not Sup‐
705 ported warning.
706
707 · Configures instrument options on which the IVI specific
708 driver depends. For example, a specific driver might
709 enable or disable headers or enable binary mode for wave‐
710 form transfers.
711
712 ·
713
714 Performs the following operations in the given order:
715
716 1. Disables the class extension capability groups
717 that the IVI specific driver does not implement.
718
719 2. If the class specification with which the IVI
720 specific driver is compliant defines initial val‐
721 ues for attributes, this function sets the
722 attributes to the values that the class specifi‐
723 cation defines.
724
725 3. If the ResourceName parameter is a logical name,
726 the IVI specific driver configures the initial
727 settings for the specific driver and instrument
728 based on the configuration of the logical name in
729 the IVI configuration store.
730
731 If simulation is enabled when the user calls the Initialize
732 function, the function performs the following actions:
733
734 · If the user passes True for the IdQuery parameter and the
735 instrument cannot return its ID, the IVI specific driver
736 returns the ID Query Not Supported warning.
737
738 · If the user passes True for the Reset parameter and the
739 instrument cannot perform a reset, the IVI specific driver
740 returns the Reset Not Supported warning.
741
742 · If the ResourceName parameter is a logical name, the IVI
743 specific driver configures the initial settings for the
744 specific driver based on the configuration of the logical
745 name in the IVI configuration store.
746
747 Some instrument driver operations require or take into
748 account information from the IVI configuration store. Exam‐
749 ples of such information are virtual repeated capability name
750 mappings and the value of certain inherent attributes. An IVI
751 driver shall retrieve all the information for a session from
752 the IVI configuration store during the Initialization func‐
753 tion. The IVI driver shall not read any information from the
754 IVI configuration store for a session after the Initializa‐
755 tion function completes. Refer to Section 3.2.3, Instantiat‐
756 ing the Right Configuration Store From Software Modules, of
757 IVI-3.5: Configuration Server Specification for details on
758 how to correctly instantiate the configuration store.
759
760 The ResourceName parameter must contain either a logical name
761 that is defined in the IVI configuration store or an instru‐
762 ment specific string that identifies the I/O address of the
763 instrument, such as a VISA resource descriptor string. Refer
764 to IVI-3.5: Configuration Server Specification for restric‐
765 tions on the format of IVI logical names. Refer to the VXI‐
766 plug&play specifications for the grammar of VISA resource
767 descriptor strings.
768
769 Example resource strings:
770
771 'TCPIP::10.0.0.1::INSTR'
772 'TCPIP0::10.0.0.1::INSTR'
773 'TCPIP::10.0.0.1::gpib,5::INSTR'
774 'TCPIP0::10.0.0.1::gpib,5::INSTR'
775 'TCPIP0::10.0.0.1::usb0::INSTR'
776 'TCPIP0::10.0.0.1::usb0[1234::5678::MYSERIAL::0]::INSTR'
777 'USB::1234::5678::INSTR'
778 'USB::1234::5678::SERIAL::INSTR'
779 'USB0::0x1234::0x5678::INSTR'
780 'USB0::0x1234::0x5678::SERIAL::INSTR'
781 'GPIB::10::INSTR'
782 'GPIB0::10::INSTR'
783 'ASRL1::INSTR'
784 'ASRL::COM1,9600,8n1::INSTR'
785 'ASRL::/dev/ttyUSB0,9600::INSTR'
786 'ASRL::/dev/ttyUSB0,9600,8n1::INSTR'
787
788 The user can use additional parameters to specify the initial
789 values of certain IVI inherent attributes for the session.
790 The following table lists the inherent attributes that the
791 user can set through these named parameters. The user does
792 not have to specify all or any of the attributes. If the user
793 does not specify the initial value of an inherent attribute,
794 the initial value of the attribute depends on the value of
795 the ResourceName parameter:
796
797 · If the ResourceName parameter contains an IVI logical name,
798 the IVI specific driver configures the initial settings
799 based on the configuration of the logical name in the IVI
800 configuration store.
801
802 · If the ResourceName parameter contains a resource descrip‐
803 tor string that identifies the I/O address of the instru‐
804 ment, the IVI specific driver sets inherent attributes to
805 their default initial values. The following table shows the
806 default initial value for each attribute.
807
808 The following table lists the IVI inherent attributes that
809 the user can set, their default initial values, and the name
810 that represents each attribute. These options are passed to
811 the initialize function or the constructor as key-value
812 pairs.
813
814 ┌────────────────────┬─────────────────────┬─────────────────────┐
815 │Attribute │ Default Inital │ Options String Name │
816 │ │ Value │ │
817 ├────────────────────┼─────────────────────┼─────────────────────┤
818 │Range Check │ True │ range_check │
819 └────────────────────┴─────────────────────┴─────────────────────┘
820
821
822
823 │Query Instrument │ False │ query_instr_status │
824 │Status │ │ │
825 ├────────────────────┼─────────────────────┼─────────────────────┤
826 │Cache │ True │ cache │
827 ├────────────────────┼─────────────────────┼─────────────────────┤
828 │Simulate │ False │ simulate │
829 ├────────────────────┼─────────────────────┼─────────────────────┤
830 │Record Value Coer‐ │ False │ record_coercions │
831 │cions │ │ │
832 ├────────────────────┼─────────────────────┼─────────────────────┤
833 │Interchange Check │ False │ interchange_check │
834 ├────────────────────┼─────────────────────┼─────────────────────┤
835 │Driver Setup │ '' │ driver_setup │
836 ├────────────────────┼─────────────────────┼─────────────────────┤
837 │Prefer PyVISA │ False │ prefer_pyvisa │
838 └────────────────────┴─────────────────────┴─────────────────────┘
839
840 Each IVI specific driver defines it own meaning and valid
841 values for the Driver Setup attribute. Many specific drivers
842 ignore the value of the Driver Setup attribute. Other spe‐
843 cific drivers use the Driver Setup string to configure
844 instrument specific features at initialization. For example,
845 if a specific driver supports a family of instrument models,
846 the driver can use the Driver Setup attribute to allow the
847 user to specify a particular instrument model to simulate.
848
849 If the user attempts to initialize the instrument a second
850 time without first calling the Close function, the Initialize
851 function returns the Already Initialized error.
852
853 ivi.initialized
854 Returns a value that indicates whether the IVI specific
855 driver is in the initialized state. After the specific driver
856 is instantiated and before the Initialize function success‐
857 fully executes, this attribute returns False. After the Ini‐
858 tialize function successfully executes and prior to the exe‐
859 cution of the Close function, this attribute returns True.
860 After the Close function executes, this attribute returns
861 False.
862
863 The Initialized attribute is one of the few IVI specific
864 driver attributes that can be accessed while the specific
865 driver is not in the initialized state. All the attributes of
866 an IVI specific driver that can be accessed while the spe‐
867 cific driver is not in the initialized state are listed
868 below.
869
870 · Component Class Spec Major Version
871
872 · Component Class Spec Minor Version
873
874 · Component Description
875
876 · Component Prefix
877
878 · Component Identifier
879
880 · Component Revision
881
882 · Component Vendor
883
884 · Initialized
885
886 · Supported Instrument Models
887
888 utility.disable
889 The Disable operation places the instrument in a quiescent
890 state as quickly as possible. In a quiescent state, an
891 instrument has no or minimal effect on the external system to
892 which it is connected. The Disable operation might be similar
893 to the Reset operation in that it places the instrument in a
894 known state. However, the Disable operation does not perform
895 the other operations that the Reset operation performs such
896 as configuring the instrument options on which the IVI spe‐
897 cific driver depends. For some instruments, the disable func‐
898 tion may do nothing.
899
900 The IVI class specifications define the exact behavior of
901 this function for each instrument class. Refer to the IVI
902 class specifications for more information on the behavior of
903 this function.
904
905 utility.error_query
906 Queries the instrument and returns instrument specific error
907 information.
908
909 Generally, the user calls this function after another func‐
910 tion in the IVI driver returns the Instrument Status error.
911 The IVI specific driver returns the Instrument Status error
912 when the instrument indicates that it encountered an error
913 and its error queue is not empty. Error Query extracts an
914 error out of the instrument's error queue.
915
916 For instruments that have status registers but no error
917 queue, the IVI specific driver emulates an error queue in
918 software.
919
920 The method returns a tuple containing the error code and
921 error message.
922
923 utility.lock_object
924 This function obtains a multithread lock for this instance of
925 the driver. Before it does so, Lock Session waits until all
926 other execution threads have released their locks or for the
927 length of time specified by the maximum time parameter,
928 whichever come first. The type of lock obtained depends upon
929 the parameters passed to the specific driver constructor.
930
931 The user can use Lock Session with IVI specific drivers to
932 protect a section of code that requires exclusive access to
933 the instrument. This occurs when the user takes multiple
934 actions that affect the instrument and the user wants to
935 ensure that other execution threads do not disturb the
936 instrument state until all the actions execute. For example,
937 if the user sets various instrument attributes and then trig‐
938 gers a measurement, the user must ensure no other execution
939 thread modifies the attribute values until the user finishes
940 taking the measurement.
941
942 It is important to note that this lock is not related to I/O
943 locks such as the VISA resource locking mechanism.
944
945 The user can safely make nested calls to Lock Session within
946 the same thread. To completely unlock the session, the user
947 must balance each call to Lock Session with a call to Unlock
948 Session. Calls to Lock Session must always obtain the same
949 lock that is used internally by the IVI driver to guard indi‐
950 vidual method calls.
951
952 utility.reset
953 This function performs the following actions:
954
955 · Places the instrument in a known state. In an IEEE 488.2
956 instrument, the Reset function sends the command string
957 *RST to the instrument.
958
959 · Configures instrument options on which the IVI specific
960 driver depends. A specific driver might enable or disable
961 headers or enable binary mode for waveform transfers.
962
963 The user can either call the Reset function separately or
964 specify that it be called from the Initialize function. The
965 Initialize function performs additional operations after per‐
966 forming the reset operation to place the instrument in a
967 state more suitable for interchangeable programming. To reset
968 the device and perform these additional operations, call the
969 Reset With Defaults function instead of the Reset function.
970
971 utility.reset_with_defaults
972 The Reset With Defaults function performs the same operations
973 that the Reset function performs and then performs the fol‐
974 lowing additional operations in the specified order:
975
976 · Disables the class extension capability groups that the IVI
977 specific driver implements.
978
979 · If the class specification with which the IVI specific
980 driver is compliant defines initial values for attributes,
981 this function sets those attributes to the initial values
982 that the class specification defines.
983
984 · Configures the initial settings for the specific driver and
985 instrument based on the information retrieved from the IVI
986 configuration store when the instrument driver session was
987 initialized.
988
989 Notice that the Initialize function also performs these func‐
990 tions. To place the instrument and the IVI specific driver in
991 the exact same state that they attain when the user calls the
992 Initialize function, the user must first call the Close func‐
993 tion and then the Initialize function.
994
995 utility.self_test
996 Causes the instrument to perform a self test. Self Test waits
997 for the instrument to complete the test. It then queries the
998 instrument for the results of the self test and returns the
999 results to the user.
1000
1001 If the instrument passes the self test, this function returns
1002 the tuple:
1003
1004 (0, 'Self test passed')
1005
1006 Otherwise, the function returns a tuple of the result code
1007 and message.
1008
1009 utility.unlock_object
1010 This function releases a lock that the Lock Session function
1011 acquires.
1012
1013 Refer to Lock Session for additional information on IVI ses‐
1014 sion locks.
1015
1016 Helper Classes
1017 PropertyCollection class
1018 class ivi.PropertyCollection
1019 A building block to create hierarchical trees of methods and
1020 properties
1021
1022 _add_method(name, f=None, doc=None)
1023 Add a managed method
1024
1025 _add_property(name, fget=None, fset=None, fdel=None, doc=None)
1026 Add a managed property
1027
1028 _del_property(name)
1029 Remove managed property or method
1030
1031 _lock(lock=True)
1032 Set lock state to prevent creation or deletion of unman‐
1033 aged members
1034
1035 _unlock()
1036 Unlock object to allow creation or deletion of unmanaged
1037 members, equivalent to _lock(False)
1038
1039 IndexedPropertyCollection class
1040 class ivi.IndexedPropertyCollection
1041 A building block to create hierarchical trees of methods and
1042 properties with an index that is converted to a parameter
1043
1044 _add_method(name, f=None, doc=None, props=None, docs=None)
1045 Add a managed method
1046
1047 _add_property(name, fget=None, fset=None, fdel=None, doc=None,
1048 props=None, docs=None)
1049 Add a managed property
1050
1051 _add_sub_method(sub, name, f=None, doc=None)
1052 Add a sub-method (equivalent to _add_method('sub.name',
1053 ...))
1054
1055 _add_sub_property(sub, name, fget=None, fset=None, fdel=None,
1056 doc=None)
1057 Add a sub-property (equivalent to _add_prop‐
1058 erty('sub.name', ...))
1059
1060 _build_obj(props, docs, i)
1061 Build a tree of PropertyCollection objects with the
1062 proper index associations
1063
1064 _del_property(name)
1065 Delete property
1066
1067 _set_list(l)
1068 Set a list of allowable indicies as an associative array
1069
1071 This module provides the base functionality for Oscilloscopes.
1072
1073 Functions and Exceptions
1074 exception ivi.scope.IviException
1075 Exception raised on various occasions; argument is a string
1076 describing what is wrong.
1077
1078 Base class
1079 class ivi.scope.Base(*args, **kwargs)
1080 Bases: ivi.ivi.IviContainer
1081
1082 Base IVI methods for all oscilloscopes
1083
1084 acquisition.configure_record
1085 IVI class IviScope, capability group IviScopeBase, section 4.3.4
1086
1087 This function configures the most commonly configured attributes
1088 of the oscilloscope acquisition sub-system. These attributes are
1089 the time per record, minimum record length, and the acquisition
1090 start time.
1091
1092 acquisition.number_of_points_minimum
1093 IVI class IviScope, capability group IviScopeBase, section 4.2.8
1094
1095 Specifies the minimum number of points the end-user requires in
1096 the waveform record for each channel. The instrument driver uses
1097 the value the end-user specifies to configure the record length
1098 that the oscilloscope uses for waveform acquisition. If the
1099 instrument cannot support the requested record length, the
1100 driver shall configure the instrument to the closest bigger
1101 record length. The Horizontal Record Length attribute returns
1102 the actual record length.
1103
1104 acquisition.record_length
1105 IVI class IviScope, capability group IviScopeBase, section 4.2.9
1106
1107 Returns the actual number of points the oscilloscope acquires
1108 for each channel. The value is equal to or greater than the min‐
1109 imum number of points the end-user specifies with the Horizontal
1110 Minimum Number of Points attribute.
1111
1112 Note: Oscilloscopes may use different size records depending on
1113 the value the user specifies for the Acquisition Type attribute.
1114
1115 acquisition.sample_rate
1116 IVI class IviScope, capability group IviScopeBase, section
1117 4.2.10
1118
1119 Returns the effective sample rate of the acquired waveform using
1120 the current configuration. The units are samples per second.
1121
1122 acquisition.start_time
1123 IVI class IviScope, capability group IviScopeBase, section 4.2.1
1124
1125 Specifies the length of time from the trigger event to the first
1126 point in the waveform record. If the value is positive, the
1127 first point in the waveform record occurs after the trigger
1128 event. If the value is negative, the first point in the waveform
1129 record occurs before the trigger event. The units are seconds.
1130
1131 acquisition.time_per_record
1132 IVI class IviScope, capability group IviScopeBase, section
1133 4.2.11
1134
1135 Specifies the length of time that corresponds to the record
1136 length. The units are seconds.
1137
1138 acquisition.type
1139 IVI class IviScope, capability group IviScopeBase, section 4.2.3
1140
1141 Specifies how the oscilloscope acquires data and fills the wave‐
1142 form record.
1143
1144 Values: * 'normal' * 'high_resolution' * 'average' *
1145 'peak_detect' * 'envelope'
1146
1147 channels[].configure
1148 IVI class IviScope, capability group IviScopeBase, section 4.3.6
1149
1150 This function configures the most commonly configured attributes
1151 of the oscilloscope channel sub-system. These attributes are the
1152 range, offset, coupling, probe attenuation, and whether the
1153 channel is enabled.
1154
1155 channels[].configure_characteristics
1156 IVI class IviScope, capability group IviScopeBase, section 4.3.8
1157
1158 This function configures the attributes that control the elec‐
1159 trical characteristics of the channel. These attributes are the
1160 input impedance and the maximum frequency of the input signal.
1161
1162 channels[].coupling
1163 IVI class IviScope, capability group IviScopeBase, section
1164 4.2.23
1165
1166 Specifies how the oscilloscope couples the input signal for the
1167 channel.
1168
1169 Values:
1170
1171 · 'ac'
1172
1173 · 'dc'
1174
1175 · 'gnd'
1176
1177 channels[].enabled
1178 IVI class IviScope, capability group IviScopeBase, section 4.2.5
1179
1180 If set to True, the oscilloscope acquires a waveform for the
1181 channel. If set to False, the oscilloscope does not acquire a
1182 waveform for the channel.
1183
1184 channels[].input_frequency_max
1185 IVI class IviScope, capability group IviScopeBase, section
1186 4.2.13
1187
1188 Specifies the maximum frequency for the input signal you want
1189 the instrument to accommodate without attenuating it by more
1190 than 3dB. If the bandwidth limit frequency of the instrument is
1191 greater than this maximum frequency, the driver enables the
1192 bandwidth limit. This attenuates the input signal by at least
1193 3dB at frequencies greater than the bandwidth limit.
1194
1195 channels[].input_impedance
1196 IVI class IviScope, capability group IviScopeBase, section
1197 4.2.12
1198
1199 Specifies the input impedance for the channel in Ohms.
1200
1201 Common values are 50.0, 75.0, and 1,000,000.0.
1202
1203 channels[].measurement.fetch_waveform
1204 IVI class IviScope, capability group IviScopeBase, section
1205 4.3.13
1206
1207 This function returns the waveform the oscilloscope acquires for
1208 the specified channel. The waveform is from a previously initi‐
1209 ated acquisition.
1210
1211 You use the Initiate Acquisition function to start an acquisi‐
1212 tion on the channels that the end-user configures with the Con‐
1213 figure Channel function. The oscilloscope acquires waveforms on
1214 the concurrently enabled channels. If the channel is not
1215 enabled for the acquisition, this function returns the Channel
1216 Not Enabled error.
1217
1218 Use this function only when the acquisition mode is Normal, Hi
1219 Res, or Average. If the acquisition type is not one of the
1220 listed types, the function returns the Invalid Acquisition Type
1221 error.
1222
1223 You use the Acquisition Status function to determine when the
1224 acquisition is complete. You must call this function separately
1225 for each enabled channel to obtain the waveforms.
1226
1227 You can call the Read Waveform function instead of the Initiate
1228 Acquisition function. The Read Waveform function starts an
1229 acquisition on all enabled channels, waits for the acquisition
1230 to complete, and returns the waveform for the specified channel.
1231 You call this function to obtain the waveforms for each of the
1232 remaining channels.
1233
1234 The return value is a list of (x, y) tuples that represent the
1235 time and voltage of each data point. The y point may be NaN in
1236 the case that the oscilloscope could not sample the voltage.
1237
1238 The end-user configures the interpolation method the oscillo‐
1239 scope uses with the Acquisition.Interpolation property. If
1240 interpolation is disabled, the oscilloscope does not interpolate
1241 points in the waveform. If the oscilloscope cannot sample a
1242 value for a point in the waveform, the driver sets the corre‐
1243 sponding element in the waveformArray to an IEEE-defined NaN
1244 (Not a Number) value. Check for this value with math.isnan() or
1245 numpy.isnan().
1246
1247 This function does not check the instrument status. Typically,
1248 the end-user calls this function only in a sequence of calls to
1249 other low-level driver functions. The sequence performs one
1250 operation. The end-user uses the low-level functions to optimize
1251 one or more aspects of interaction with the instrument. Call the
1252 Error Query function at the conclusion of the sequence to check
1253 the instrument status.
1254
1255 channels[].measurement.read_waveform
1256 IVI class IviScope, capability group IviScopeBase, section
1257 4.3.16
1258
1259 This function initiates an acquisition on the channels that the
1260 end-user configures with the Configure Channel function. If the
1261 channel is not enabled for the acquisition, this function
1262 returns Channel Not Enabled error. It then waits for the acqui‐
1263 sition to complete, and returns the waveform for the channel the
1264 end-user specifies. If the oscilloscope did not complete the
1265 acquisition within the time period the user specified with the
1266 max_time parameter, the function returns the Max Time Exceeded
1267 error.
1268
1269 Use this function only when the acquisition mode is Normal, Hi
1270 Res, or Average. If the acquisition type is not one of the
1271 listed types, the function returns the Invalid Acquisition Type
1272 error.
1273
1274 You call the Fetch Waveform function to obtain the waveforms for
1275 each of the remaining enabled channels without initiating
1276 another acquisition. After this function executes, each element
1277 in the WaveformArray parameter is either a voltage or a value
1278 indicating that the oscilloscope could not sample a voltage.
1279
1280 The end-user configures the interpolation method the oscillo‐
1281 scope uses with the Acquisition.Interpolation property. If
1282 interpolation is disabled, the oscilloscope does not interpolate
1283 points in the waveform. If the oscilloscope cannot sample a
1284 value for a point in the waveform, the driver sets the corre‐
1285 sponding element in the waveformArray to an IEEE-defined NaN
1286 (Not a Number) value. Check for this value with math.isnan() or
1287 numpy.isnan(). Check an entire array with
1288
1289 any(any(math.isnan(b) for b in a) for a in waveform)
1290
1291 channels[].name
1292 IVI class IviScope, capability group IviScopeBase, section 4.2.7
1293
1294 This attribute returns the repeated capability identifier
1295 defined by specific driver for the channel that corresponds to
1296 the index that the user specifies. If the driver defines a qual‐
1297 ified channel name, this property returns the qualified name.
1298
1299 If the value that the user passes for the Index parameter is
1300 less than zero or greater than the value of the channel count,
1301 the attribute raises a SelectorRangeException.
1302
1303 channels[].offset
1304 IVI class IviScope, capability group IviScopeBase, section
1305 4.2.24
1306
1307 Specifies the location of the center of the range that the Ver‐
1308 tical Range attribute specifies. The value is with respect to
1309 ground and is in volts.
1310
1311 For example, to acquire a sine wave that spans between on 0.0
1312 and 10.0 volts, set this attribute to 5.0 volts.
1313
1314 channels[].probe_attenuation
1315 IVI class IviScope, capability group IviScopeBase, section
1316 4.2.16
1317
1318 Specifies the scaling factor by which the probe the end-user
1319 attaches to the channel attenuates the input. For example, for a
1320 10:1 probe, the end-user sets this attribute to 10.0.
1321
1322 Note that if the probe is changed to one with a different atten‐
1323 uation, and this attribute is not set, the amplitude calcula‐
1324 tions will be incorrect.
1325
1326 Querying this value will return the probe attenuation corre‐
1327 sponding to the instrument's actual probe attenuation. Setting
1328 this property sets Probe Attenuation Auto to False Negative val‐
1329 ues are not valid.
1330
1331 channels[].range
1332 IVI class IviScope, capability group IviScopeBase, section
1333 4.2.25
1334
1335 Specifies the absolute value of the full-scale input range for a
1336 channel. The units are volts.
1337
1338 For example, to acquire a sine wave that spans between -5.0 and
1339 5.0 volts, set the Vertical Range attribute to 10.0 volts.
1340
1341 measurement.abort
1342 IVI class IviScope, capability group IviScopeBase, section 4.3.1
1343
1344 This function aborts an acquisition and returns the oscilloscope
1345 to the Idle state. This function does not check the instrument
1346 status.
1347
1348 Typically, the end-user calls this function only in a sequence
1349 of calls to other low-level driver functions. The sequence per‐
1350 forms one operation. The end-user uses the low-level functions
1351 to optimize one or more aspects of interaction with the instru‐
1352 ment. Call the Error Query function at the conclusion of the
1353 sequence to check the instrument status.
1354
1355 If the instrument cannot abort an initiated acquisition, the
1356 driver shall return the Function Not Supported error.
1357
1358 measurement.initiate
1359 IVI class IviScope, capability group IviScopeBase, section
1360 4.3.14
1361
1362 This function initiates a waveform acquisition. After calling
1363 this function, the oscilloscope leaves the idle state and waits
1364 for a trigger. The oscilloscope acquires a waveform for each
1365 channel the end-user has enabled with the Configure Channel
1366 function.
1367
1368 This function does not check the instrument status. Typically,
1369 the end-user calls this function only in a sequence of calls to
1370 other low-level driver functions. The sequence performs one
1371 operation. The end-user uses the low-level functions to optimize
1372 one or more aspects of interaction with the instrument. Call the
1373 Error Query function at the conclusion of the sequence to check
1374 the instrument status.
1375
1376 measurement.status
1377 IVI class IviScope, capability group IviScopeBase, section 4.2.2
1378
1379 Acquisition status indicates whether an acquisition is in
1380 progress, complete, or if the status is unknown.
1381
1382 Acquisition status is not the same as instrument status, and
1383 does not necessarily check for instrument errors. To make sure
1384 that the instrument is checked for errors after getting the
1385 acquisition status, call the Error Query method. (Note that the
1386 end user may want to call Error Query at the end of a sequence
1387 of other calls which include getting the acquisition status - it
1388 does not necessarily need to be called immediately.)
1389
1390 If the driver cannot determine whether the acquisition is com‐
1391 plete or not, it returns the Acquisition Status Unknown value.
1392
1393 Values: * 'compete' * 'in_progress' * 'unknown'
1394
1395 trigger.configure
1396 IVI class IviScope, capability group IviScopeBase, section
1397 4.3.10
1398
1399 This function configures the common attributes of the trigger
1400 subsystem. These attributes are the trigger type and trigger
1401 holdoff.
1402
1403 When the end-user calls Read Waveform, Read Waveform Measure‐
1404 ment, Read Min Max Waveform, or Initiate Acquisition, the oscil‐
1405 loscope waits for a trigger. The end-user specifies the type of
1406 trigger for which the oscilloscope waits with the TriggerType
1407 parameter.
1408
1409 If the oscilloscope requires multiple waveform acquisitions to
1410 build a complete waveform, it waits for the length of time the
1411 end-user specifies with the Holdoff parameter to elapse since
1412 the previous trigger. The oscilloscope then waits for the next
1413 trigger. Once the oscilloscope acquires a complete waveform, it
1414 returns to the idle state.
1415
1416 trigger.coupling
1417 IVI class IviScope, capability group IviScopeBase, section
1418 4.2.17
1419
1420 Specifies how the oscilloscope couples the trigger source.
1421
1422 Values:
1423
1424 · 'ac'
1425
1426 · 'dc'
1427
1428 · 'lf_reject'
1429
1430 · 'hf_reject'
1431
1432 · 'noise_reject'
1433
1434 trigger.edge.configure
1435 IVI class IviScope, capability group IviScopeBase, section 4.3.9
1436
1437 This function sets the edge triggering attributes. An edge trig‐
1438 ger occurs when the trigger signal that the end-user specifies
1439 with the Source parameter passes through the voltage threshold
1440 that the end-user specifies with the level parameter and has the
1441 slope that the end-user specifies with the Slope parameter.
1442
1443 This function affects instrument behavior only if the Trigger
1444 Type is Edge Trigger. Set the Trigger Type and Trigger Coupling
1445 before calling this function.
1446
1447 If the trigger source is one of the analog input channels, an
1448 application program should configure the vertical range, verti‐
1449 cal offset, vertical coupling, probe attenuation, and the maxi‐
1450 mum input frequency before calling this function.
1451
1452 trigger.edge.slope
1453 IVI class IviScope, capability group IviScopeBase, section
1454 4.2.20
1455
1456 Specifies whether a rising or a falling edge triggers the oscil‐
1457 loscope.
1458
1459 This attribute affects instrument operation only when the Trig‐
1460 ger Type attribute is set to Edge Trigger.
1461
1462 Values:
1463
1464 · 'positive'
1465
1466 · 'negative'
1467
1468 trigger.holdoff
1469 IVI class IviScope, capability group IviScopeBase, section
1470 4.2.18
1471
1472 Specifies the length of time the oscilloscope waits after it
1473 detects a trigger until the oscilloscope enables the trigger
1474 subsystem to detect another trigger. The units are seconds. The
1475 Trigger Holdoff attribute affects instrument operation only when
1476 the oscilloscope requires multiple acquisitions to build a com‐
1477 plete waveform. The oscilloscope requires multiple waveform
1478 acquisitions when it uses equivalent-time sampling or when the
1479 Acquisition Type attribute is set to Envelope or Average.
1480
1481 Note: Many scopes have a small, non-zero value as the minimum
1482 value for this attribute. To configure the instrument to use the
1483 shortest trigger hold-off, the user can specify a value of zero
1484 for this attribute.
1485
1486 Therefore, the IVI Class-Compliant specific driver shall coerce
1487 any value between zero and the minimum value to the minimum
1488 value. No other coercion is allowed on this attribute.
1489
1490 trigger.level
1491 IVI class IviScope, capability group IviScopeBase, section
1492 4.2.19
1493
1494 Specifies the voltage threshold for the trigger sub-system. The
1495 units are volts. This attribute affects instrument behavior only
1496 when the Trigger Type is set to one of the following values:
1497 Edge Trigger, Glitch Trigger, or Width Trigger.
1498
1499 This attribute, along with the Trigger Slope, Trigger Source,
1500 and Trigger Coupling attributes, defines the trigger event when
1501 the Trigger Type is set to Edge Trigger.
1502
1503 trigger.source
1504 IVI class IviScope, capability group IviScopeBase, section
1505 4.2.21
1506
1507 Specifies the source the oscilloscope monitors for the trigger
1508 event. The value can be a channel name alias, a driver-specific
1509 channel string, or one of the values below.
1510
1511 This attribute affects the instrument operation only when the
1512 Trigger Type is set to one of the following values: Edge Trig‐
1513 ger, TV Trigger, Runt Trigger, Glitch Trigger, or Width Trigger.
1514
1515 trigger.type
1516 IVI class IviScope, capability group IviScopeBase, section
1517 4.2.22
1518
1519 Specifies the event that triggers the oscilloscope.
1520
1521 Values:
1522
1523 · 'edge'
1524
1525 · 'tv'
1526
1527 · 'runt'
1528
1529 · 'glitch'
1530
1531 · 'width'
1532
1533 · 'immediate'
1534
1535 · 'ac_line'
1536
1537 Interpolation class
1538 class ivi.scope.Interpolation(*args, **kwargs)
1539 Bases: ivi.ivi.IviContainer
1540
1541 Extension IVI methods for oscilloscopes supporting interpolation
1542
1543 acquisition.interpolation
1544 IVI class IviScope, capability group IviScopeInterpolation, sec‐
1545 tion 5.2.1
1546
1547 Specifies the interpolation method the oscilloscope uses when it
1548 cannot resolve a voltage for every point in the waveform record.
1549
1550 Values: * 'none' * 'sinex' * 'linear'
1551
1552 TVTrigger class
1553 class ivi.scope.TVTrigger(*args, **kwargs)
1554 Bases: ivi.ivi.IviContainer
1555
1556 Extension IVI methods for oscilloscopes supporting TV triggering
1557
1558 trigger.tv.configure
1559 IVI class IviScope, capability group IviScopeTVTrigger, section
1560 6.3.2
1561
1562 This function configures the oscilloscope for TV triggering. It
1563 configures the TV signal format, the event and the signal polar‐
1564 ity.
1565
1566 This function affects instrument behavior only if the trigger
1567 type is TV Trigger. Set the Trigger Type and Trigger Coupling
1568 before calling this function.
1569
1570 trigger.tv.line_number
1571 IVI class IviScope, capability group IviScopeTVTrigger, section
1572 6.2.2
1573
1574 Specifies the line on which the oscilloscope triggers. The
1575 driver uses this attribute when the TV Trigger Event is set to
1576 TV Event Line Number. The line number setting is independent of
1577 the field. This means that to trigger on the first line of the
1578 second field, the user must configure the line number to the
1579 value of 263 (if we presume that field one had 262 lines).
1580
1581 trigger.tv.polarity
1582 IVI class IviScope, capability group IviScopeTVTrigger, section
1583 6.2.3
1584
1585 Specifies the polarity of the TV signal.
1586
1587 Values: * 'positive' * 'negative'
1588
1589 trigger.tv.signal_format
1590 IVI class IviScope, capability group IviScopeTVTrigger, section
1591 6.2.4
1592
1593 Specifies the format of TV signal on which the oscilloscope
1594 triggers.
1595
1596 Values: * 'ntsc' * 'pal' * 'secam'
1597
1598 trigger.tv.trigger_event
1599 IVI class IviScope, capability group IviScopeTVTrigger, section
1600 6.2.1
1601
1602 Specifies the event on which the oscilloscope triggers.
1603
1604 Values: * 'field1' * 'field2' * 'any_field' * 'any_line' *
1605 'line_number'
1606
1607 RuntTrigger class
1608 class ivi.scope.RuntTrigger(*args, **kwargs)
1609 Bases: ivi.ivi.IviContainer
1610
1611 Extension IVI methods for oscilloscopes supporting runt trigger‐
1612 ing
1613
1614 trigger.runt.configure
1615 IVI class IviScope, capability group IviScopeRuntTrigger, sec‐
1616 tion 7.3.1
1617
1618 This function configures the runt trigger. A runt trigger occurs
1619 when the trigger signal crosses one of the runt thresholds twice
1620 without crossing the other runt threshold. The end-user speci‐
1621 fies the runt thresholds with the RuntLowThreshold and RuntHigh‐
1622 Threshold parameters. The end-user specifies the polarity of the
1623 runt with the RuntPolarity parameter.
1624
1625 This function affects instrument behavior only if the trigger
1626 type is Runt Trigger. Set the trigger type and trigger coupling
1627 before calling this function.
1628
1629 trigger.runt.polarity
1630 IVI class IviScope, capability group IviScopeRuntTrigger, sec‐
1631 tion 7.2.3
1632
1633 Specifies the polarity of the runt that triggers the oscillo‐
1634 scope.
1635
1636 Values: * 'positive' * 'negative' * 'either'
1637
1638 trigger.runt.threshold_high
1639 IVI class IviScope, capability group IviScopeRuntTrigger, sec‐
1640 tion 7.2.1
1641
1642 Specifies the high threshold the oscilloscope uses for runt
1643 triggering. The units are volts.
1644
1645 trigger.runt.threshold_low
1646 IVI class IviScope, capability group IviScopeRuntTrigger, sec‐
1647 tion 7.2.2
1648
1649 Specifies the low threshold the oscilloscope uses for runt trig‐
1650 gering. The units are volts.
1651
1652 GlitchTrigger class
1653 class ivi.scope.GlitchTrigger(*args, **kwargs)
1654 Bases: ivi.ivi.IviContainer
1655
1656 Extension IVI methods for oscilloscopes supporting glitch trig‐
1657 gering
1658
1659 trigger.glitch.condition
1660 IVI class IviScope, capability group IviScopeGlitchTrigger, sec‐
1661 tion 8.2.1
1662
1663 Specifies the glitch condition. This attribute determines
1664 whether the glitch trigger happens when the oscilloscope detects
1665 a pulse with a width less than or greater than the width value.
1666
1667 Values: * 'greater_than' * 'less_than'
1668
1669 trigger.glitch.configure
1670 IVI class IviScope, capability group IviScopeGlitchTrigger, sec‐
1671 tion 8.3.1
1672
1673 This function configures the glitch trigger. A glitch trigger
1674 occurs when the trigger signal has a pulse with a width that is
1675 less than or greater than the glitch width. The end user speci‐
1676 fies which comparison criterion to use with the GlitchCondition
1677 parameter. The end-user specifies the glitch width with the
1678 GlitchWidth parameter. The end-user specifies the polarity of
1679 the pulse with the GlitchPolarity parameter. The trigger does
1680 not actually occur until the edge of a pulse that corresponds to
1681 the GlitchWidth and GlitchPolarity crosses the threshold the
1682 end-user specifies in the TriggerLevel parameter.
1683
1684 This function affects instrument behavior only if the trigger
1685 type is Glitch Trigger. Set the trigger type and trigger cou‐
1686 pling before calling this function.
1687
1688 trigger.glitch.polarity
1689 IVI class IviScope, capability group IviScopeGlitchTrigger, sec‐
1690 tion 8.2.2
1691
1692 Specifies the polarity of the glitch that triggers the oscillo‐
1693 scope.
1694
1695 Values: * 'positive' * 'negative' * 'either'
1696
1697 trigger.glitch.width
1698 IVI class IviScope, capability group IviScopeGlitchTrigger, sec‐
1699 tion 8.2.3
1700
1701 Specifies the glitch width. The units are seconds. The oscillo‐
1702 scope triggers when it detects a pulse with a width less than or
1703 greater than this value, depending on the Glitch Condition
1704 attribute.
1705
1706 WidthTrigger class
1707 class ivi.scope.WidthTrigger(*args, **kwargs)
1708 Bases: ivi.ivi.IviContainer
1709
1710 Extension IVI methods for oscilloscopes supporting width trig‐
1711 gering
1712
1713 trigger.width.condition
1714 IVI class IviScope, capability group IviScopeWidthTrigger, sec‐
1715 tion 9.2.1
1716
1717 Specifies whether a pulse that is within or outside the high and
1718 low thresholds triggers the oscilloscope. The end-user specifies
1719 the high and low thresholds with the Width High Threshold and
1720 Width Low Threshold attributes.
1721
1722 Values: * 'within' * 'outside'
1723
1724 trigger.width.configure
1725 IVI class IviScope, capability group IviScopeWidthTrigger, sec‐
1726 tion 9.3.1
1727
1728 This function configures the width trigger. A width trigger
1729 occurs when the oscilloscope detects a positive or negative
1730 pulse with a width between, or optionally outside, the width
1731 thresholds. The end-user specifies the width thresholds with the
1732 WidthLowThreshold and WidthHighThreshold parameters. The
1733 end-user specifies whether the oscilloscope triggers on pulse
1734 widths that are within or outside the width thresholds with the
1735 WidthCondition parameter. The end-user specifies the polarity of
1736 the pulse with the WidthPolarity parameter. The trigger does not
1737 actually occur until the edge of a pulse that corresponds to the
1738 WidthLowThreshold, WidthHighThreshold, WidthCondition, and
1739 WidthPolarity crosses the threshold the end-user specifies with
1740 the TriggerLevel parameter.
1741
1742 This function affects instrument behavior only if the trigger
1743 type is Width Trigger. Set the trigger type and trigger coupling
1744 before calling this function.
1745
1746 trigger.width.polarity
1747 IVI class IviScope, capability group IviScopeWidthTrigger, sec‐
1748 tion 9.2.4
1749
1750 Specifies the polarity of the pulse that triggers the oscillo‐
1751 scope.
1752
1753 Values: * 'positive' * 'negative' * 'either'
1754
1755 trigger.width.threshold_high
1756 IVI class IviScope, capability group IviScopeWidthTrigger, sec‐
1757 tion 9.2.2
1758
1759 Specifies the high width threshold time. Units are seconds.
1760
1761 trigger.width.threshold_low
1762 IVI class IviScope, capability group IviScopeWidthTrigger, sec‐
1763 tion 9.2.3
1764
1765 Specifies the low width threshold time. Units are seconds.
1766
1767 AcLineTrigger class
1768 class ivi.scope.AcLineTrigger(*args, **kwargs)
1769 Bases: ivi.ivi.IviContainer
1770
1771 Extension IVI methods for oscilloscopes supporting AC line trig‐
1772 gering
1773
1774 trigger.ac_line.slope
1775 IVI class IviScope, capability group IviScopeAcLineTrigger, sec‐
1776 tion 10.2.1
1777
1778 Specifies the slope of the zero crossing upon which the scope
1779 triggers.
1780
1781 Values: * 'positive' * 'negative' * 'either'
1782
1783 WaveformMeasurement class
1784 class ivi.scope.WaveformMeasurement(*args, **kwargs)
1785 Bases: ivi.ivi.IviContainer
1786
1787 Extension IVI methods for oscilloscopes supporting waveform mea‐
1788 surements
1789
1790 channels[].measurement.fetch_waveform_measurement
1791 IVI class IviScope, capability group IviScopeWaveformMeasure‐
1792 ment, section 11.3.2
1793
1794 This function fetches a specified waveform measurement from a
1795 specific channel from a previously initiated waveform acquisi‐
1796 tion. If the channel is not enabled for the acquisition, this
1797 function returns the Channel Not Enabled error.
1798
1799 This function obtains a waveform measurement and returns the
1800 measurement value. The end-user specifies a particular measure‐
1801 ment type, such as rise time, frequency, and voltage
1802 peak-to-peak. The waveform on which the oscilloscope calculates
1803 the waveform measurement is from an acquisition that was previ‐
1804 ously initiated.
1805
1806 Use the Initiate Acquisition function to start an acquisition on
1807 the channels that were enabled with the Configure Channel func‐
1808 tion. The oscilloscope acquires waveforms for the enabled chan‐
1809 nels concurrently. Use the Acquisition Status function to deter‐
1810 mine when the acquisition is complete. Call this function sepa‐
1811 rately for each waveform measurement on a specific channel.
1812
1813 The end-user can call the Read Waveform Measurement function
1814 instead of the Initiate Acquisition function. The Read Waveform
1815 Measurement function starts an acquisition on all enabled chan‐
1816 nels. It then waits for the acquisition to complete, obtains a
1817 waveform measurement on the specified channel, and returns the
1818 measurement value. Call this function separately to obtain any
1819 other waveform measurements on a specific channel.
1820
1821 Configure the appropriate reference levels before calling this
1822 function to take a rise time, fall time, width negative, width
1823 positive, duty cycle negative, or duty cycle positive measure‐
1824 ment.
1825
1826 The end-user can configure the low, mid, and high references
1827 either by calling the Configure Reference Levels function or by
1828 setting the following attributes.
1829
1830 · Measurement High Reference
1831
1832 · Measurement Low Reference
1833
1834 · Measurement Mid Reference
1835
1836 This function does not check the instrument status. Typically,
1837 the end-user calls this function only in a sequence of calls to
1838 other low-level driver functions. The sequence performs one
1839 operation. The end-user uses the low-level functions to optimize
1840 one or more aspects of interaction with the instrument. Call the
1841 Error Query function at the conclusion of the sequence to check
1842 the instrument status.
1843
1844 Values for measurement_function: * 'rise_time' * 'fall_time' *
1845 'frequency' * 'period' * 'voltage_rms' * 'voltage_peak_to_peak'
1846 * 'voltage_max' * 'voltage_min' * 'voltage_high' * 'voltage_low'
1847 * 'voltage_average' * 'width_negative' * 'width_positive' *
1848 'duty_cycle_negative' * 'duty_cycle_positive' * 'amplitude' *
1849 'voltage_cycle_rms' * 'voltage_cycle_average' * 'overshoot' *
1850 'preshoot'
1851
1852 channels[].measurement.read_waveform_measurement
1853 IVI class IviScope, capability group IviScopeWaveformMeasure‐
1854 ment, section 11.3.3
1855
1856 This function initiates a new waveform acquisition and returns a
1857 specified waveform measurement from a specific channel.
1858
1859 This function initiates an acquisition on the channels that the
1860 end-user enables with the Configure Channel function. If the
1861 channel is not enabled for the acquisition, this function
1862 returns Channel Not Enabled error. It then waits for the acqui‐
1863 sition to complete, obtains a waveform measurement on the chan‐
1864 nel the end-user specifies, and returns the measurement value.
1865 The end-user specifies a particular measurement type, such as
1866 rise time, frequency, and voltage peak-to-peak.
1867
1868 If the oscilloscope did not complete the acquisition within the
1869 time period the user specified with the MaxTimeMilliseconds
1870 parameter, the function returns the Max Time Exceeded error.
1871
1872 The end-user can call the Fetch Waveform Measurement function
1873 separately to obtain any other waveform measurement on a spe‐
1874 cific channel without initiating another acquisition.
1875
1876 The end-user must configure the appropriate reference levels
1877 before calling this function. Configure the low, mid, and high
1878 references either by calling the Configure Reference Levels
1879 function or by setting the following attributes. following
1880 attributes.
1881
1882 · Measurement High Reference
1883
1884 · Measurement Low Reference
1885
1886 · Measurement Mid Reference
1887
1888 reference_level.configure
1889 IVI class IviScope, capability group IviScopeWaveformMeasure‐
1890 ment, section 11.3.1
1891
1892 This function configures the reference levels for waveform mea‐
1893 surements. Call this function before calling the Read Waveform
1894 Measurement or Fetch Waveform Measurement to take waveform mea‐
1895 surements.
1896
1897 reference_level.high
1898 IVI class IviScope, capability group IviScopeWaveformMeasure‐
1899 ment, section 11.2.1
1900
1901 Specifies the high reference the oscilloscope uses for waveform
1902 measurements. The value is a percentage of the difference
1903 between the Voltage High and Voltage Low.
1904
1905 reference_level.low
1906 IVI class IviScope, capability group IviScopeWaveformMeasure‐
1907 ment, section 11.2.2
1908
1909 Specifies the low reference the oscilloscope uses for waveform
1910 measurements. The value is a percentage of the difference
1911 between the Voltage High and Voltage Low.
1912
1913 reference_level.middle
1914 IVI class IviScope, capability group IviScopeWaveformMeasure‐
1915 ment, section 11.2.3
1916
1917 Specifies the middle reference the oscilloscope uses for wave‐
1918 form measurements. The value is a percentage of the difference
1919 between the Voltage High and Voltage Low.
1920
1921 MinMaxWaveform class
1922 class ivi.scope.MinMaxWaveform(*args, **kwargs)
1923 Bases: ivi.ivi.IviContainer
1924
1925 Extension IVI methods for oscilloscopes supporting minimum and
1926 maximum waveform acquisition
1927
1928 acquisition.number_of_envelopes
1929 IVI class IviScope, capability group IviScopeMinMaxWaveform,
1930 section 12.2.1
1931
1932 When the end-user sets the Acquisition Type attribute to Enve‐
1933 lope, the oscilloscope acquires multiple waveforms. After each
1934 waveform acquisition, the oscilloscope keeps the minimum and
1935 maximum values it finds for each point in the waveform record.
1936 This attribute specifies the number of waveforms the oscillo‐
1937 scope acquires and analyzes to create the minimum and maximum
1938 waveforms. After the oscilloscope acquires as many waveforms as
1939 this attribute specifies, it returns to the idle state. This
1940 attribute affects instrument operation only when the Acquisition
1941 Type attribute is set to Envelope.
1942
1943 channels[].measurement.fetch_waveform_min_max
1944 IVI class IviScope, capability group IviScopeMinMaxWaveform,
1945 section 12.3.2
1946
1947 This function returns the minimum and maximum waveforms that the
1948 oscilloscope acquires for the specified channel. If the channel
1949 is not enabled for the acquisition, this function returns the
1950 Channel Not Enabled error.
1951
1952 The waveforms are from a previously initiated acquisition. Use
1953 this function to fetch waveforms when the acquisition type is
1954 set to Peak Detect or Envelope. If the acquisition type is not
1955 one of the listed types, the function returns the Invalid Acqui‐
1956 sition Type error.
1957
1958 Use the Initiate Acquisition function to start an acquisition on
1959 the enabled channels. The oscilloscope acquires the min/max
1960 waveforms for the enabled channels concurrently. Use the Acqui‐
1961 sition Status function to determine when the acquisition is com‐
1962 plete. The end-user must call this function separately for each
1963 enabled channel to obtain the min/max waveforms.
1964
1965 The end-user can call the Read Min Max Waveform function instead
1966 of the Initiate Acquisition function. The Read Min Max Waveform
1967 function starts an acquisition on all enabled channels, waits
1968 for the acquisition to complete, and returns the min/max wave‐
1969 forms for the specified channel. You call this function to
1970 obtain the min/max waveforms for each of the remaining channels.
1971
1972 After this function executes, each element in the MinWaveform
1973 and MaxWaveform parameters is either a voltage or a value indi‐
1974 cating that the oscilloscope could not sample a voltage.
1975
1976 The return value is a list of (x, y_min, y_max) tuples that rep‐
1977 resent the time and voltage of each data point. Either of the y
1978 points may be NaN in the case that the oscilloscope could not
1979 sample the voltage.
1980
1981 The end-user configures the interpolation method the oscillo‐
1982 scope uses with the Acquisition.Interpolation property. If
1983 interpolation is disabled, the oscilloscope does not interpolate
1984 points in the waveform. If the oscilloscope cannot sample a
1985 value for a point in the waveform, the driver sets the corre‐
1986 sponding element in the waveformArray to an IEEE-defined NaN
1987 (Not a Number) value. Check for this value with math.isnan() or
1988 numpy.isnan(). Check an entire array with
1989
1990 any(any(math.isnan(b) for b in a) for a in waveform)
1991
1992 This function does not check the instrument status. Typically,
1993 the end-user calls this function only in a sequence of calls to
1994 other low-level driver functions. The sequence performs one
1995 operation. The end-user uses the low-level functions to optimize
1996 one or more aspects of interaction with the instrument. Call the
1997 Error Query function at the conclusion of the sequence to check
1998 the instrument status.
1999
2000 channels[].measurement.read_waveform_min_max
2001 IVI class IviScope, capability group IviScopeMinMaxWaveform,
2002 section 12.3.3
2003
2004 This function initiates new waveform acquisition and returns
2005 minimum and maximum waveforms from a specific channel. If the
2006 channel is not enabled for the acquisition, this function
2007 returns the Channel Not Enabled error.
2008
2009 This function is used when the Acquisition Type is Peak Detect
2010 or Envelope. If the acquisition type is not one of the listed
2011 types, the function returns the Invalid Acquisition Type error.
2012
2013 This function initiates an acquisition on the enabled channels.
2014 It then waits for the acquisition to complete, and returns the
2015 min/max waveforms for the specified channel. Call the Fetch Min
2016 Max Waveform function to obtain the min/max waveforms for each
2017 of the remaining enabled channels without initiating another
2018 acquisition. If the oscilloscope did not complete the acquisi‐
2019 tion within the time period the user specified with the max_time
2020 parameter, the function returns the Max Time Exceeded error.
2021
2022 The return value is a list of (x, y_min, y_max) tuples that rep‐
2023 resent the time and voltage of each data point. Either of the y
2024 points may be NaN in the case that the oscilloscope could not
2025 sample the voltage.
2026
2027 The end-user configures the interpolation method the oscillo‐
2028 scope uses with the Acquisition.Interpolation property. If
2029 interpolation is disabled, the oscilloscope does not interpolate
2030 points in the waveform. If the oscilloscope cannot sample a
2031 value for a point in the waveform, the driver sets the corre‐
2032 sponding element in the waveformArray to an IEEE-defined NaN
2033 (Not a Number) value. Check for this value with math.isnan() or
2034 numpy.isnan(). Check an entire array with
2035
2036 any(any(math.isnan(b) for b in a) for a in waveform)
2037
2038 This function does not check the instrument status. Typically,
2039 the end-user calls this function only in a sequence of calls to
2040 other low-level driver functions. The sequence performs one
2041 operation. The end-user uses the low-level functions to optimize
2042 one or more aspects of interaction with the instrument. Call the
2043 Error Query function at the conclusion of the sequence to check
2044 the instrument status.
2045
2046 ProbeAutoSense class
2047 class ivi.scope.ProbeAutoSense(*args, **kwargs)
2048 Bases: ivi.ivi.IviContainer
2049
2050 Extension IVI methods for oscilloscopes supporting probe attenu‐
2051 ation sensing
2052
2053 channels[].probe_attenuation_auto
2054 IVI class IviScope, capability group IviScopeProbeAutoSense,
2055 section 13.2.1
2056
2057 If this attribute is True, the driver configures the oscillo‐
2058 scope to sense the attenuation of the probe automatically.
2059
2060 If this attribute is False, the driver disables the automatic
2061 probe sense and configures the oscilloscope to use the value of
2062 the Probe Attenuation attribute.
2063
2064 The actual probe attenuation the oscilloscope is currently using
2065 can be determined from the Probe Attenuation attribute.
2066
2067 Setting the Probe Attenuation attribute also sets the Probe
2068 Attenuation Auto attribute to false.
2069
2070 ContinuousAcquisition class
2071 class ivi.scope.ContinuousAcquisition(*args, **kwargs)
2072 Bases: ivi.ivi.IviContainer
2073
2074 Extension IVI methods for oscilloscopes supporting continuous
2075 acquisition
2076
2077 trigger.continuous
2078 IVI class IviScope, capability group IviScopeContinuousAcquisi‐
2079 tion, section 14.2.1
2080
2081 Specifies whether the oscilloscope continuously initiates wave‐
2082 form acquisition. If the end-user sets this attribute to True,
2083 the oscilloscope immediately waits for another trigger after the
2084 previous waveform acquisition is complete. Setting this
2085 attribute to True is useful when the end-user requires continu‐
2086 ous updates of the oscilloscope display. This specification does
2087 not define the behavior of the read waveform and fetch waveform
2088 functions when this attribute is set to True. The behavior of
2089 these functions is instrument specific.
2090
2091 AverageAcquisition class
2092 class ivi.scope.AverageAcquisition(*args, **kwargs)
2093 Bases: ivi.ivi.IviContainer
2094
2095 Extension IVI methods for oscilloscopes supporting average
2096 acquisition
2097
2098 acquisition.number_of_averages
2099 IVI class IviScope, capability group IviScopeAverageAcquisition,
2100 section 15.2.1
2101
2102 Specifies the number of waveform the oscilloscope acquires and
2103 averages. After the oscilloscope acquires as many waveforms as
2104 this attribute specifies, it returns to the idle state. This
2105 attribute affects instrument behavior only when the Acquisition
2106 Type attribute is set to Average.
2107
2108 SampleMode class
2109 class ivi.scope.SampleMode(*args, **kwargs)
2110 Bases: ivi.ivi.IviContainer
2111
2112 Extension IVI methods for oscilloscopes supporting equivalent
2113 and real time acquisition
2114
2115 acquisition.sample_mode
2116 IVI class IviScope, capability group IviScopeSampleMode, section
2117 16.2.1
2118
2119 Returns the sample mode the oscilloscope is currently using.
2120
2121 Values: * 'real_time' * 'equivalent_time'
2122
2123 TriggerModifier class
2124 class ivi.scope.TriggerModifier(*args, **kwargs)
2125 Bases: ivi.ivi.IviContainer
2126
2127 Extension IVI methods for oscilloscopes supporting specific
2128 triggering subsystem behavior in the absence of a trigger
2129
2130 trigger.modifier
2131 IVI class IviScope, capability group IviScopeTriggerModifier,
2132 section 17.2.1
2133
2134 Specifies the trigger modifier. The trigger modifier determines
2135 the oscilloscope's behavior in the absence of the configured
2136 trigger.
2137
2138 Values: * 'none' * 'auto' * 'auto_level'
2139
2140 AutoSetup class
2141 class ivi.scope.AutoSetup(*args, **kwargs)
2142 Bases: ivi.ivi.IviContainer
2143
2144 Extension IVI methods for oscilloscopes supporting automatic
2145 setup
2146
2147 measurement.auto_setup
2148 IVI class IviScope, capability group IviScopeAutoSetup, section
2149 18.2.1
2150
2151 This function performs an auto-setup on the instrument.
2152
2154 This module provides the base functionality for Function Generators.
2155
2156 Functions and Exceptions
2157 exception ivi.fgen.IviException
2158 Exception raised on various occasions; argument is a string
2159 describing what is wrong.
2160
2161 Base class
2162 class ivi.fgen.Base(*args, **kwargs)
2163 Bases: ivi.ivi.IviContainer
2164
2165 Base IVI methods for all function generators
2166
2167 ivi.fgen.abort_generation
2168 Aborts a previously initiated signal generation. If the func‐
2169 tion generator is in the Output Generation State, this func‐
2170 tion moves the function generator to the Configuration State.
2171 If the function generator is already in the Configuration
2172 State, the function does nothing and returns Success.
2173
2174 This specification requires that the user be able to config‐
2175 ure the output of the function generator regardless of
2176 whether the function generator is in the Configuration State
2177 or the Generation State. This means that the user is not
2178 required to call Abort Generation prior to configuring the
2179 output of the function generator.
2180
2181 Many function generators constantly generate an output sig‐
2182 nal, and do not require the user to abort signal generation
2183 prior to configuring the instrument. If a function genera‐
2184 tor's output cannot be aborted (i.e., the function generator
2185 cannot stop generating a signal) this function does nothing
2186 and returns Success.
2187
2188 Some function generators require that the user abort signal
2189 generation prior to configuring the instrument. The specific
2190 drivers for these types of instruments must compensate for
2191 this restriction and allow the user to configure the instru‐
2192 ment without requiring the user to call Abort Generation. For
2193 these types of instruments, there is often a significant per‐
2194 formance increase if the user configures the output while the
2195 instrument is not generating a signal.
2196
2197 The user is not required to call Abort Generation or Initiate
2198 Generation. Whether the user chooses to call these functions
2199 in an application program has no impact on interchangeabil‐
2200 ity. The user can choose to use these functions if they want
2201 to optimize their application for instruments that exhibit
2202 increased performance when output configuration is performed
2203 while the instrument is not generating a signal.
2204
2205 ivi.fgen.initiate_generation
2206 Initiates signal generation. If the function generator is in
2207 the Configuration State, this function moves the function
2208 generator to the Output Generation State. If the function
2209 generator is already in the Output Generation State, this
2210 function does nothing and returns Success.
2211
2212 This specification requires that the instrument be in the
2213 Generation State after the user calls the Initialize or Reset
2214 functions. This specification also requires that the user be
2215 able to configure the output of the function generator
2216 regardless of whether the function generator is in the Con‐
2217 figuration State or the Generation State. This means that the
2218 user is only required to call Initiate Generation if they
2219 abort signal generation by calling Abort Generation.
2220
2221 Many function generators constantly generate an output sig‐
2222 nal, and do not require the user to abort signal generation
2223 prior to configuring the instrument. If a function genera‐
2224 tor's output cannot be aborted (i.e., the function generator
2225 cannot stop generating a signal) this function does nothing
2226 and returns Success.
2227
2228 Some function generators require that the user abort signal
2229 generation prior to configuring the instrument. The specific
2230 drivers for these types of instruments must compensate for
2231 this restriction and allow the user to configure the instru‐
2232 ment without requiring the user to call Abort Generation. For
2233 these types of instruments, there is often a significant per‐
2234 formance increase if the user configures the output while the
2235 instrument is not generating a signal.
2236
2237 The user is not required to call Abort Generation or Initiate
2238 Generation. Whether the user chooses to call these functions
2239 in an application program has no impact on interchangeabil‐
2240 ity. The user can choose to use these functions if they want
2241 to optimize their application for instruments that exhibit
2242 increased performance when output configuration is performed
2243 while the instrument is not generating a signal.
2244
2245 outputs.enabled
2246 If set to True, the signal the function generator produces
2247 appears at the output connector. If set to False, the signal
2248 the function generator produces does not appear at the output
2249 connector.
2250
2251 outputs.impedance
2252 Specifies the impedance of the output channel. The units are
2253 Ohms.
2254
2255 outputs.name
2256 This property returns the physical name defined by the spe‐
2257 cific driver for the output channel that corresponds to the
2258 0-based index that the user specifies. If the driver defines
2259 a qualified channel name, this property returns the qualified
2260 name. If the value that the user passes for the Index parame‐
2261 ter is less than zero or greater than the value of Output
2262 Count, the property returns an empty string and returns an
2263 error.
2264
2265 outputs.operation_mode
2266 Specifies how the function generator produces output on a
2267 channel.
2268
2269 Values for operation_mode:
2270
2271 · 'continuous'
2272
2273 · 'burst'
2274
2275 outputs.output_mode
2276 Determines how the function generator produces waveforms.
2277 This attribute determines which extension group's functions
2278 and attributes are used to configure the waveform the func‐
2279 tion generator produces.
2280
2281 Values for output_mode:
2282
2283 · 'function'
2284
2285 · 'arbitrary'
2286
2287 · 'sequence'
2288
2289 outputs.reference_clock_source
2290 Specifies the source of the reference clock. The function
2291 generator derives frequencies and sample rates that it uses
2292 to generate waveforms from the reference clock.
2293
2294 The source of the reference clock is a string. If an IVI
2295 driver supports a reference clock source and the reference
2296 clock source is listed in IVI-3.3 Cross Class Capabilities
2297 Specification, Section 3, then the IVI driver shall accept
2298 the standard string for that reference clock. This attribute
2299 is case insensitive, but case preserving. That is, the set‐
2300 ting is case insensitive but when reading it back the pro‐
2301 grammed case is returned. IVI specific drivers may define new
2302 reference clock source strings for reference clock sources
2303 that are not defined by IVI-3.3 Cross Class Capabilities
2304 Specification if needed.
2305
2306 StdFunc class
2307 class ivi.fgen.StdFunc(*args, **kwargs)
2308 Bases: ivi.ivi.IviContainer
2309
2310 Extension IVI methods for function generators that can produce
2311 manufacturer-supplied periodic waveforms
2312
2313 outputs.standard_waveform.amplitude
2314 Specifies the amplitude of the standard waveform the function
2315 generator produces. When the Waveform attribute is set to
2316 Waveform DC, this attribute does not affect signal output.
2317 The units are volts.
2318
2319 outputs.standard_waveform.configure
2320 This function configures the attributes of the function gen‐
2321 erator that affect standard waveform generation. These
2322 attributes are the Waveform, Amplitude, DC Offset, Frequency,
2323 and Start Phase.
2324
2325 When the Waveform parameter is set to Waveform DC, this func‐
2326 tion ignores the Amplitude, Frequency, and Start Phase param‐
2327 eters and does not set the Amplitude, Frequency, and Start
2328 Phase attributes.
2329
2330 outputs.standard_waveform.dc_offset
2331 Specifies the DC offset of the standard waveform the function
2332 generator produces. If the Waveform attribute is set to Wave‐
2333 form DC, this attribute specifies the DC level the function
2334 generator produces. The units are volts.
2335
2336 outputs.standard_waveform.duty_cycle_high
2337 Specifies the duty cycle for a square waveform. This
2338 attribute affects function generator behavior only when the
2339 Waveform attribute is set to Waveform Square. The value is
2340 expressed as a percentage.
2341
2342 outputs.standard_waveform.frequency
2343 Specifies the frequency of the standard waveform the function
2344 generator produces. When the Waveform attribute is set to
2345 Waveform DC, this attribute does not affect signal output.
2346 The units are Hertz.
2347
2348 outputs.standard_waveform.start_phase
2349 Specifies the start phase of the standard waveform the func‐
2350 tion generator produces. When the Waveform attribute is set
2351 to Waveform DC, this attribute does not affect signal output.
2352 The units are degrees.
2353
2354 outputs.standard_waveform.waveform
2355 Specifies which standard waveform the function generator pro‐
2356 duces.
2357
2358 Values for waveform:
2359
2360 · 'sine'
2361
2362 · 'square'
2363
2364 · 'triangle'
2365
2366 · 'ramp_up'
2367
2368 · 'ramp_down'
2369
2370 · 'dc'
2371
2372 ArbWfm class
2373 class ivi.fgen.ArbWfm(*args, **kwargs)
2374 Bases: ivi.ivi.IviContainer
2375
2376 Extension IVI methods for function generators that can produce
2377 arbitrary waveforms
2378
2379 arbitrary.sample_rate
2380 Specifies the sample rate of the arbitrary waveforms the
2381 function generator produces. The units are samples per sec‐
2382 ond.
2383
2384 arbitrary.waveform.clear
2385 Removes a previously created arbitrary waveform from the
2386 function generator's memory and invalidates the waveform's
2387 handle.
2388
2389 If the waveform cannot be cleared because it is currently
2390 being generated, or it is specified as part of an existing
2391 arbitrary waveform sequence, this function returns the Wave‐
2392 form In Use error.
2393
2394 arbitrary.waveform.configure
2395 Configures the attributes of the function generator that
2396 affect arbitrary waveform generation. These attributes are
2397 the arbitrary waveform handle, gain, and offset.
2398
2399 arbitrary.waveform.create
2400 Creates an arbitrary waveform from an array of data points.
2401 The function returns a handlethat identifies the waveform.
2402 You pass a waveform handle to the Handle parameter of the
2403 Configure Arbitrary Waveform function to produce that wave‐
2404 form.
2405
2406 arbitrary.waveform.number_waveforms_max
2407 Returns the maximum number of arbitrary waveforms that the
2408 function generator allows.
2409
2410 arbitrary.waveform.quantum
2411 The size of each arbitrary waveform shall be a multiple of a
2412 quantum value. This attribute returns the quantum value the
2413 function generator allows. For example, if this attribute
2414 returns a value of 8, all waveform sizes must be a multiple
2415 of 8.
2416
2417 arbitrary.waveform.size_max
2418 Returns the maximum number of points the function generator
2419 allows in an arbitrary waveform.
2420
2421 arbitrary.waveform.size_min
2422 Returns the minimum number of points the function generator
2423 allows in an arbitrary waveform.
2424
2425 outputs.arbitrary.configure
2426 Configures the attributes of the function generator that
2427 affect arbitrary waveform generation. These attributes are
2428 the arbitrary waveform handle, gain, and offset.
2429
2430 outputs.arbitrary.gain
2431 Specifies the gain of the arbitrary waveform the function
2432 generator produces. This value is unitless.
2433
2434 outputs.arbitrary.offset
2435 Specifies the offset of the arbitrary waveform the function
2436 generator produces. The units are volts.
2437
2438 outputs.arbitrary.waveform
2439
2440 ArbChannelWfm class
2441 class ivi.fgen.ArbChannelWfm(*args, **kwargs)
2442 Bases: ivi.ivi.IviContainer
2443
2444 Extension IVI methods for function generators that support
2445 user-defined arbitrary waveform generation
2446
2447 arbitrary.waveform.create_channel_waveform
2448 Creates a channel-specific arbitrary waveform and returns a
2449 handle that identifies that waveform. You pass a waveform
2450 handle as the waveformHandle parameter of the Configure Arbi‐
2451 trary Waveform function to produce that waveform. You also
2452 use the handles this function returns to create a sequence of
2453 arbitrary waveforms with the Create Arbitrary Sequence func‐
2454 tion.
2455
2456 If the instrument has multiple channels, it is possible to
2457 create multi-channel waveforms: the channel names are passed
2458 as a comma-separated list of channel names, and the waveform
2459 arrays are concatenated into a single array. In this case,
2460 all waveforms must be of the same length.
2461
2462 If the function generator cannot store any more arbitrary
2463 waveforms, this function returns the error No Waveforms
2464 Available.
2465
2466 outputs.arbitrary.create_waveform
2467 Creates a channel-specific arbitrary waveform and returns a
2468 handle that identifies that waveform. You pass a waveform
2469 handle as the waveformHandle parameter of the Configure Arbi‐
2470 trary Waveform function to produce that waveform. You also
2471 use the handles this function returns to create a sequence of
2472 arbitrary waveforms with the Create Arbitrary Sequence func‐
2473 tion.
2474
2475 If the instrument has multiple channels, it is possible to
2476 create multi-channel waveforms: the channel names are passed
2477 as a comma-separated list of channel names, and the waveform
2478 arrays are concatenated into a single array. In this case,
2479 all waveforms must be of the same length.
2480
2481 If the function generator cannot store any more arbitrary
2482 waveforms, this function returns the error No Waveforms
2483 Available.
2484
2485 ArbWfmBinary class
2486 class ivi.fgen.ArbWfmBinary(*args, **kwargs)
2487 Bases: ivi.ivi.IviContainer
2488
2489 Extension IVI methods for function generators that support
2490 user-defined arbitrary binary waveform generation
2491
2492 arbitrary.binary_alignment
2493 Identifies whether the arbitrary waveform generator treats
2494 binary data provided to the Create Channel Arbitrary Waveform
2495 Int16 or Create Channel Arbitrary Waveform Int32 functions as
2496 left-justified or right-justified. Binary Alignment is only
2497 relevant if the generator supports bit-depths less than the
2498 size of the binarydata type of the create waveform function
2499 being used. For a 16-bit or a 32-bit generator, this function
2500 can return either value.
2501
2502 arbitrary.sample_bit_resolution
2503 Returns the number of significant bits that the generator
2504 supports in an arbitrary waveform. Together with the binary
2505 alignment, this allows the user to know the range and resolu‐
2506 tion of the integers in the waveform.
2507
2508 arbitrary.waveform.create_channel_waveform_int16
2509 Creates a channel-specific arbitrary waveform and returns a
2510 handle that identifies that waveform. Data is passed in as
2511 16-bit binary data. If the arbitrary waveform generator sup‐
2512 ports formats less than 16 bits, call the BinaryAlignment
2513 property to determine whether to left or right justify the
2514 data before passing it to this call. You pass a waveform han‐
2515 dle as the waveformHandle parameter of the Configure Arbi‐
2516 trary Waveform function to produce that waveform. You also
2517 use the handles this function returns to create a sequence of
2518 arbitrary waveforms with the Create Arbitrary Sequence func‐
2519 tion.
2520
2521 If the instrument has multiple channels, it is possible to
2522 create multi-channel waveforms: the channel names are passed
2523 as a comma-separated list of channel names, and the waveform
2524 arrays are concatenated into a single array. In this case,
2525 all waveforms must be of the same length.
2526
2527 If the function generator cannot store any more arbitrary
2528 waveforms, this function returns the error No Waveforms
2529 Available.
2530
2531 arbitrary.waveform.create_channel_waveform_int32
2532 Creates a channel-specific arbitrary waveform and returns a
2533 handle that identifies that waveform. Data is passed in as
2534 32-bit binary data. If the arbitrary waveform generator sup‐
2535 ports formats less than 32 bits, call the BinaryAlignment
2536 property to determine whether to left or right justify the
2537 data before passing it to this call. You pass a waveform han‐
2538 dle as the waveformHandle parameter of the Configure Arbi‐
2539 trary Waveform function to produce that waveform. You also
2540 use the handles this function returns to create a sequence of
2541 arbitrary waveforms with the Create Arbitrary Sequence func‐
2542 tion.
2543
2544 If the instrument has multiple channels, it is possible to
2545 create multi-channel waveforms: the channel names are passed
2546 as a comma-separated list of channel names, and the waveform
2547 arrays are concatenated into a single array. In this case,
2548 all waveforms must be of the same length.
2549
2550 If the function generator cannot store any more arbitrary
2551 waveforms, this function returns the error No Waveforms
2552 Available.
2553
2554 outputs.arbitrary.waveform.create_channel_waveform_int16
2555 Creates a channel-specific arbitrary waveform and returns a
2556 handle that identifies that waveform. Data is passed in as
2557 16-bit binary data. If the arbitrary waveform generator sup‐
2558 ports formats less than 16 bits, call the BinaryAlignment
2559 property to determine whether to left or right justify the
2560 data before passing it to this call. You pass a waveform han‐
2561 dle as the waveformHandle parameter of the Configure Arbi‐
2562 trary Waveform function to produce that waveform. You also
2563 use the handles this function returns to create a sequence of
2564 arbitrary waveforms with the Create Arbitrary Sequence func‐
2565 tion.
2566
2567 If the instrument has multiple channels, it is possible to
2568 create multi-channel waveforms: the channel names are passed
2569 as a comma-separated list of channel names, and the waveform
2570 arrays are concatenated into a single array. In this case,
2571 all waveforms must be of the same length.
2572
2573 If the function generator cannot store any more arbitrary
2574 waveforms, this function returns the error No Waveforms
2575 Available.
2576
2577 outputs.arbitrary.waveform.create_channel_waveform_int32
2578 Creates a channel-specific arbitrary waveform and returns a
2579 handle that identifies that waveform. Data is passed in as
2580 32-bit binary data. If the arbitrary waveform generator sup‐
2581 ports formats less than 32 bits, call the BinaryAlignment
2582 property to determine whether to left or right justify the
2583 data before passing it to this call. You pass a waveform han‐
2584 dle as the waveformHandle parameter of the Configure Arbi‐
2585 trary Waveform function to produce that waveform. You also
2586 use the handles this function returns to create a sequence of
2587 arbitrary waveforms with the Create Arbitrary Sequence func‐
2588 tion.
2589
2590 If the instrument has multiple channels, it is possible to
2591 create multi-channel waveforms: the channel names are passed
2592 as a comma-separated list of channel names, and the waveform
2593 arrays are concatenated into a single array. In this case,
2594 all waveforms must be of the same length.
2595
2596 If the function generator cannot store any more arbitrary
2597 waveforms, this function returns the error No Waveforms
2598 Available.
2599
2600 DataMarker class
2601 class ivi.fgen.DataMarker(*args, **kwargs)
2602 Bases: ivi.ivi.IviContainer
2603
2604 Extension IVI methods for function generators that support out‐
2605 put of particular waveform data bits as markers
2606
2607 data_markers.amplitude
2608 Specifies the amplitude of the data marker output. The units
2609 are volts.
2610
2611 data_markers.bit_position
2612 Specifies the bit position of the binary representation of
2613 the waveform data that will be output as a data marker. A
2614 value of 0 indicates the least significant bit.
2615
2616 data_markers.clear
2617 Disables all of the data markers by setting their Data Marker
2618 Destination attribute to None.
2619
2620 data_markers.configure
2621 Configures some of the common data marker attributes.
2622
2623 data_markers.delay
2624 Specifies the amount of delay applied to the data marker out‐
2625 put with respect to the analog data output. A value of zero
2626 indicates the marker is aligned with the analog data output.
2627 The units are seconds.
2628
2629 data_markers.destination
2630 Specifies the destination terminal for the data marker out‐
2631 put.
2632
2633 data_markers.name
2634 This attribute returns the repeated capability identifier
2635 defined by specific driver for the data marker that corre‐
2636 sponds to the index that the user specifies. If the driver
2637 defines a qualified Data Marker name, this property returns
2638 the qualified name.
2639
2640 If the value that the user passes for the Index parameter is
2641 less than zero or greater than the value of the Data Marker
2642 Count, the attribute returns an empty string for the value
2643 and returns an error.
2644
2645 data_markers.polarity
2646 Specifies the polarity of the data marker output.
2647
2648 Values for polarity:
2649
2650 · 'active_high'
2651
2652 · 'active_low'
2653
2654 data_markers.source_channel
2655 Specifies the channel whose data bit will be output as a
2656 marker.
2657
2658 SparseMarker class
2659 class ivi.fgen.SparseMarker(*args, **kwargs)
2660 Bases: ivi.ivi.IviContainer
2661
2662 Extension IVI methods for function generators that support out‐
2663 put of markers associated with output data samples
2664
2665 sparse_markers.amplitude
2666 Specifies the amplitude of the sparse marker output. The
2667 units are volts.
2668
2669 sparse_markers.clear
2670 Disables all of the sparse markers by setting their Sparse
2671 Marker Destination attribute to None.
2672
2673 sparse_markers.configure
2674 Configures some of the common sparse marker attributes.
2675
2676 sparse_markers.delay
2677 Specifies the amount of delay applied to the sparse marker
2678 output with respect to the analog data output. A value of
2679 zero indicates the marker is aligned with the analog data
2680 output. The units are seconds.
2681
2682 sparse_markers.destination
2683 Specifies the destination terminal for the sparse marker out‐
2684 put.
2685
2686 sparse_markers.get_indexes
2687 Gets the coerced indexes associated with the sparse marker.
2688 These indexes are specified by either the Configure Sparse‐
2689 Marker function or the Set Sparse Marker Indexes function.
2690
2691 sparse_markers.name
2692 This attribute returns the repeated capability identifier
2693 defined by specific driver for the sparse marker that corre‐
2694 sponds to the index that the user specifies. If the driver
2695 defines a qualified Sparse Marker name, this property returns
2696 the qualified name.
2697
2698 If the value that the user passes for the Index parameter is
2699 less than one or greater than the value of the Sparse Marker
2700 Count, the attribute returns an empty string for the value
2701 and returns an error.
2702
2703 sparse_markers.polarity
2704 Specifies the polarity of the sparse marker output.
2705
2706 Values for polarity:
2707
2708 · 'active_high'
2709
2710 · 'active_low'
2711
2712 sparse_markers.set_indexes
2713 Sets the indexes associated with the sparse marker. These
2714 indexes may be coerced by the driver. Use the Get Sparse
2715 Marker Indexes function to find the coerced values.
2716
2717 sparse_markers.waveform_handle
2718 Specifies the waveform whose indexes the sparse marker refers
2719 to.
2720
2721 ArbDataMask class
2722 class ivi.fgen.ArbDataMask(*args, **kwargs)
2723 Bases: ivi.ivi.IviContainer
2724
2725 Extension IVI methods for function generators that support mask‐
2726 ing of waveform data bits
2727
2728 arbitrary.data_mask
2729 Determines which bits of the output data are masked out. This
2730 is especially useful when combined with Data Markers so that
2731 the bits embedded with the data to be used for markers are
2732 not actually output by the generator.
2733
2734 A value of 1 for a particular bit indicates that the data bit
2735 should be output. A value of 0 indicates that the data bit
2736 should be masked out. For example, if the value of this prop‐
2737 erty is 0xFFFFFFFF (all bits are 1), no masking is applied.
2738
2739 ArbFrequency class
2740 class ivi.fgen.ArbFrequency(*args, **kwargs)
2741 Bases: ivi.ivi.IviContainer
2742
2743 Extension IVI methods for function generators that can produce
2744 arbitrary waveforms with variable rate
2745
2746 outputs.arbitrary.frequency
2747 Specifies the rate in Hertz at which an entire arbitrary
2748 waveform is generated.
2749
2750 ArbSeq class
2751 class ivi.fgen.ArbSeq(*args, **kwargs)
2752 Bases: ivi.ivi.IviContainer
2753
2754 Extension IVI methods for function generators that can produce
2755 sequences of arbitrary waveforms
2756
2757 arbitrary.clear_memory
2758 Removes all previously created arbitrary waveforms and
2759 sequences from the function generator's memory and invali‐
2760 dates all waveform and sequence handles.
2761
2762 If a waveform cannot be cleared because it is currently being
2763 generated, this function returns the error Waveform In Use.
2764
2765 If a sequence cannot be cleared because it is currently being
2766 generated, this function returns the error Sequence In Use.
2767
2768 arbitrary.sequence.clear
2769 Removes a previously created arbitrary sequence from the
2770 function generator's memory and invalidates the sequence's
2771 handle.
2772
2773 If the sequence cannot be cleared because it is currently
2774 being generated, this function returns the error Sequence In
2775 Use.
2776
2777 arbitrary.sequence.configure
2778 Configures the attributes of the function generator that
2779 affect arbitrary sequence generation. These attributes are
2780 the arbitrary sequence handle, gain, and offset.
2781
2782 arbitrary.sequence.create
2783 Creates an arbitrary waveform sequence from an array of wave‐
2784 form handles and a corresponding array of loop counts. The
2785 function returns a handle that identifies the sequence. You
2786 pass a sequence handle to the Handle parameter of the Config‐
2787 ure Arbitrary Sequence function to produce that sequence.
2788
2789 If the function generator cannot store any more arbitrary
2790 sequences, this function returns the error No Sequences
2791 Available.
2792
2793 arbitrary.sequence.length_max
2794 Returns the maximum number of arbitrary waveforms that the
2795 function generator allows in an arbitrary sequence.
2796
2797 arbitrary.sequence.length_min
2798 Returns the minimum number of arbitrary waveforms that the
2799 function generator allows in an arbitrary sequence.
2800
2801 arbitrary.sequence.loop_count_max
2802 Returns the maximum number of times that the function genera‐
2803 tor can repeat a waveform in a sequence.
2804
2805 arbitrary.sequence.number_sequences_max
2806 Returns the maximum number of arbitrary sequences that the
2807 function generator allows.
2808
2809 outputs.arbitrary.sequence.configure
2810 Configures the attributes of the function generator that
2811 affect arbitrary sequence generation. These attributes are
2812 the arbitrary sequence handle, gain, and offset.
2813
2814 ArbSeqDepth class
2815 class ivi.fgen.ArbSeqDepth(*args, **kwargs)
2816 Bases: ivi.ivi.IviContainer
2817
2818 Extension IVI methods for function generators that support pro‐
2819 ducing sequences of sequences of waveforms
2820
2821 arbitrary.sequence.depth_max
2822 Returns the maximum sequence depth - that is, the number of
2823 times a sequence can include other sequences recursively. A
2824 depth of zero indicates the generator supports waveforms
2825 only. A depth of 1 indicates a generator supports sequences
2826 of waveforms, but not sequences of sequences. A depth of 2
2827 or greater indicates that the generator supports sequences of
2828 sequences. Note that if the MaxSequenceDepth is 2 or greater,
2829 the driver must return unique handles for waveforms and
2830 sequences so that a sequence may contain both waveform and
2831 sequence handles.
2832
2833 Trigger class
2834 class ivi.fgen.Trigger(*args, **kwargs)
2835 Bases: ivi.ivi.IviContainer
2836
2837 Extension IVI methods for function generators that support trig‐
2838 gering
2839
2840 outputs.trigger.source
2841 Specifies the trigger source. After the function generator
2842 receives a trigger from this source, it produces a signal.
2843
2844 InternalTrigger class
2845 class ivi.fgen.InternalTrigger(*args, **kwargs)
2846 Bases: ivi.ivi.IviContainer
2847
2848 Extension IVI methods for function generators that support
2849 internal triggering
2850
2851 trigger.internal_rate
2852 Specifies the rate at which the function generator's internal
2853 trigger source produces a trigger, in triggers per second.
2854
2855 SoftwareTrigger class
2856 class ivi.fgen.SoftwareTrigger(*args, **kwargs)
2857 Bases: ivi.ivi.IviContainer
2858
2859 Extension IVI methods for function generators that support soft‐
2860 ware triggering
2861
2862 ivi.fgen.send_software_trigger
2863 This function sends a software-generated trigger to the
2864 instrument. It is only applicable for instruments using
2865 interfaces or protocols which support an explicit trigger
2866 function. For example, with GPIB this function could send a
2867 group execute trigger to the instrument. Other implementa‐
2868 tions might send a *TRG command.
2869
2870 Since instruments interpret a software-generated trigger in a
2871 wide variety of ways, the precise response of the instrument
2872 to this trigger is not defined. Note that SCPI details a pos‐
2873 sible implementation.
2874
2875 This function should not use resources which are potentially
2876 shared by other devices (for example, the VXI trigger lines).
2877 Use of such shared resources may have undesirable effects on
2878 other devices.
2879
2880 This function should not check the instrument status. Typi‐
2881 cally, the end-user calls this function only in a sequence of
2882 calls to other low-level driver functions. The sequence per‐
2883 forms one operation. The end-user uses the low-level func‐
2884 tions to optimize one or more aspects of interaction with the
2885 instrument. To check the instrument status, call the appro‐
2886 priate error query function at the conclusion of the
2887 sequence.
2888
2889 The trigger source attribute must accept Software Trigger as
2890 a valid setting for this function to work. If the trigger
2891 source is not set to Software Trigger, this function does
2892 nothing and returns the error Trigger Not Software.
2893
2894 Burst class
2895 class ivi.fgen.Burst(*args, **kwargs)
2896 Bases: ivi.ivi.IviContainer
2897
2898 Extension IVI methods for function generators that support trig‐
2899 gered burst output
2900
2901 outputs.burst_count
2902 Specifies the number of waveform cycles that the function
2903 generator produces after it receives a trigger.
2904
2905 ModulateAM class
2906 class ivi.fgen.ModulateAM(*args, **kwargs)
2907 Bases: ivi.ivi.IviContainer
2908
2909 Extension IVI methods for function generators that support
2910 amplitude modulation
2911
2912 am.configure_internal
2913 Configures the attributes that control the function genera‐
2914 tor's internal amplitude modulating waveform source. These
2915 attributes are the modulation depth, waveform, and frequency.
2916
2917 am.internal_depth
2918 Specifies the extent of modulation the function generator
2919 applies to the carrier waveform when the AM Source attribute
2920 is set to AM Internal. The unit is percentage.
2921
2922 This attribute affects the behavior of the instrument only
2923 when the AM ource attribute is set to AM Internal.
2924
2925 am.internal_frequency
2926 Specifies the frequency of the internal modulating waveform
2927 source. The units are Hertz.
2928
2929 This attribute affects the behavior of the instrument only
2930 when the AM ource attribute is set to AM Internal.
2931
2932 am.internal_waveform
2933 Specifies the waveform of the internal modulating waveform
2934 source.
2935
2936 This attribute affects the behavior of the instrument only
2937 when the AM ource attribute is set to AM Internal.
2938
2939 Values for internal_waveform:
2940
2941 · 'sine'
2942
2943 · 'square'
2944
2945 · 'triangle'
2946
2947 · 'ramp_up'
2948
2949 · 'ramp_down'
2950
2951 · 'dc'
2952
2953 outputs.am.enabled
2954 Specifies whether the function generator applies amplitude
2955 modulation to the signal that the function generator produces
2956 with the IviFgenStdFunc, IviFgenArbWfm, or IviFgenArbSeq
2957 capability groups. If set to True, the function generator
2958 applies amplitude modulation to the output signal. If set to
2959 False, the function generator does not apply amplitude modu‐
2960 lation to the output signal.
2961
2962 outputs.am.source
2963 Specifies the source of the signal that the function genera‐
2964 tor uses as the modulating waveform.
2965
2966 This attribute affects instrument behavior only when the AM
2967 Enabled attribute is set to True.
2968
2969 ModulateFM class
2970 class ivi.fgen.ModulateFM(*args, **kwargs)
2971 Bases: ivi.ivi.IviContainer
2972
2973 Extension IVI methods for function generators that support fre‐
2974 quency modulation
2975
2976 fm.configure_internal
2977 Specifies the source of the signal that the function genera‐
2978 tor uses as the modulating waveform.
2979
2980 This attribute affects instrument behavior only when the FM
2981 Enabled attribute is set to True.
2982
2983 fm.internal_deviation
2984 Specifies the maximum frequency deviation, in Hertz, that the
2985 function generator applies to the carrier waveform when the
2986 FM Source attribute is set to FM Internal.
2987
2988 This attribute affects the behavior of the instrument only
2989 when the FM Source attribute is set to FM Internal.
2990
2991 fm.internal_frequency
2992 Specifies the frequency of the internal modulating waveform
2993 source. The units are hertz.
2994
2995 This attribute affects the behavior of the instrument only
2996 when the FM Source attribute is set to FM Internal.
2997
2998 fm.internal_waveform
2999 Specifies the waveform of the internal modulating waveform
3000 source.
3001
3002 This attribute affects the behavior of the instrument only
3003 when the FM Source attribute is set to FM Internal.
3004
3005 Values for internal_waveform:
3006
3007 · 'sine'
3008
3009 · 'square'
3010
3011 · 'triangle'
3012
3013 · 'ramp_up'
3014
3015 · 'ramp_down'
3016
3017 · 'dc'
3018
3019 outputs.fm.enabled
3020 Specifies whether the function generator applies amplitude
3021 modulation to the carrier waveform. If set to True, the func‐
3022 tion generator applies frequency modulation to the output
3023 signal. If set to False, the function generator does not
3024 apply frequency modulation to the output signal.
3025
3026 outputs.fm.source
3027
3028 SampleClock class
3029 class ivi.fgen.SampleClock(*args, **kwargs)
3030 Bases: ivi.ivi.IviContainer
3031
3032 Extension IVI methods for function generators that support
3033 external sample clocks
3034
3035 sample_clock.output_enabled
3036 Specifies whether or not the sample clock appears at the sam‐
3037 ple clock output of the generator.
3038
3039 sample_clock.source
3040 Specifies the clock used for the waveform generation. Note
3041 that when using an external sample clock, the Arbitrary Sam‐
3042 ple Rate attribute must be set to the corresponding frequency
3043 of the external sample clock.
3044
3045 TerminalConfiguration class
3046 class ivi.fgen.TerminalConfiguration(*args, **kwargs)
3047 Bases: ivi.ivi.IviContainer
3048
3049 Extension IVI methods for function generators that support sin‐
3050 gle ended or differential output selection
3051
3052 outputs.terminal_configuration
3053 Determines whether the generator will run in single-ended or
3054 differential mode, and whether the output gain and offset
3055 values will be analyzed based on single-ended or differential
3056 operation.
3057
3058 Values for terminal_configuration:
3059
3060 · 'single_ended'
3061
3062 · 'differential'
3063
3064 StartTrigger class
3065 class ivi.fgen.StartTrigger(*args, **kwargs)
3066 Bases: ivi.ivi.IviContainer
3067
3068 Extension IVI methods for function generators that support start
3069 triggering
3070
3071 outputs.trigger.start.configure
3072 This function configures the start trigger properties.
3073
3074 outputs.trigger.start.delay
3075 Specifies an additional length of time to delay from the
3076 start trigger to the first point in the waveform generation.
3077 The units are seconds.
3078
3079 outputs.trigger.start.slope
3080 Specifies the slope of the trigger that starts the generator.
3081
3082 Values for slope:
3083
3084 · 'positive'
3085
3086 · 'negative'
3087
3088 · 'either'
3089
3090 outputs.trigger.start.source
3091 Specifies the source of the start trigger.
3092
3093 outputs.trigger.start.threshold
3094 Specifies the voltage threshold for the start trigger. The
3095 units are volts.
3096
3097 trigger.start.configure
3098 This function configures the start trigger properties.
3099
3100 trigger.start.send_software_trigger
3101 This function sends a software-generated start trigger to the
3102 instrument.
3103
3104 StopTrigger class
3105 class ivi.fgen.StopTrigger(*args, **kwargs)
3106 Bases: ivi.ivi.IviContainer
3107
3108 Extension IVI methods for function generators that support stop
3109 triggering
3110
3111 ERROR:
3112 Unable to execute python code at fgen.rst:1194:
3113
3114 _add_method() takes at most 4 arguments (5 given)
3115
3116 HoldTrigger class
3117 class ivi.fgen.HoldTrigger(*args, **kwargs)
3118 Bases: ivi.ivi.IviContainer
3119
3120 Extension IVI methods for function generators that support hold
3121 triggering
3122
3123 outputs.trigger.hold.configure
3124 This function configures the hold trigger properties.
3125
3126 outputs.trigger.hold.delay
3127 Specifies an additional length of time to delay from the hold
3128 trigger to the pause of the generation. The units are sec‐
3129 onds.
3130
3131 outputs.trigger.hold.slope
3132 Specifies the slope of the hold trigger.
3133
3134 Values for slope:
3135
3136 · 'positive'
3137
3138 · 'negative'
3139
3140 · 'either'
3141
3142 outputs.trigger.hold.source
3143 Specifies the source of the hold trigger.
3144
3145 outputs.trigger.hold.threshold
3146 Specifies the voltage threshold for the hold trigger. The
3147 units are volts.
3148
3149 trigger.hold.configure
3150 This function configures the hold trigger properties.
3151
3152 trigger.hold.send_software_trigger
3153 This function sends a software-generated hold trigger to the
3154 instrument.
3155
3156 ResumeTrigger class
3157 class ivi.fgen.ResumeTrigger(*args, **kwargs)
3158 Bases: ivi.ivi.IviContainer
3159
3160 Extension IVI methods for function generators that support
3161 resume triggering
3162
3163 outputs.trigger.resume.configure
3164 This function configures the resume trigger properties.
3165
3166 outputs.trigger.resume.delay
3167 Specifies an additional length of time to delay from the
3168 resume trigger to the resumption of the generation. The units
3169 are seconds.
3170
3171 outputs.trigger.resume.slope
3172 Specifies the slope of the resume trigger.
3173
3174 Values for slope:
3175
3176 · 'positive'
3177
3178 · 'negative'
3179
3180 · 'either'
3181
3182 outputs.trigger.resume.source
3183 Specifies the source of the resume trigger.
3184
3185 outputs.trigger.resume.threshold
3186 Specifies the voltage threshold for the resume trigger. The
3187 units are volts.
3188
3189 trigger.resume.configure
3190 This function configures the resume trigger properties.
3191
3192 trigger.resume.send_software_trigger
3193 This function sends a software-generated resume trigger to
3194 the instrument.
3195
3196 AdvanceTrigger class
3197 class ivi.fgen.AdvanceTrigger(*args, **kwargs)
3198 Bases: ivi.ivi.IviContainer
3199
3200 Extension IVI methods for function generators that support
3201 advance triggering
3202
3203 outputs.trigger.advance.configure
3204 This function configures the advance trigger properties.
3205
3206 outputs.trigger.advance.delay
3207 Specifies an additional length of time to delay from the
3208 advance trigger to the advancing to the end of the current
3209 waveform. Units are seconds.
3210
3211 outputs.trigger.advance.slope
3212 Specifies the slope of the advance trigger.
3213
3214 Values for slope:
3215
3216 · 'positive'
3217
3218 · 'negative'
3219
3220 · 'either'
3221
3222 outputs.trigger.advance.source
3223 Specifies the source of the advance trigger.
3224
3225 outputs.trigger.advance.threshold
3226 Specifies the voltage threshold for the advance trigger. The
3227 units are volts.
3228
3229 trigger.advance.configure
3230 This function configures the advance trigger properties.
3231
3232 trigger.advance.send_software_trigger
3233 This function sends a software-generated advance trigger to
3234 the instrument.
3235
3237 This module provides the base functionality for DC power supplies.
3238
3239 Functions and Exceptions
3240 exception ivi.dcpwr.IviException
3241 Exception raised on various occasions; argument is a string
3242 describing what is wrong.
3243
3244 Base class
3245 class ivi.dcpwr.Base(*args, **kwargs)
3246 Bases: ivi.ivi.IviContainer
3247
3248 Base IVI methods for all DC power supplies
3249
3250 outputs[].configure_current_limit
3251 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.3.1
3252
3253 This function configures the current limit. It specifies the
3254 output current limit value and the behavior of the power supply
3255 when the output current is greater than or equal to that value.
3256
3257 See the definition of the Current Limit Behavior attribute for
3258 defined values for the behavior parameter.
3259
3260 outputs[].configure_ovp
3261 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.3.4
3262
3263 Configures the over-voltage protection. It specifies the
3264 over-voltage limit and the behavior of the power supply when the
3265 output voltage is greater than or equal to that value.
3266
3267 When the Enabled parameter is False, the Limit parameter does
3268 not affect the instrument's behavior, and the driver does not
3269 set the OVP Limit attribute.
3270
3271 outputs[].configure_range
3272 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.3.3
3273
3274 Configures the power supply's output range on an output. One
3275 parameter specifies whether to configure the voltage or current
3276 range, and the other parameter is the value to which to set the
3277 range.
3278
3279 Setting a voltage range can invalidate a previously configured
3280 current range. Setting a current range can invalidate a previ‐
3281 ously configured voltage range.
3282
3283 outputs[].current_limit
3284 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.1
3285
3286 Specifies the output current limit. The units are Amps.
3287
3288 The value of the Current Limit Behavior attribute determines the
3289 behavior of the power supply when the output current is equal to
3290 or greater than the value of this attribute.
3291
3292 outputs[].current_limit_behavior
3293 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.2
3294
3295 Specifies the behavior of the power supply when the output cur‐
3296 rent is equal to or greater than the value of the Current Limit
3297 attribute.
3298
3299 Values
3300
3301 · 'trip' - The power supply disables the output when the output
3302 current is equal to or greater than the value of the Current
3303 Limit attribute.
3304
3305 · 'regulate' - The power supply restricts the output voltage
3306 such that the output current is not greater than the value of
3307 the Current Limit attribute.
3308
3309 outputs[].enabled
3310 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.3
3311
3312 If true, the signal the power supply produces appears at the
3313 output connector. If false, the signal the power supply produces
3314 does not appear at the output connector.
3315
3316 outputs[].name
3317 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.9
3318
3319 This attribute returns the repeated capability identifier
3320 defined by specific driver for the output channel that corre‐
3321 sponds to the index that the user specifies. If the driver
3322 defines a qualified Output Channel name, this property returns
3323 the qualified name.
3324
3325 If the value that the user passes for the Index parameter is
3326 less than zero or greater than the value of the Output Channel
3327 Count, the attribute raises a SelectorRangeException.
3328
3329 outputs[].ovp_enabled
3330 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.4
3331
3332 Specifies whether the power supply provides over-voltage protec‐
3333 tion. If this attribute is set to True, the power supply dis‐
3334 ables the output when the output voltage is greater than or
3335 equal to the value of the OVP Limit attribute.
3336
3337 outputs[].ovp_limit
3338 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.5
3339
3340 Specifies the voltage the power supply allows. The units are
3341 Volts.
3342
3343 If the OVP Enabled attribute is set to True, the power supply
3344 disables the output when the output voltage is greater than or
3345 equal to the value of this attribute.
3346
3347 If the OVP Enabled is set to False, this attribute does not
3348 affect the behavior of the instrument.
3349
3350 outputs[].query_current_limit_max
3351 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.3.7
3352
3353 This function returns the maximum programmable current limit
3354 that the power supply accepts for a particular voltage level on
3355 an output.
3356
3357 outputs[].query_output_state
3358 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.3.9
3359
3360 This function returns whether the power supply is in a particu‐
3361 lar output state.
3362
3363 A constant voltage condition occurs when the output voltage is
3364 equal to the value of the Voltage Level attribute and the cur‐
3365 rent is less than or equal to the value of the Current Limit
3366 attribute.
3367
3368 A constant current condition occurs when the output current is
3369 equal to the value of the Current Limit attribute and the Cur‐
3370 rent Limit Behavior attribute is set to the Current Regulate
3371 defined value.
3372
3373 An unregulated condition occurs when the output voltage is less
3374 than the value of the Voltage Level attribute and the current is
3375 less than the value of the Current Limit attribute.
3376
3377 An over-voltage condition occurs when the output voltage is
3378 equal to or greater than the value of the OVP Limit attribute
3379 and the OVP Enabled attribute is set to True.
3380
3381 An over-current condition occurs when the output current is
3382 equal to or greater than the value of the Current Limit
3383 attribute and the Current Limit Behavior attribute is set to the
3384 Current Trip defined value.
3385
3386 When either an over-voltage condition or an over-current condi‐
3387 tion occurs, the power supply's output protection disables the
3388 output. If the power supply is in an over-voltage or over-cur‐
3389 rent state, it does not produce power until the output protec‐
3390 tion is reset. The Reset Output Protection function resets the
3391 output protection. Once the output protection is reset, the
3392 power supply resumes generating a power signal.
3393
3394 Values for output_state:
3395
3396 · 'constant_voltage'
3397
3398 · 'constant_current'
3399
3400 · 'over_voltage'
3401
3402 · 'over_current'
3403
3404 · 'unregulated'
3405
3406 outputs[].query_voltage_level_max
3407 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.3.8
3408
3409 This function returns the maximum programmable voltage level
3410 that the power supply accepts for a particular current limit on
3411 an output.
3412
3413 outputs[].reset_output_protection
3414 IVI class IviDCPwr, capability group IviDCPwrBase, section
3415 4.3.10
3416
3417 This function resets the power supply output protection after an
3418 over-voltage or over-current condition occurs.
3419
3420 An over-voltage condition occurs when the output voltage is
3421 equal to or greater than the value of the OVP Limit attribute
3422 and the OVP Enabled attribute is set to True.
3423
3424 An over-current condition occurs when the output current is
3425 equal to or greater than the value of the Current Limit
3426 attribute and the Current Limit Behavior attribute is set to
3427 Current Trip.
3428
3429 When either an over-voltage condition or an over-current condi‐
3430 tion occurs, the output protection of the power supply disables
3431 the output. Once the output protection is reset, the power sup‐
3432 ply resumes generating a power signal.
3433
3434 Use the Query Output State function to determine if the power
3435 supply is in an over-voltage or over-current state.
3436
3437 outputs[].voltage_level
3438 IVI class IviDCPwr, capability group IviDCPwrBase, section 4.2.6
3439
3440 Specifies the voltage level the DC power supply attempts to gen‐
3441 erate. The units are Volts.
3442
3443 Trigger class
3444 class ivi.dcpwr.Trigger(*args, **kwargs)
3445 Bases: ivi.ivi.IviContainer
3446
3447 Extension IVI methods for power supplies supporting trigger
3448 based output changes
3449
3450 outputs[].trigger_source
3451 IVI class IviDCPwr, capability group IviDCPwrTrigger, section
3452 5.2.1
3453
3454 Specifies the trigger source. After an Initiate call, the power
3455 supply waits for a trigger event from the source specified with
3456 this attribute. After a trigger event occurs, the power supply
3457 changes the voltage level to the value of the Triggered Voltage
3458 Level attribute and the current limit to the value of the Trig‐
3459 gered Current Limit attribute.
3460
3461 outputs[].triggered_current_limit
3462 IVI class IviDCPwr, capability group IviDCPwrTrigger, section
3463 5.2.2
3464
3465 Specifies the value to which the power supply sets the current
3466 limit after a trigger event occurs. The units are Amps.
3467
3468 After an Initiate call, the power supply waits for a trigger
3469 event from the source specified with the Trigger Source
3470 attribute. After a trigger event occurs, the power supply sets
3471 the current limit to the value of this attribute.
3472
3473 After a trigger occurs, the value of the Current Limit attribute
3474 reflects the new value to which the current limit has been set.
3475
3476 outputs[].triggered_voltage_level
3477 IVI class IviDCPwr, capability group IviDCPwrTrigger, section
3478 5.2.3
3479
3480 Specifies the value to which the power supply sets the voltage
3481 level after a trigger event occurs. The units are Volts.
3482
3483 After an Initiate call, the power supply waits for a trigger
3484 event from the source specified with the Trigger Source
3485 attribute. After a trigger event occurs, the power supply sets
3486 the voltage level to the value of this attribute.
3487
3488 After a trigger occurs, the value of the Voltage Level attribute
3489 reflects the new value to which the voltage level has been set.
3490
3491 trigger.abort
3492 IVI class IviDCPwr, capability group IviDCPwrTrigger, section
3493 5.3.1
3494
3495 If the power supply is currently waiting for a trigger to change
3496 the output signal, this function returns the power supply to the
3497 ignore triggers state.
3498
3499 If the power supply is not waiting for a trigger, this function
3500 does nothing and returns Success.
3501
3502 trigger.initiate
3503 IVI class IviDCPwr, capability group IviDCPwrTrigger, section
3504 5.3.5
3505
3506 If the power supply is not currently waiting for a trigger, this
3507 function causes the power supply to wait for a trigger.
3508
3509 If the power supply is already waiting for a trigger, this func‐
3510 tion does nothing and returns Success.
3511
3512 SoftwareTrigger class
3513 class ivi.dcpwr.SoftwareTrigger(*args, **kwargs)
3514 Bases: ivi.ivi.IviContainer
3515
3516 Extension IVI methods for power supplies supporting software
3517 triggering
3518
3519 ivi.dcpwr.send_software_trigger
3520 IVI class IviDCPwr, capability group IviDCPwrSoftwareTrigger,
3521 section 6.2.1
3522
3523 This function sends a software-generated trigger to the instru‐
3524 ment. It is only applicable for instruments using interfaces or
3525 protocols which support an explicit trigger function. For exam‐
3526 ple, with GPIB this function could send a group execute trigger
3527 to the instrument. Other implementations might send a *TRG com‐
3528 mand.
3529
3530 Since instruments interpret a software-generated trigger in a
3531 wide variety of ways, the precise response of the instrument to
3532 this trigger is not defined. Note that SCPI details a possible
3533 implementation.
3534
3535 This function should not use resources which are potentially
3536 shared by other devices (for example, the VXI trigger lines).
3537 Use of such shared resources may have undesirable effects on
3538 other devices.
3539
3540 This function should not check the instrument status. Typically,
3541 the end-user calls this function only in a sequence of calls to
3542 other low-level driver functions. The sequence performs one
3543 operation. The end-user uses the low-level functions to optimize
3544 one or more aspects of interaction with the instrument. To check
3545 the instrument status, call the appropriate error query function
3546 at the conclusion of the sequence.
3547
3548 The trigger source attribute must accept Software Trigger as a
3549 valid setting for this function to work. If the trigger source
3550 is not set to Software Trigger, this function does nothing and
3551 returns the error Trigger Not Software.
3552
3553 Measurement class
3554 class ivi.dcpwr.Measurement(*args, **kwargs)
3555 Bases: ivi.ivi.IviContainer
3556
3557 Extension IVI methods for power supplies supporting measurement
3558 of the output signal
3559
3560 outputs[].measure
3561 IVI class IviDCPwr, capability group IviDCPwrMeasurement, sec‐
3562 tion 7.2.1
3563
3564 Takes a measurement on the output signal and returns the mea‐
3565 sured value.
3566
3567 Values for measurement_type:
3568
3569 · 'voltage'
3570
3571 · 'current'
3572
3574 First, you're going to need to download the IVI specification for the
3575 type of instrument you have from the IVI foundation. This isn't com‐
3576 pletely necessary, but there is a lot of information in the spec about
3577 the specific functionality of various commands that isn't in the source
3578 code. I suppose this should probably be changed, but the spec is freely
3579 available so it isn't that big of an issue. You only need to download
3580 the spec for your type of device (IviFgen, IviScope, etc.). You're
3581 also going to need to download the programming guide for your instru‐
3582 ment, if you haven't already.
3583
3584 Now that you know what instrument class your instrument is, you should
3585 create a file for it in the proper subdirectory with the proper name.
3586 Note that supporting several instruments in the same line is pretty
3587 easy, just look at some of the other files for reference. I would
3588 highly recommend creating wrappers for all of the instruments in the
3589 series even if you don't have any on hand for testing. You also will
3590 need to add a line (or several lines) to __init__.py in the same direc‐
3591 tory so that the instrument files are loaded automatically with
3592 python-ivi and don't need to be loaded individually.
3593
3594 The structure of the individual driver files is quite simple. Take a
3595 look at the existing files for reference. Start by adding the header
3596 comment and license information. Then add the correct includes. At min‐
3597 imum, you will need to include ivi and the particular instrument class
3598 that you need from the parent directory (from .. include ivi). After
3599 that, you can specify any constants and/or mappings that the instrument
3600 requires. IVI specifies one set of standard configuration values for a
3601 lot of functions and this does not necessarily agree with the instru‐
3602 ment's firmware, so it's likely you will need to redefine several of
3603 these lists as mappings to make writing the code easier. This can be
3604 done incrementally while the driver functionality is being implemented.
3605
3606 Next, you need to add the class definition. The name should match the
3607 file name, and it will derive from ivi.Driver and the supported sub‐
3608 classes of your instrument. Go over the IVI spec and the programming
3609 guide and see what subclasses are supported by seeing which functions
3610 are supported by the instrument. There isn't always going to be a 1:1
3611 mapping - there will likely be functions that the instrument does not
3612 support but IVI has a wrapper for, and there will likely be functions
3613 that IVI does not have a wrapper for but the instrument does support
3614 that may be very useful. You should add a subclass if any portion of
3615 its functionality is supported by the instrument.
3616
3617 After that, you need to define the functions common to all IVI drivers.
3618 You can just copy everything from init to utility_unlock_object from an
3619 existing driver and then update everything for your instrument. Gener‐
3620 ally all this code will be very similar. Take a look at some of the
3621 existing drivers for reference. Very important: any super() calls must
3622 be updated so that the class name matches (requirement for Python 2).
3623 You should also remove all of the initialization in __init__ that you
3624 don't need - the bare minimum is _instrument_id and all of the _iden‐
3625 tity values. For some instruments, you're going to need to specify
3626 channel counts as well as an _init_channels or _init_outputs method.
3627 Note that if one of these methods is needed, it cannot be empty as it
3628 must at least have a call to super so that all of the proper init meth‐
3629 ods are called. At this point, you can test the connection to the
3630 equipment to make sure it is communicating and reading out the ID prop‐
3631 erly.
3632
3633 Testing you code is actually pretty straightforward; you don't need to
3634 re-install the library to test it; just make sure to instantiate it
3635 while you're running in the same directory as the ivi folder (not
3636 inside). I recommend ipython for testing. Unfortulatey, the auto reload
3637 doesn't work very well for python-ivi, so you'll need to restart
3638 ipython every time you change something. However, it supports history
3639 and autocompletion, so after you import IVI once, you can just type
3640 'imp' and hit the up arrow until 'import ivi' shows up.
3641
3642 Test the interface and identity query by instantiating your driver and
3643 connecting to the instrument by running something like this in ipython:
3644
3645 >>> import ivi
3646 >>> mso = ivi.agilent.agilentMSO7104A("TCPIP0::192.168.1.104::INSTR")
3647 >>> mso.identity.instrument_model
3648
3649 If everything is working, the instrument's model number will be dis‐
3650 played. Once you get this working, you can move on to implementing the
3651 actual functionality.
3652
3653 Start by copying in all of the bare function definitions from the
3654 driver file. Copy all of the get and _set function definitions from the
3655 ivi driver file for the Base class and all of the subclasses that you
3656 are implementing. You also need any methods whose only implementation
3657 is 'pass'. The ones that call other methods can generally be left out
3658 as the default implementation should be fine. You may also want to copy
3659 some of the instance variable initializations from the __init__ method
3660 as well if you need different defaults. These should be added to the
3661 init method you created earlier for your instrument.
3662
3663 Finally, you need to go write python code for all of the functions that
3664 the instrument supports. Take a look at some _get/_set pairs for some
3665 of the existing drivers to see the format. It's rather straightforward
3666 but quite tedious.
3667
3668 Driver Template
3669 This is a sample template driver that incorporates all of the major
3670 components. It is drawn from the Agilent 7000 series driver. Tem‐
3671 plate:
3672
3673 """
3674
3675 Python Interchangeable Virtual Instrument Library
3676
3677 Copyright (c) 2012 Alex Forencich
3678
3679 Permission is hereby granted, free of charge, to any person obtaining a copy
3680 of this software and associated documentation files (the "Software"), to deal
3681 in the Software without restriction, including without limitation the rights
3682 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3683 copies of the Software, and to permit persons to whom the Software is
3684 furnished to do so, subject to the following conditions:
3685
3686 The above copyright notice and this permission notice shall be included in
3687 all copies or substantial portions of the Software.
3688
3689 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3690 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
3691 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3692 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3693 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3694 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3695 THE SOFTWARE.
3696
3697 """
3698
3699 import struct
3700
3701 from .. import ivi
3702 from .. import scope
3703
3704 AcquisitionTypeMapping = {
3705 'normal': 'norm',
3706 'peak_detect': 'peak',
3707 'high_resolution': 'hres',
3708 'average': 'aver'}
3709 # more instrument-specific sets and mappings
3710
3711 class agilent7000(ivi.Driver, scope.Base, scope.TVTrigger,
3712 scope.GlitchTrigger, scope.WidthTrigger, scope.AcLineTrigger,
3713 scope.WaveformMeasurement, scope.MinMaxWaveform,
3714 scope.ContinuousAcquisition, scope.AverageAcquisition,
3715 scope.SampleMode, scope.AutoSetup):
3716 "Agilent InfiniiVision 7000 series IVI oscilloscope driver"
3717
3718 def __init__(self, *args, **kwargs):
3719 self._analog_channel_name = list()
3720 self._analog_channel_count = 4
3721 self._digital_channel_name = list()
3722 self._digital_channel_count = 16
3723 self._channel_label = list()
3724 # other per-channel instrument-specific variables that are
3725 # referenced in _init_channels
3726
3727 super(agilent7000, self).__init__(*args, **kwargs)
3728
3729 self._instrument_id = 'AGILENT TECHNOLOGIES'
3730 self._analog_channel_name = list()
3731 self._analog_channel_count = 4
3732 self._digital_channel_name = list()
3733 self._digital_channel_count = 16
3734 self._channel_count = 20
3735 self._bandwidth = 1e9
3736 # initialize other instrument-specific variables
3737
3738 self._identity_description = "Agilent InfiniiVision 7000 series IVI oscilloscope driver"
3739 self._identity_identifier = ""
3740 self._identity_revision = ""
3741 self._identity_vendor = ""
3742 self._identity_instrument_manufacturer = "Agilent Technologies"
3743 self._identity_instrument_model = ""
3744 self._identity_instrument_firmware_revision = ""
3745 self._identity_specification_major_version = 4
3746 self._identity_specification_minor_version = 1
3747 self._identity_supported_instrument_models =['DSO7012A','DSO7014A','DSO7032A',
3748 'DSO7034A','DSO7052A','DSO7054A','DSO7104A','MSO7012A','MSO7014A','MSO7032A',
3749 'MSO7034A','MSO7052A','MSO7054A','MSO7104A','DSO7012B','DSO7014B','DSO7032B',
3750 'DSO7034B','DSO7052B','DSO7054B','DSO7104B','MSO7012B','MSO7014B','MSO7032B',
3751 'MSO7034B','MSO7052B','MSO7054B','MSO7104B']
3752
3753 self.channels._add_property('label',
3754 self._get_channel_label,
3755 self._set_channel_label,
3756 None,
3757 """
3758 Custom property documentation
3759 """)
3760 # other instrument specific properties
3761
3762 self._init_channels()
3763
3764 def initialize(self, resource = None, id_query = False, reset = False, **keywargs):
3765 "Opens an I/O session to the instrument."
3766
3767 self._channel_count = self._analog_channel_count + self._digital_channel_count
3768
3769 super(agilent7000, self).initialize(resource, id_query, reset, **keywargs)
3770
3771 # interface clear
3772 if not self._driver_operation_simulate:
3773 self._clear()
3774
3775 # check ID
3776 if id_query and not self._driver_operation_simulate:
3777 id = self.identity.instrument_model
3778 id_check = self._instrument_id
3779 id_short = id[:len(id_check)]
3780 if id_short != id_check:
3781 raise Exception("Instrument ID mismatch, expecting %s, got %s", id_check, id_short)
3782
3783 # reset
3784 if reset:
3785 self.utility.reset()
3786
3787
3788 def _load_id_string(self):
3789 if self._driver_operation_simulate:
3790 self._identity_instrument_manufacturer = "Not available while simulating"
3791 self._identity_instrument_model = "Not available while simulating"
3792 self._identity_instrument_firmware_revision = "Not available while simulating"
3793 else:
3794 lst = self._ask("*IDN?").split(",")
3795 self._identity_instrument_manufacturer = lst[0]
3796 self._identity_instrument_model = lst[1]
3797 self._identity_instrument_firmware_revision = lst[3]
3798 self._set_cache_valid(True, 'identity_instrument_manufacturer')
3799 self._set_cache_valid(True, 'identity_instrument_model')
3800 self._set_cache_valid(True, 'identity_instrument_firmware_revision')
3801
3802 def _get_identity_instrument_manufacturer(self):
3803 if self._get_cache_valid():
3804 return self._identity_instrument_manufacturer
3805 self._load_id_string()
3806 return self._identity_instrument_manufacturer
3807
3808 def _get_identity_instrument_model(self):
3809 if self._get_cache_valid():
3810 return self._identity_instrument_model
3811 self._load_id_string()
3812 return self._identity_instrument_model
3813
3814 def _get_identity_instrument_firmware_revision(self):
3815 if self._get_cache_valid():
3816 return self._identity_instrument_firmware_revision
3817 self._load_id_string()
3818 return self._identity_instrument_firmware_revision
3819
3820 def _utility_disable(self):
3821 pass
3822
3823 def _utility_error_query(self):
3824 error_code = 0
3825 error_message = "No error"
3826 if not self._driver_operation_simulate:
3827 error_code, error_message = self._ask(":system:error?").split(',')
3828 error_code = int(error_code)
3829 error_message = error_message.strip(' "')
3830 return (error_code, error_message)
3831
3832 def _utility_lock_object(self):
3833 pass
3834
3835 def _utility_reset(self):
3836 if not self._driver_operation_simulate:
3837 self._write("*RST")
3838 self.driver_operation.invalidate_all_attributes()
3839
3840 def _utility_reset_with_defaults(self):
3841 self._utility_reset()
3842
3843 def _utility_self_test(self):
3844 code = 0
3845 message = "Self test passed"
3846 if not self._driver_operation_simulate:
3847 code = int(self._ask("*TST?"))
3848 if code != 0:
3849 message = "Self test failed"
3850 return (code, message)
3851
3852 def _utility_unlock_object(self):
3853 pass
3854
3855 def _init_channels(self):
3856 super(agilent7000, self)._init_channels()
3857
3858 self._channel_name = list()
3859 self._channel_label = list()
3860 # init per-channel instrument-specific variables
3861
3862 for i in range(self._channel_count):
3863 self._channel_name.append("channel%d" % (i+1))
3864 self._channel_label.append("%d" % (i+1))
3865 # init per-channel instrument-specific variables
3866
3867 self.channels._set_list(self._channel_name)
3868
3869 def _get_acquisition_start_time(self):
3870 pos = 0
3871 if not self._driver_operation_simulate and not self._get_cache_valid():
3872 pos = float(self._ask(":timebase:position?"))
3873 self._set_cache_valid()
3874 self._acquisition_start_time = pos - self._get_acquisition_time_per_record() * 5 / 10
3875 return self._acquisition_start_time
3876
3877 def _set_acquisition_start_time(self, value):
3878 value = float(value)
3879 value = value + self._get_acquisition_time_per_record() * 5 / 10
3880 if not self._driver_operation_simulate:
3881 self._write(":timebase:position %e" % value)
3882 self._acquisition_start_time = value
3883 self._set_cache_valid()
3884
3885 # more definitions
3886
3888 License
3889 Copyright (c) 2012-2014 Alex Forencich
3890
3891 Permission is hereby granted, free of charge, to any person obtaining a
3892 copy of this software and associated documentation files (the "Soft‐
3893 ware"), to deal in the Software without restriction, including without
3894 limitation the rights to use, copy, modify, merge, publish, distribute,
3895 sublicense, and/or sell copies of the Software, and to permit persons
3896 to whom the Software is furnished to do so, subject to the following
3897 conditions:
3898
3899 The above copyright notice and this permission notice shall be included
3900 in all copies or substantial portions of the Software.
3901
3902 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3903 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MER‐
3904 CHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
3905 NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
3906 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
3907 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT‐
3908 WARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3909
3910 · genindex
3911
3912 · modindex
3913
3914 · search
3915
3917 Alex Forencich
3918
3920 2012-2014, Alex Forencich
3921
3922
3923
3924
39250.1 Jul 15, 2018 PYTHONIVI(1)