1# -*- coding: utf-8 -*-
2"""Descriptor to access VISA attributes.
3
4Not all descriptors are used but they provide a reference regarding the
5possible values for each attributes.
6
7This file is part of PyVISA.
8
9:copyright: 2014-2020 by PyVISA Authors, see AUTHORS for more details.
10:license: MIT, see LICENSE for more details.
11
12"""
13import enum
14import sys
15from collections import defaultdict
16from typing import (
17    TYPE_CHECKING,
18    Any,
19    Dict,
20    Generic,
21    List,
22    Optional,
23    Set,
24    SupportsBytes,
25    SupportsInt,
26    Tuple,
27    Type,
28    TypeVar,
29    Union,
30    overload,
31)
32
33from typing_extensions import ClassVar, DefaultDict
34
35from . import constants, util
36
37if TYPE_CHECKING:
38    from .events import Event, IOCompletionEvent  # noqa  # pragma: no cover
39    from .resources import Resource  # noqa  # pragma: no cover
40
41#: Not available value.
42NotAvailable = object()
43
44
45#: Attribute for all session types.
46class AllSessionTypes:  # We use a class to simplify typing
47    """Class used as a placeholder to indicate an attribute exist on all resources."""
48
49    pass
50
51
52#: Map resource to attribute
53AttributesPerResource: DefaultDict[
54    Union[
55        Tuple[constants.InterfaceType, str], Type[AllSessionTypes], constants.EventType
56    ],
57    Set[Type["Attribute"]],
58] = defaultdict(set)
59
60#: Map id to attribute
61AttributesByID: Dict[int, Type["Attribute"]] = dict()
62
63
64# --- Descriptor classes ---------------------------------------------------------------
65
66T = TypeVar("T")
67
68
69class Attribute(Generic[T]):
70    """Base class for Attributes to be used as properties."""
71
72    #: List of resource or event types with this attribute.
73    #: each element is a tuple (constants.InterfaceType, str)
74    resources: ClassVar[
75        Union[
76            List[Union[Tuple[constants.InterfaceType, str], constants.EventType]],
77            Type[AllSessionTypes],
78        ]
79    ] = []
80
81    #: Name of the Python property to be matched to this attribute.
82    py_name: ClassVar[str] = "To be specified"
83
84    #: Name of the VISA Attribute
85    visa_name: ClassVar[str] = "To be specified"
86
87    #: Type of the VISA attribute
88    visa_type: ClassVar[str] = ""
89
90    #: Numeric constant of the VISA Attribute
91    attribute_id: ClassVar[int] = 0
92
93    #: Default value fo the VISA Attribute
94    default: ClassVar[Any] = "N/A"
95
96    #: Access
97    read: ClassVar[bool] = False
98    write: ClassVar[bool] = False
99    local: ClassVar[bool] = False
100
101    __doc__: str
102
103    @classmethod
104    def __init_subclass__(cls, **kwargs):
105        """Register the subclass with the supported resources."""
106        super().__init_subclass__(**kwargs)
107
108        if not cls.__name__.startswith("AttrVI_"):
109            return
110
111        cls.attribute_id = getattr(constants, cls.visa_name)
112        # Check that the docstring are populated before extending them
113        # Cover the case of running with Python with -OO option
114        if cls.__doc__ is not None:
115            cls.redoc()
116        if cls.resources is AllSessionTypes:
117            AttributesPerResource[AllSessionTypes].add(cls)
118        else:
119            for res in cls.resources:
120                AttributesPerResource[res].add(cls)
121        AttributesByID[cls.attribute_id] = cls
122
123    @classmethod
124    def redoc(cls) -> None:
125        """Generate a descriptive docstring."""
126        cls.__doc__ += "\n:VISA Attribute: %s (%s)" % (cls.visa_name, cls.attribute_id)
127
128    def post_get(self, value: Any) -> T:
129        """Override to check or modify the value returned by the VISA function.
130
131        Parameters
132        ----------
133        value : Any
134            Value returned by the VISA library.
135
136        Returns
137        -------
138        T
139            Equivalent python value.
140
141        """
142        return value
143
144    def pre_set(self, value: T) -> Any:
145        """Override to check or modify the value to be passed to the VISA function.
146
147        Parameters
148        ----------
149        value : T
150            Python value to be passed to VISA library.
151
152        Returns
153        -------
154        Any
155            Equivalent value to pass to the VISA library.
156
157        """
158        return value
159
160    @overload
161    def __get__(self, instance: None, owner) -> "Attribute":
162        pass
163
164    @overload  # noqa: F811
165    def __get__(self, instance: Union["Resource", "Event"], owner) -> T:  # noqa: F811
166        pass
167
168    def __get__(self, instance, owner):  # noqa: F811
169        """Access a VISA attribute and convert to a nice Python representation."""
170        if instance is None:
171            return self
172
173        if not self.read:
174            raise AttributeError("can't read attribute")
175
176        return self.post_get(instance.get_visa_attribute(self.attribute_id))
177
178    def __set__(self, instance: "Resource", value: T) -> None:
179        """Set the attribute if writable."""
180        if not self.write:
181            raise AttributeError("can't write attribute")
182
183        # Here we use the bare integer value of the enumeration hence the type ignore
184        instance.set_visa_attribute(
185            self.attribute_id,  # type: ignore
186            self.pre_set(value),
187        )
188
189    @classmethod
190    def in_resource(cls, session_type: Tuple[constants.InterfaceType, str]) -> bool:
191        """Is the attribute part of a given session type.
192
193        Parameters
194        ----------
195        session_type : Tuple[constants.InterfaceType, str]
196            Type of session for which to check the presence of an attribute.
197
198        Returns
199        -------
200        bool
201            Is the attribute present.
202
203        """
204        if cls.resources is AllSessionTypes:
205            return True
206        return session_type in cls.resources  # type: ignore
207
208
209class EnumAttribute(Attribute):
210    """Class for attributes with values that map to a PyVISA Enum."""
211
212    #: Enum type with valid values.
213    enum_type: ClassVar[Type[enum.IntEnum]]
214
215    @classmethod
216    def redoc(cls) -> None:
217        """Add the enum member to the docstring."""
218        super(EnumAttribute, cls).redoc()
219        cls.__doc__ += "\n:type: :class:%s.%s" % (
220            cls.enum_type.__module__,
221            cls.enum_type.__name__,
222        )
223
224    def post_get(self, value: Any) -> enum.IntEnum:
225        """Convert the VISA value to the proper enum member."""
226        return self.enum_type(value)
227
228    def pre_set(self, value: enum.IntEnum) -> Any:
229        """Validate the value passed against the enum."""
230        # Python 3.8 raise if a non-Enum is used for value
231        try:
232            value = self.enum_type(value)
233        except ValueError:
234            raise ValueError(
235                "%r is an invalid value for attribute %s, "
236                "should be a %r" % (value, self.visa_name, self.enum_type)
237            )
238        return value
239
240
241class IntAttribute(Attribute):
242    """Class for attributes with integers values."""
243
244    @classmethod
245    def redoc(cls) -> None:
246        """Add the type of the returned value."""
247        super(IntAttribute, cls).redoc()
248        cls.__doc__ += "\n:type: int"
249
250    def post_get(self, value: SupportsInt) -> int:
251        """Convert the returned value to an integer."""
252        return int(value)
253
254
255class RangeAttribute(IntAttribute):
256    """Class for integer attributes with values within a range."""
257
258    #: Range for the value, and iterable of extra values.
259    min_value: int
260    max_value: int
261    values: Optional[List[int]] = None
262
263    @classmethod
264    def redoc(cls) -> None:
265        """Specify the range of validity for the attribute."""
266        super(RangeAttribute, cls).redoc()
267        cls.__doc__ += "\n:range: %s <= value <= %s" % (cls.min_value, cls.max_value)
268        if cls.values:
269            cls.__doc__ += " or in %s" % cls.values
270
271    def pre_set(self, value: int) -> int:
272        """Check that the value falls in the specified range."""
273        if not self.min_value <= value <= self.max_value:
274            if not self.values:
275                raise ValueError(
276                    "%r is an invalid value for attribute %s, "
277                    "should be between %r and %r"
278                    % (value, self.visa_name, self.min_value, self.max_value)
279                )
280            elif value not in self.values:
281                raise ValueError(
282                    "%r is an invalid value for attribute %s, "
283                    "should be between %r and %r or %r"
284                    % (
285                        value,
286                        self.visa_name,
287                        self.min_value,
288                        self.max_value,
289                        self.values,
290                    )
291                )
292        return value
293
294
295class ValuesAttribute(Attribute):
296    """Class for attributes with values in a list."""
297
298    #: Valid values
299    values: list = []
300
301    @classmethod
302    def redoc(cls) -> None:
303        """Add the allowed values to teh docs."""
304        super(ValuesAttribute, cls).redoc()
305        cls.__doc__ += "\n:values: %s" % cls.values
306
307    def pre_set(self, value: int) -> int:
308        """Validate the value against the allowed values."""
309        if value not in self.values:
310            raise ValueError(
311                "%r is an invalid value for attribute %s, "
312                "should be in %s" % (value, self.visa_name, self.values)
313            )
314        return value
315
316
317class BooleanAttribute(Attribute):
318    """Class for attributes with boolean values."""
319
320    py_type: bool
321
322    @classmethod
323    def redoc(cls) -> None:
324        """Add the type to the docs."""
325        super(BooleanAttribute, cls).redoc()
326        cls.__doc__ += "\n:type: bool"
327
328    def post_get(self, value: constants.VisaBoolean) -> bool:
329        """Convert to a Python boolean."""
330        return value == constants.VisaBoolean.true
331
332    def pre_set(self, value: bool) -> constants.VisaBoolean:
333        """Convert to a VISA boolean."""
334        return constants.VisaBoolean.true if value else constants.VisaBoolean.false
335
336
337class CharAttribute(Attribute):
338    """Class for attributes with char values."""
339
340    py_type = str
341
342    @classmethod
343    def redoc(cls) -> None:
344        """Specify the valid characters."""
345        super(CharAttribute, cls).redoc()
346        cls.__doc__ += "\nASCII Character\n:type: str | bytes"
347
348    def post_get(self, value: int) -> str:
349        """Convert the integer to a character."""
350        return chr(value)
351
352    def pre_set(self, value: Union[str, bytes]) -> int:
353        """Convert a character to an integer."""
354        return ord(value)
355
356
357# --- Session attributes ---------------------------------------------------------------
358# Attributes are in the same order as in the constants.ResourceAttribute enum
359
360# VI_ATTR_RM_SESSION is not implemented as resource property,
361# use .resource_manager.session instead
362
363
364class AttrVI_ATTR_INTF_TYPE(EnumAttribute):
365    """Interface type of the given session."""
366
367    resources = AllSessionTypes
368
369    py_name = "interface_type"
370
371    visa_name = "VI_ATTR_INTF_TYPE"
372
373    visa_type = "ViUInt16"
374
375    default = NotAvailable
376
377    read, write, local = True, False, False
378
379    enum_type = constants.InterfaceType
380
381
382class AttrVI_ATTR_INTF_NUM(RangeAttribute):
383    """Board number for the given interface."""
384
385    resources = AllSessionTypes
386
387    py_name = "interface_number"
388
389    visa_name = "VI_ATTR_INTF_NUM"
390
391    visa_type = "ViUInt16"
392
393    default = 0
394
395    read, write, local = True, False, False
396
397    min_value, max_value, values = 0x0, 0xFFFF, None
398
399
400class AttrVI_ATTR_INTF_INST_NAME(Attribute):
401    """Human-readable text that describes the given interface."""
402
403    resources = AllSessionTypes
404
405    py_name = ""
406
407    visa_name = "VI_ATTR_INTF_INST_NAME"
408
409    visa_type = "ViString"
410
411    default = NotAvailable
412
413    read, write, local = True, False, False
414
415
416class AttrVI_ATTR_RSRC_CLASS(Attribute):
417    """Resource class as defined by the canonical resource name.
418
419    Possible values are: INSTR, INTFC, SOCKET, RAW...
420
421    """
422
423    resources = AllSessionTypes
424
425    py_name = "resource_class"
426
427    visa_name = "VI_ATTR_RSRC_CLASS"
428
429    visa_type = "ViString"
430
431    default = NotAvailable
432
433    read, write, local = True, False, False
434
435
436class AttrVI_ATTR_RSRC_NAME(Attribute):
437    """Unique identifier for a resource compliant with the address structure."""
438
439    resources = AllSessionTypes
440
441    py_name = "resource_name"
442
443    visa_name = "VI_ATTR_RSRC_NAME"
444
445    visa_type = "ViRsrc"
446
447    default = NotAvailable
448
449    read, write, local = True, False, False
450
451
452class AttrVI_ATTR_RSRC_IMPL_VERSION(RangeAttribute):
453    """Resource version that identifies the revisions or implementations of a resource.
454
455    This attribute value is defined by the individual manufacturer and increments
456    with each new revision. The format of the value has the upper 12 bits as
457    the major number of the version, the next lower 12 bits as the minor number
458    of the version, and the lowest 8 bits as the sub-minor number of the version.
459
460    """
461
462    resources = AllSessionTypes
463
464    py_name = "implementation_version"
465
466    visa_name = "VI_ATTR_RSRC_IMPL_VERSION"
467
468    visa_type = "ViVersion"
469
470    default = NotAvailable
471
472    read, write, local = True, False, True
473
474    min_value, max_value, values = 0, 4294967295, None
475
476
477class AttrVI_ATTR_RSRC_LOCK_STATE(EnumAttribute):
478    """Current locking state of the resource.
479
480    The resource can be unlocked, locked with an exclusive lock,
481    or locked with a shared lock.
482
483    """
484
485    resources = AllSessionTypes
486
487    py_name = "lock_state"
488
489    visa_name = "VI_ATTR_RSRC_LOCK_STATE"
490
491    visa_type = "ViAccessMode"
492
493    default = constants.AccessModes.no_lock
494
495    read, write, local = True, False, False
496
497    enum_type = constants.AccessModes
498
499
500class AttrVI_ATTR_RSRC_SPEC_VERSION(RangeAttribute):
501    """Version of the VISA specification to which the implementation is compliant.
502
503    The format of the value has the upper 12 bits as the major number of the version,
504    the next lower 12 bits as the minor number of the version, and the lowest 8 bits
505    as the sub-minor number of the version. The current VISA specification defines
506    the value to be 00300000h.
507
508    """
509
510    resources = AllSessionTypes
511
512    py_name = "spec_version"
513
514    visa_name = "VI_ATTR_RSRC_SPEC_VERSION"
515
516    visa_type = "ViVersion"
517
518    default = 0x00300000
519
520    read, write, local = True, False, True
521
522    min_value, max_value, values = 0, 4294967295, None
523
524
525class AttrVI_ATTR_RSRC_MANF_NAME(Attribute):
526    """Manufacturer name of the vendor that implemented the VISA library.
527
528    This attribute is not related to the device manufacturer attributes.
529
530    Note  The value of this attribute is for display purposes only and not for
531    programmatic decisions, as the value can differ between VISA implementations
532    and/or revisions.
533
534    """
535
536    resources = AllSessionTypes
537
538    py_name = "resource_manufacturer_name"
539
540    visa_name = "VI_ATTR_RSRC_MANF_NAME"
541
542    visa_type = "ViString"
543
544    default = NotAvailable
545
546    read, write, local = True, False, False
547
548
549class AttrVI_ATTR_RSRC_MANF_ID(RangeAttribute):
550    """VXI manufacturer ID of the vendor that implemented the VISA library.
551
552    This attribute is not related to the device manufacturer attributes.
553
554    """
555
556    resources = AllSessionTypes
557
558    py_name = ""
559
560    visa_name = "VI_ATTR_RSRC_MANF_ID"
561
562    visa_type = "ViUInt16"
563
564    default = NotAvailable
565
566    read, write, local = True, False, False
567
568    min_value, max_value, values = 0, 0x3FFF, None
569
570
571class AttrVI_ATTR_TMO_VALUE(RangeAttribute):
572    """Timeout in milliseconds for all resource I/O operations.
573
574    This value is used when accessing the device associated with the given
575    session.
576
577    Special values:
578
579    - **immediate** (``VI_TMO_IMMEDIATE``): 0
580        (for convenience, any value smaller than 1 is considered as 0)
581    - **infinite** (``VI_TMO_INFINITE``): ``float('+inf')``
582        (for convenience, None is considered as ``float('+inf')``)
583
584    To set an **infinite** timeout, you can also use:
585
586    >>> del instrument.timeout
587
588    A timeout value of VI_TMO_IMMEDIATE means that operations should never
589    wait for the device to respond. A timeout value of VI_TMO_INFINITE disables
590    the timeout mechanism.
591
592    """
593
594    resources = AllSessionTypes
595
596    py_name = "timeout"
597
598    visa_name = "VI_ATTR_TMO_VALUE"
599
600    visa_type = "ViUInt32"
601
602    default = 2000
603
604    read, write, local = True, True, True
605
606    min_value, max_value, values = 0, 0xFFFFFFFF, None
607
608    def pre_set(self, value: Optional[Union[int, float]]) -> int:
609        """Convert the timeout to an integer recognized by the VISA library."""
610        timeout = util.cleanup_timeout(value)
611        return timeout
612
613    def post_get(self, value: int) -> Union[int, float]:  # type: ignore
614        """Convert VI_TMO_INFINTE into float("+inf")."""
615        if value == constants.VI_TMO_INFINITE:
616            return float("+inf")
617        return value
618
619    def __delete__(self, instance: "Resource") -> None:
620        """Set an infinite timeout upon deletion."""
621        instance.set_visa_attribute(
622            constants.ResourceAttribute.timeout_value, constants.VI_TMO_INFINITE
623        )
624
625
626class AttrVI_ATTR_MAX_QUEUE_LENGTH(RangeAttribute):
627    """Maximum number of events that can be queued at any time on the given session.
628
629    Events that occur after the queue has become full will be discarded.
630
631    """
632
633    resources = AllSessionTypes
634
635    py_name = ""
636
637    visa_name = "VI_ATTR_MAX_QUEUE_LENGTH"
638
639    visa_type = "ViUInt32"
640
641    default = 50
642
643    read, write, local = True, True, True
644
645    min_value, max_value, values = 0x1, 0xFFFFFFFF, None
646
647
648class AttrVI_ATTR_USER_DATA(RangeAttribute):
649    """Maximum number of events that can be queued at any time on the given session.
650
651    Events that occur after the queue has become full will be discarded.
652
653    """
654
655    resources = AllSessionTypes
656
657    py_name = ""
658
659    visa_name = "VI_ATTR_USER_DATA"
660
661    visa_type = "ViUInt64" if constants.is_64bits else "ViUInt32"
662
663    default = 0
664
665    read, write, local = True, True, True
666
667    min_value, max_value, values = (
668        0x0,
669        0xFFFFFFFFFFFFFFFF if constants.is_64bits else 0xFFFFFFFF,
670        None,
671    )
672
673
674class AttrVI_ATTR_TRIG_ID(EnumAttribute):
675    """Identifier for the current triggering mechanism."""
676
677    resources = [
678        (constants.InterfaceType.gpib, "INSTR"),
679        (constants.InterfaceType.gpib, "INTFC"),
680        (constants.InterfaceType.pxi, "INSTR"),
681        (constants.InterfaceType.pxi, "BACKPLANE"),
682        (constants.InterfaceType.asrl, "INSTR"),
683        (constants.InterfaceType.tcpip, "INSTR"),
684        (constants.InterfaceType.vxi, "BACKPLANE"),
685        (constants.InterfaceType.vxi, "INSTR"),
686        (constants.InterfaceType.vxi, "SERVANT"),
687    ]
688
689    py_name = ""
690
691    visa_name = "VI_ATTR_TRIG_ID"
692
693    visa_type = "ViInt16"
694
695    default = constants.VI_TRIG_SW
696
697    read, write, local = True, True, True
698
699    enum_type = constants.TriggerID
700
701
702class AttrVI_ATTR_SEND_END_EN(BooleanAttribute):
703    """Should END be asserted during the transfer of the last byte of the buffer."""
704
705    # TODO find out if USB RAW should be listed
706    resources = [
707        (constants.InterfaceType.asrl, "INSTR"),
708        (constants.InterfaceType.gpib, "INSTR"),
709        (constants.InterfaceType.gpib, "INTFC"),
710        (constants.InterfaceType.tcpip, "INSTR"),
711        (constants.InterfaceType.tcpip, "SOCKET"),
712        (constants.InterfaceType.usb, "INSTR"),
713        (constants.InterfaceType.usb, "RAW"),
714        (constants.InterfaceType.vxi, "INSTR"),
715        (constants.InterfaceType.vxi, "SERVANT"),
716    ]
717
718    py_name = "send_end"
719
720    visa_name = "VI_ATTR_SEND_END_EN"
721
722    visa_type = "ViBoolean"
723
724    default = True
725
726    read, write, local = True, True, True
727
728
729class AttrVI_ATTR_SUPPRESS_END_EN(BooleanAttribute):
730    """Whether to suppress the END indicator termination.
731
732    Only relevant in viRead and related operations.
733
734    """
735
736    resources = [
737        (constants.InterfaceType.asrl, "INSTR"),
738        (constants.InterfaceType.gpib, "INSTR"),
739        (constants.InterfaceType.tcpip, "INSTR"),
740        (constants.InterfaceType.tcpip, "SOCKET"),
741        (constants.InterfaceType.usb, "INSTR"),
742        (constants.InterfaceType.usb, "RAW"),
743        (constants.InterfaceType.vxi, "INSTR"),
744    ]
745
746    py_name = ""
747
748    visa_name = "VI_ATTR_SUPPRESS_END_EN"
749
750    visa_type = "ViBoolean"
751
752    default = False
753
754    read, write, local = True, True, True
755
756
757class AttrVI_ATTR_TERMCHAR_EN(BooleanAttribute):
758    """Should the read operation terminate when a termination character is received.
759
760    This attribute is ignored if VI_ATTR_ASRL_END_IN is set to VI_ASRL_END_TERMCHAR.
761    This attribute is valid for both raw I/O (viRead) and formatted I/O (viScanf).
762
763    For message based resource this automatically handled by the `read_termination`
764    property.
765
766    """
767
768    resources = [
769        (constants.InterfaceType.gpib, "INSTR"),
770        (constants.InterfaceType.gpib, "INTFC"),
771        (constants.InterfaceType.asrl, "INSTR"),
772        (constants.InterfaceType.tcpip, "INSTR"),
773        (constants.InterfaceType.tcpip, "SOCKET"),
774        (constants.InterfaceType.usb, "INSTR"),
775        (constants.InterfaceType.usb, "RAW"),
776        (constants.InterfaceType.vxi, "INSTR"),
777        (constants.InterfaceType.vxi, "SERVANT"),
778    ]
779
780    py_name = ""
781
782    visa_name = "VI_ATTR_TERMCHAR_EN"
783
784    visa_type = "ViBoolean"
785
786    default = False
787
788    read, write, local = True, True, True
789
790
791class AttrVI_ATTR_TERMCHAR(CharAttribute):
792    """VI_ATTR_TERMCHAR is the termination character.
793
794    When the termination character is read and VI_ATTR_TERMCHAR_EN is enabled
795    during a read operation, the read operation terminates.
796
797    For message based resource this automatically handled by the `read_termination`
798    property.
799
800    """
801
802    resources = [
803        (constants.InterfaceType.gpib, "INSTR"),
804        (constants.InterfaceType.gpib, "INTFC"),
805        (constants.InterfaceType.asrl, "INSTR"),
806        (constants.InterfaceType.tcpip, "INSTR"),
807        (constants.InterfaceType.tcpip, "SOCKET"),
808        (constants.InterfaceType.usb, "INSTR"),
809        (constants.InterfaceType.usb, "RAW"),
810        (constants.InterfaceType.vxi, "INSTR"),
811        (constants.InterfaceType.vxi, "SERVANT"),
812    ]
813
814    py_name = ""
815
816    visa_name = "VI_ATTR_TERMCHAR"
817
818    visa_type = "ViUInt8"
819
820    default = 0x0A  # (linefeed)
821
822    read, write, local = True, True, True
823
824
825class AttrVI_ATTR_IO_PROT(EnumAttribute):
826    """IO protocol to use.
827
828    In VXI, you can choose normal word serial or fast data channel (FDC).
829    In GPIB, you can choose normal or high-speed (HS-488) transfers.
830    In serial, TCPIP, or USB RAW, you can choose normal transfers or
831    488.2-defined strings.
832    In USB INSTR, you can choose normal or vendor-specific transfers.
833
834    """
835
836    # Crossing IVI and NI this is correct
837    resources = [
838        (constants.InterfaceType.gpib, "INTFC"),
839        (constants.InterfaceType.gpib, "INSTR"),
840        (constants.InterfaceType.asrl, "INSTR"),
841        (constants.InterfaceType.tcpip, "INSTR"),
842        (constants.InterfaceType.tcpip, "SOCKET"),
843        (constants.InterfaceType.usb, "INSTR"),
844        (constants.InterfaceType.usb, "RAW"),
845        (constants.InterfaceType.vxi, "INSTR"),
846        (constants.InterfaceType.vxi, "SERVANT"),
847    ]
848
849    py_name = "io_protocol"
850
851    visa_name = "VI_ATTR_IO_PROT"
852
853    visa_type = "ViUInt16"
854
855    default = constants.IOProtocol.normal
856
857    read, write, local = True, True, True
858
859    enum_type = constants.IOProtocol
860
861
862class AttrVI_ATTR_FILE_APPEND_EN(BooleanAttribute):
863    """Should viReadToFile() overwrite (truncate) or append when opening a file."""
864
865    resources = [
866        (constants.InterfaceType.gpib, "INSTR"),
867        (constants.InterfaceType.gpib, "INTFC"),
868        (constants.InterfaceType.asrl, "INSTR"),
869        (constants.InterfaceType.tcpip, "INSTR"),
870        (constants.InterfaceType.tcpip, "SOCKET"),
871        (constants.InterfaceType.usb, "INSTR"),
872        (constants.InterfaceType.usb, "RAW"),
873        (constants.InterfaceType.vxi, "INSTR"),
874        (constants.InterfaceType.vxi, "SERVANT"),
875    ]
876
877    py_name = ""
878
879    visa_name = "VI_ATTR_FILE_APPEND_EN"
880
881    visa_type = "ViBoolean"
882
883    default = False
884
885    read, write, local = True, True, True
886
887
888class AttrVI_ATTR_RD_BUF_OPER_MODE(RangeAttribute):
889    """Operational mode of the formatted I/O read buffer.
890
891    When the operational mode is set to VI_FLUSH_DISABLE (default), the buffer
892    is flushed only on explicit calls to viFlush(). If the operational mode is
893    set to VI_FLUSH_ON_ACCESS, the read buffer is flushed every time a
894    viScanf() (or related) operation completes.
895
896    """
897
898    resources = [
899        (constants.InterfaceType.gpib, "INSTR"),
900        (constants.InterfaceType.gpib, "INTFC"),
901        (constants.InterfaceType.asrl, "INSTR"),
902        (constants.InterfaceType.tcpip, "INSTR"),
903        (constants.InterfaceType.tcpip, "SOCKET"),
904        (constants.InterfaceType.usb, "INSTR"),
905        (constants.InterfaceType.usb, "RAW"),
906        (constants.InterfaceType.vxi, "INSTR"),
907        (constants.InterfaceType.vxi, "SERVANT"),
908    ]
909
910    py_name = ""
911
912    visa_name = "VI_ATTR_RD_BUF_OPER_MODE"
913
914    visa_type = "ViUInt16"
915
916    default = constants.VI_FLUSH_DISABLE
917
918    read, write, local = True, True, True
919
920    min_value, max_value, values = 0, 65535, None
921
922
923class AttrVI_ATTR_RD_BUF_SIZE(RangeAttribute):
924    """Current size of the formatted I/O input buffer for this session.
925
926    The user can modify this value by calling viSetBuf().
927
928    """
929
930    resources = [
931        (constants.InterfaceType.gpib, "INSTR"),
932        (constants.InterfaceType.gpib, "INTFC"),
933        (constants.InterfaceType.asrl, "INSTR"),
934        (constants.InterfaceType.tcpip, "INSTR"),
935        (constants.InterfaceType.tcpip, "SOCKET"),
936        (constants.InterfaceType.usb, "INSTR"),
937        (constants.InterfaceType.usb, "RAW"),
938        (constants.InterfaceType.vxi, "INSTR"),
939        (constants.InterfaceType.vxi, "SERVANT"),
940    ]
941
942    py_name = ""
943
944    visa_name = "VI_ATTR_RD_BUF_SIZE"
945
946    visa_type = "ViUInt32"
947
948    default = NotAvailable
949
950    read, write, local = True, False, True
951
952    min_value, max_value, values = 0, 4294967295, None
953
954
955class AttrVI_ATTR_WR_BUF_OPER_MODE(RangeAttribute):
956    """Operational mode of the formatted I/O write buffer.
957
958    When the operational mode is set to VI_FLUSH_WHEN_FULL (default), the buffer
959    is flushed when an END indicator is written to the buffer, or when the buffer
960     fills up.
961    If the operational mode is set to VI_FLUSH_ON_ACCESS, the write
962    buffer is flushed under the same conditions, and also every time a
963    viPrintf() (or related) operation completes.
964
965    """
966
967    resources = [
968        (constants.InterfaceType.gpib, "INSTR"),
969        (constants.InterfaceType.gpib, "INTFC"),
970        (constants.InterfaceType.asrl, "INSTR"),
971        (constants.InterfaceType.tcpip, "INSTR"),
972        (constants.InterfaceType.tcpip, "SOCKET"),
973        (constants.InterfaceType.usb, "INSTR"),
974        (constants.InterfaceType.usb, "RAW"),
975        (constants.InterfaceType.vxi, "INSTR"),
976        (constants.InterfaceType.vxi, "SERVANT"),
977    ]
978
979    py_name = ""
980
981    visa_name = "VI_ATTR_WR_BUF_OPER_MODE"
982
983    visa_type = "ViUInt16"
984
985    default = constants.VI_FLUSH_WHEN_FULL
986
987    read, write, local = True, True, True
988
989    min_value, max_value, values = 0, 65535, None
990
991
992class AttrVI_ATTR_WR_BUF_SIZE(RangeAttribute):
993    """Current size of the formatted I/O output buffer for this session.
994
995    The user can modify this value by calling viSetBuf().
996
997    """
998
999    resources = [
1000        (constants.InterfaceType.gpib, "INSTR"),
1001        (constants.InterfaceType.gpib, "INTFC"),
1002        (constants.InterfaceType.asrl, "INSTR"),
1003        (constants.InterfaceType.tcpip, "INSTR"),
1004        (constants.InterfaceType.tcpip, "SOCKET"),
1005        (constants.InterfaceType.usb, "INSTR"),
1006        (constants.InterfaceType.usb, "RAW"),
1007        (constants.InterfaceType.vxi, "INSTR"),
1008        (constants.InterfaceType.vxi, "SERVANT"),
1009    ]
1010
1011    py_name = ""
1012
1013    visa_name = "VI_ATTR_WR_BUF_SIZE"
1014
1015    visa_type = "ViUInt32"
1016
1017    default = NotAvailable
1018
1019    read, write, local = True, False, True
1020
1021    min_value, max_value, values = 0, 4294967295, None
1022
1023
1024class AttrVI_ATTR_DMA_ALLOW_EN(BooleanAttribute):
1025    """Should I/O accesses use DMA (True) or Programmed I/O (False).
1026
1027    In some implementations, this attribute may have global effects even though
1028    it is documented to be a local attribute. Since this affects performance and not
1029    functionality, that behavior is acceptable.
1030
1031    """
1032
1033    # TODO find a reliable source to check if USB RAW should be listed
1034    resources = [
1035        (constants.InterfaceType.gpib, "INSTR"),
1036        (constants.InterfaceType.gpib, "INTFC"),
1037        (constants.InterfaceType.pxi, "INSTR"),
1038        (constants.InterfaceType.asrl, "INSTR"),
1039        (constants.InterfaceType.tcpip, "INSTR"),
1040        (constants.InterfaceType.tcpip, "SOCKET"),
1041        (constants.InterfaceType.usb, "INSTR"),
1042        (constants.InterfaceType.usb, "RAW"),
1043        (constants.InterfaceType.vxi, "INSTR"),
1044        (constants.InterfaceType.vxi, "MEMACC"),
1045        (constants.InterfaceType.vxi, "SERVANT"),
1046    ]
1047
1048    py_name = "allow_dma"
1049
1050    visa_name = "VI_ATTR_DMA_ALLOW_EN"
1051
1052    visa_type = "ViBoolean"
1053
1054    default = NotAvailable
1055
1056    read, write, local = True, True, True
1057
1058
1059class AttrVI_ATTR_TCPIP_ADDR(Attribute):
1060    """TCPIP address of the device to which the session is connected.
1061
1062    This string is formatted in dot notation.
1063
1064    """
1065
1066    resources = [
1067        (constants.InterfaceType.tcpip, "INSTR"),
1068        (constants.InterfaceType.tcpip, "SOCKET"),
1069    ]
1070
1071    py_name = ""
1072
1073    visa_name = "VI_ATTR_TCPIP_ADDR"
1074
1075    visa_type = "ViString"
1076
1077    default = NotAvailable
1078
1079    read, write, local = True, False, False
1080
1081
1082class AttrVI_ATTR_TCPIP_HOSTNAME(Attribute):
1083    """Host name of the device.
1084
1085    If no host name is available, this attribute returns an empty string.
1086
1087    """
1088
1089    resources = [
1090        (constants.InterfaceType.tcpip, "INSTR"),
1091        (constants.InterfaceType.tcpip, "SOCKET"),
1092    ]
1093
1094    py_name = ""
1095
1096    visa_name = "VI_ATTR_TCPIP_HOSTNAME"
1097
1098    visa_type = "ViString"
1099
1100    default = NotAvailable
1101
1102    read, write, local = True, False, False
1103
1104
1105class AttrVI_ATTR_TCPIP_PORT(RangeAttribute):
1106    """Port number for a given TCPIP address.
1107
1108    For a TCPIP SOCKET Resource, this is a required part of the address string.
1109
1110    """
1111
1112    resources = [(constants.InterfaceType.tcpip, "SOCKET")]
1113
1114    py_name = ""
1115
1116    visa_name = "VI_ATTR_TCPIP_PORT"
1117
1118    visa_type = "ViUInt16"
1119
1120    default = NotAvailable
1121
1122    read, write, local = True, False, False
1123
1124    min_value, max_value, values = 0, 0xFFFF, None
1125
1126
1127class AttrVI_ATTR_TCPIP_DEVICE_NAME(Attribute):
1128    """LAN device name used by the VXI-11 or LXI protocol during connection."""
1129
1130    resources = [(constants.InterfaceType.tcpip, "INSTR")]
1131
1132    py_name = ""
1133
1134    visa_name = "VI_ATTR_TCPIP_DEVICE_NAME"
1135
1136    visa_type = "ViString"
1137
1138    default = NotAvailable
1139
1140    read, write, local = True, False, False
1141
1142
1143class AttrVI_ATTR_TCPIP_NODELAY(BooleanAttribute):
1144    """The Nagle algorithm is disabled when this attribute is enabled (and vice versa).
1145
1146    The Nagle algorithm improves network performance by buffering "send" data until a
1147    full-size packet can be sent. This attribute is enabled by default in VISA to
1148    verify that synchronous writes get flushed immediately.
1149
1150    """
1151
1152    resources = [(constants.InterfaceType.tcpip, "SOCKET")]
1153
1154    py_name = ""
1155
1156    visa_name = "VI_ATTR_TCPIP_NODELAY"
1157
1158    visa_type = "ViBoolean"
1159
1160    default = True
1161
1162    read, write, local = True, True, True
1163
1164
1165class AttrVI_ATTR_TCPIP_KEEPALIVE(BooleanAttribute):
1166    """Requests that a TCP/IP provider enable the use of keep-alive packets.
1167
1168    After the system detects that a connection was dropped, VISA returns a lost
1169    connection error code on subsequent I/O calls on the session. The time required
1170    for the system to detect that the connection was dropped is dependent on the
1171    system and is not settable.
1172
1173    """
1174
1175    resources = [(constants.InterfaceType.tcpip, "SOCKET")]
1176
1177    py_name = ""
1178
1179    visa_name = "VI_ATTR_TCPIP_KEEPALIVE"
1180
1181    visa_type = "ViBoolean"
1182
1183    default = False
1184
1185    read, write, local = True, True, True
1186
1187
1188class AttrVI_ATTR_TCPIP_IS_HISLIP(BooleanAttribute):
1189    """Does this resource use the HiSLIP protocol."""
1190
1191    resources = [(constants.InterfaceType.tcpip, "INSTR")]
1192
1193    py_name = ""
1194
1195    visa_name = "VI_ATTR_TCPIP_IS_HISLIP"
1196
1197    visa_type = "ViBoolean"
1198
1199    default = NotAvailable
1200
1201    read, write, local = True, False, False
1202
1203
1204class AttrVI_ATTR_TCPIP_HISLIP_VERSION(RangeAttribute):
1205    """HiSLIP protocol version used for a particular HiSLIP connetion.
1206
1207    Currently, HiSLIP version 1.0 would return a ViVersion value of 0x00100000.
1208
1209    """
1210
1211    resources = [(constants.InterfaceType.tcpip, "INSTR")]
1212
1213    py_name = ""
1214
1215    visa_name = "VI_ATTR_TCPIP_HISLIP_VERSION"
1216
1217    visa_type = "ViVersion"
1218
1219    default = NotAvailable
1220
1221    read, write, local = True, False, True
1222
1223    min_value, max_value, values = 0, 0xFFFFFFFF, None
1224
1225
1226class AttrVI_ATTR_TCPIP_HISLIP_OVERLAP_EN(BooleanAttribute):
1227    """Enables HiSLIP ‘Overlap’ mode.
1228
1229    The value defaults to the mode suggested by the instrument on HiSLIP connection.
1230    If disabled, the connection uses ‘Synchronous’ mode to detect and recover
1231    from interrupted errors. If enabled, the connection uses ‘Overlapped’ mode
1232    to allow overlapped responses. If changed, VISA will do a Device Clear
1233    operation to change the mode.
1234
1235    """
1236
1237    resources = [(constants.InterfaceType.tcpip, "INSTR")]
1238
1239    py_name = ""
1240
1241    visa_name = "VI_ATTR_TCPIP_HISLIP_OVERLAP_EN"
1242
1243    visa_type = "ViBoolean"
1244
1245    default = NotAvailable
1246
1247    read, write, local = True, True, True
1248
1249
1250class AttrVI_ATTR_TCPIP_HISLIP_MAX_MESSAGE_KB(RangeAttribute):
1251    """Maximum HiSLIP message size in kilobytes VISA will accept from a HiSLIP system.
1252
1253    Defaults to 1024 (a 1 MB maximum message size).
1254
1255    """
1256
1257    resources = [(constants.InterfaceType.tcpip, "INSTR")]
1258
1259    py_name = ""
1260
1261    visa_name = "VI_ATTR_TCPIP_HISLIP_MAX_MESSAGE_KB"
1262
1263    visa_type = "ViUint32"
1264
1265    default = 1024
1266
1267    read, write, local = True, True, True
1268
1269    min_value, max_value, values = 0, 0xFFFFFFFF, None
1270
1271
1272class AttrVI_ATTR_GPIB_PRIMARY_ADDR(RangeAttribute):
1273    """Primary address of the GPIB device used by the given session.
1274
1275    For the GPIB INTFC Resource, this attribute is Read-Write.
1276
1277    """
1278
1279    resources = [
1280        (constants.InterfaceType.gpib, "INSTR"),
1281        (constants.InterfaceType.gpib, "INTFC"),
1282    ]
1283
1284    py_name = "primary_address"
1285
1286    visa_name = "VI_ATTR_GPIB_PRIMARY_ADDR"
1287
1288    visa_type = "ViUInt16"
1289
1290    default = NotAvailable
1291
1292    read, write, local = True, True, False
1293
1294    min_value, max_value, values = 0, 30, None
1295
1296
1297class AttrVI_ATTR_GPIB_SECONDARY_ADDR(RangeAttribute):
1298    """Secondary address of the GPIB device used by the given session.
1299
1300    For the GPIB INTFC Resource, this attribute is Read-Write.
1301
1302    """
1303
1304    resources = [
1305        (constants.InterfaceType.gpib, "INSTR"),
1306        (constants.InterfaceType.gpib, "INTFC"),
1307    ]
1308
1309    py_name = "secondary_address"
1310
1311    visa_name = "VI_ATTR_GPIB_SECONDARY_ADDR"
1312
1313    visa_type = "ViUInt16"
1314
1315    default = NotAvailable
1316
1317    read, write, local = True, True, False
1318
1319    min_value, max_value, values = 0, 30, [constants.VI_NO_SEC_ADDR]
1320
1321
1322class AttrVI_ATTR_GPIB_SYS_CNTRL_STATE(BooleanAttribute):
1323    """Is the specified GPIB interface currently the system controller.
1324
1325    In some implementations, this attribute may be modified only through a
1326    configuration utility. On these systems this attribute is read-only (RO).
1327
1328    """
1329
1330    resources = [(constants.InterfaceType.gpib, "INTFC")]
1331
1332    py_name = "is_system_controller"
1333
1334    visa_name = "VI_ATTR_GPIB_SYS_CNTRL_STATE"
1335
1336    visa_type = "ViBoolean"
1337
1338    default = NotAvailable
1339
1340    read, write, local = True, True, False
1341
1342
1343class AttrVI_ATTR_GPIB_CIC_STATE(BooleanAttribute):
1344    """Is the specified GPIB interface currently CIC (Controller In Charge)."""
1345
1346    resources = [(constants.InterfaceType.gpib, "INTFC")]
1347
1348    py_name = "is_controller_in_charge"
1349
1350    visa_name = "VI_ATTR_GPIB_CIC_STATE"
1351
1352    visa_type = "ViBoolean"
1353
1354    default = NotAvailable
1355
1356    read, write, local = True, False, False
1357
1358
1359class AttrVI_ATTR_GPIB_REN_STATE(EnumAttribute):
1360    """Current state of the GPIB REN (Remote ENable) interface line."""
1361
1362    resources = [
1363        (constants.InterfaceType.gpib, "INSTR"),
1364        (constants.InterfaceType.gpib, "INTFC"),
1365    ]
1366
1367    py_name = "remote_enabled"
1368
1369    visa_name = "VI_ATTR_GPIB_REN_STATE"
1370
1371    visa_type = "ViInt16"
1372
1373    default = NotAvailable
1374
1375    read, write, local = True, False, False
1376
1377    enum_type = constants.LineState
1378
1379
1380class AttrVI_ATTR_GPIB_ATN_STATE(EnumAttribute):
1381    """Current state of the GPIB ATN (ATtentioN) interface line."""
1382
1383    resources = [(constants.InterfaceType.gpib, "INTFC")]
1384
1385    py_name = "atn_state"
1386
1387    visa_name = "VI_ATTR_GPIB_ATN_STATE"
1388
1389    visa_type = "ViInt16"
1390
1391    default = NotAvailable
1392
1393    read, write, local = True, False, False
1394
1395    enum_type = constants.LineState
1396
1397
1398class AttrVI_ATTR_GPIB_NDAC_STATE(EnumAttribute):
1399    """Current state of the GPIB NDAC (Not Data ACcepted) interface line."""
1400
1401    resources = [(constants.InterfaceType.gpib, "INTFC")]
1402
1403    py_name = "ndac_state"
1404
1405    visa_name = "VI_ATTR_GPIB_NDAC_STATE"
1406
1407    visa_type = "ViInt16"
1408
1409    default = NotAvailable
1410
1411    read, write, local = True, False, False
1412
1413    enum_type = constants.LineState
1414
1415
1416class AttrVI_ATTR_GPIB_SRQ_STATE(EnumAttribute):
1417    """Current state of the GPIB SRQ (Service ReQuest) interface line."""
1418
1419    resources = [(constants.InterfaceType.gpib, "INTFC")]
1420
1421    py_name = ""
1422
1423    visa_name = "VI_ATTR_GPIB_SRQ_STATE"
1424
1425    visa_type = "ViInt16"
1426
1427    default = NotAvailable
1428
1429    read, write, local = True, False, False
1430
1431    enum_type = constants.LineState
1432
1433
1434class AttrVI_ATTR_GPIB_ADDR_STATE(EnumAttribute):
1435    """Current state of the GPIB interface.
1436
1437    The interface can be addressed to talk or listen, or not addressed.
1438
1439    """
1440
1441    resources = [(constants.InterfaceType.gpib, "INTFC")]
1442
1443    py_name = "address_state"
1444
1445    visa_name = "VI_ATTR_GPIB_ADDR_STATE"
1446
1447    visa_type = "ViInt16"
1448
1449    default = NotAvailable
1450
1451    read, write, local = True, False, False
1452
1453    enum_type = constants.AddressState
1454
1455
1456class AttrVI_ATTR_GPIB_UNADDR_EN(BooleanAttribute):
1457    """Whether to unaddress the device (UNT and UNL) after each read/write operation."""
1458
1459    resources = [(constants.InterfaceType.gpib, "INSTR")]
1460
1461    py_name = "enable_unaddressing"
1462
1463    visa_name = "VI_ATTR_GPIB_UNADDR_EN"
1464
1465    visa_type = "ViBoolean"
1466
1467    default = False
1468
1469    read, write, local = True, True, True
1470
1471
1472class AttrVI_ATTR_GPIB_READDR_EN(BooleanAttribute):
1473    """Whether to use repeat addressing before each read/write operation."""
1474
1475    resources = [(constants.InterfaceType.gpib, "INSTR")]
1476
1477    py_name = "enable_repeat_addressing"
1478
1479    visa_name = "VI_ATTR_GPIB_READDR_EN"
1480
1481    visa_type = "ViBoolean"
1482
1483    default = True
1484
1485    read, write, local = True, True, True
1486
1487
1488class AttrVI_ATTR_GPIB_HS488_CBL_LEN(RangeAttribute):
1489    """Total number of meters of GPIB cable used in the specified GPIB interface."""
1490
1491    resources = [(constants.InterfaceType.gpib, "INTFC")]
1492
1493    py_name = ""
1494
1495    visa_name = "VI_ATTR_GPIB_HS488_CBL_LEN"
1496
1497    visa_type = "ViInt16"
1498
1499    default = NotAvailable
1500
1501    read, write, local = True, True, False
1502
1503    min_value, max_value, values = (
1504        1,
1505        15,
1506        [constants.VI_GPIB_HS488_DISABLED, constants.VI_GPIB_HS488_NIMPL],
1507    )
1508
1509
1510class AttrVI_ATTR_ASRL_AVAIL_NUM(RangeAttribute):
1511    """Number of bytes available in the low- level I/O receive buffer."""
1512
1513    resources = [(constants.InterfaceType.asrl, "INSTR")]
1514
1515    py_name = "bytes_in_buffer"
1516
1517    visa_name = "VI_ATTR_ASRL_AVAIL_NUM"
1518
1519    visa_type = "ViUInt32"
1520
1521    default = NotAvailable
1522
1523    read, write, local = True, False, False
1524
1525    min_value, max_value, values = 0, 0xFFFFFFFF, None
1526
1527
1528class AttrVI_ATTR_ASRL_BAUD(RangeAttribute):
1529    """Baud rate of the interface.
1530
1531    It is represented as an unsigned 32-bit integer so that any baud rate can
1532    be used, but it usually requires a commonly used rate such as 300, 1200,
1533    2400, or 9600 baud.
1534
1535    """
1536
1537    resources = [(constants.InterfaceType.asrl, "INSTR")]
1538
1539    py_name = "baud_rate"
1540
1541    visa_name = "VI_ATTR_ASRL_BAUD"
1542
1543    visa_type = "ViUInt32"
1544
1545    default = 9600
1546
1547    read, write, local = True, True, False
1548
1549    min_value, max_value, values = 0, 0xFFFFFFFF, None
1550
1551
1552class AttrVI_ATTR_ASRL_DATA_BITS(RangeAttribute):
1553    """Number of data bits contained in each frame (from 5 to 8).
1554
1555    The data bits for each frame are located in the low-order bits of every
1556    byte stored in memory.
1557
1558    """
1559
1560    resources = [(constants.InterfaceType.asrl, "INSTR")]
1561
1562    py_name = "data_bits"
1563
1564    visa_name = "VI_ATTR_ASRL_DATA_BITS"
1565
1566    visa_type = "ViUInt16"
1567
1568    default = 8
1569
1570    read, write, local = True, True, False
1571
1572    min_value, max_value, values = 5, 8, None
1573
1574
1575class AttrVI_ATTR_ASRL_PARITY(EnumAttribute):
1576    """Parity used with every frame transmitted and received."""
1577
1578    resources = [(constants.InterfaceType.asrl, "INSTR")]
1579
1580    py_name = "parity"
1581
1582    visa_name = "VI_ATTR_ASRL_PARITY"
1583
1584    visa_type = "ViUInt16"
1585
1586    default = constants.Parity.none
1587
1588    read, write, local = True, True, False
1589
1590    enum_type = constants.Parity
1591
1592
1593class AttrVI_ATTR_ASRL_STOP_BITS(EnumAttribute):
1594    """Number of stop bits used to indicate the end of a frame.
1595
1596    The value VI_ASRL_STOP_ONE5 indicates one-and-one-half (1.5) stop bits.
1597
1598    """
1599
1600    resources = [(constants.InterfaceType.asrl, "INSTR")]
1601
1602    py_name = "stop_bits"
1603
1604    visa_name = "VI_ATTR_ASRL_STOP_BITS"
1605
1606    visa_type = "ViUInt16"
1607
1608    default = constants.StopBits.one
1609
1610    read, write, local = True, True, False
1611
1612    enum_type = constants.StopBits
1613
1614
1615class AttrVI_ATTR_ASRL_FLOW_CNTRL(EnumAttribute):
1616    """Indicate the type of flow control used by the transfer mechanism."""
1617
1618    resources = [(constants.InterfaceType.asrl, "INSTR")]
1619
1620    py_name = "flow_control"
1621
1622    visa_name = "VI_ATTR_ASRL_FLOW_CNTRL"
1623
1624    visa_type = "ViUInt16"
1625
1626    default = constants.VI_ASRL_FLOW_NONE
1627
1628    read, write, local = True, True, False
1629
1630    enum_type = constants.ControlFlow
1631
1632
1633class AttrVI_ATTR_ASRL_DISCARD_NULL(BooleanAttribute):
1634    """If set to True, NUL characters are discarded.
1635
1636    Otherwise, they are treated as normal data characters. For binary transfers,
1637    set this attribute to VI_FALSE.
1638
1639    """
1640
1641    resources = [(constants.InterfaceType.asrl, "INSTR")]
1642
1643    py_name = "discard_null"
1644
1645    visa_name = "VI_ATTR_ASRL_DISCARD_NULL"
1646
1647    visa_type = "ViBoolean"
1648
1649    default = False
1650
1651    read, write, local = True, True, False
1652
1653
1654class AttrVI_ATTR_ASRL_CONNECTED(BooleanAttribute):
1655    """Whether the port is properly connected to another port or device.
1656
1657    This attribute is valid only with serial drivers developed by National
1658    Instruments and documented to support this feature with the corresponding
1659    National Instruments hardware.
1660
1661    """
1662
1663    resources = [(constants.InterfaceType.asrl, "INSTR")]
1664
1665    py_name = ""
1666
1667    visa_name = "VI_ATTR_ASRL_CONNECTED"
1668
1669    visa_type = "ViBoolean"
1670
1671    default = NotAvailable
1672
1673    read, write, local = True, False, False
1674
1675
1676class AttrVI_ATTR_ASRL_ALLOW_TRANSMIT(BooleanAttribute):
1677    """Manually control transmission.
1678
1679    If set to False, suspend transmission as if an XOFF character has been received.
1680
1681    If set to True, it resumes transmission as if an XON character has been received.
1682
1683    """
1684
1685    resources = [(constants.InterfaceType.asrl, "INSTR")]
1686
1687    py_name = "allow_transmit"
1688
1689    visa_name = "VI_ATTR_ASRL_ALLOW_TRANSMIT"
1690
1691    visa_type = "ViBoolean"
1692
1693    default = True
1694
1695    read, write, local = True, True, False
1696
1697
1698class AttrVI_ATTR_ASRL_END_IN(EnumAttribute):
1699    """Method used to terminate read operations."""
1700
1701    resources = [(constants.InterfaceType.asrl, "INSTR")]
1702
1703    py_name = "end_input"
1704
1705    visa_name = "VI_ATTR_ASRL_END_IN"
1706
1707    visa_type = "ViUInt16"
1708
1709    default = constants.SerialTermination.termination_char
1710
1711    read, write, local = True, True, True
1712
1713    enum_type = constants.SerialTermination
1714
1715
1716class AttrVI_ATTR_ASRL_END_OUT(EnumAttribute):
1717    """Method used to terminate write operations."""
1718
1719    resources = [(constants.InterfaceType.asrl, "INSTR")]
1720
1721    py_name = "end_output"
1722
1723    visa_name = "VI_ATTR_ASRL_END_OUT"
1724
1725    visa_type = "ViUInt16"
1726
1727    default = constants.SerialTermination.none
1728
1729    read, write, local = True, True, True
1730
1731    enum_type = constants.SerialTermination
1732
1733
1734class AttrVI_ATTR_ASRL_BREAK_LEN(RangeAttribute):
1735    """Duration (in milliseconds) of the break signal.
1736
1737    The break signal is asserted when VI_ATTR_ASRL_END_OUT is set to
1738    constants.SerialTermination.termination_break. If you want to control the
1739    assertion state and length of a break signal manually, use the
1740    VI_ATTR_ASRL_BREAK_STATE attribute instead.
1741
1742    """
1743
1744    resources = [(constants.InterfaceType.asrl, "INSTR")]
1745
1746    py_name = "break_length"
1747
1748    visa_name = "VI_ATTR_ASRL_BREAK_LEN"
1749
1750    visa_type = "ViInt16"
1751
1752    default = 250
1753
1754    read, write, local = True, True, True
1755
1756    min_value, max_value, values = -32768, 32767, None
1757
1758
1759class AttrVI_ATTR_ASRL_BREAK_STATE(EnumAttribute):
1760    """Manually control the assertion state of the break signal.
1761
1762    If set to constants.LineState.asserted, it suspends character transmission
1763    and places the transmission line in a break state until this attribute
1764    is reset to constants.LineState.unasserted.
1765
1766    If you want VISA to send a break signal after each write operation
1767    automatically, use the VI_ATTR_ASRL_BREAK_LEN and VI_ATTR_ASRL_END_OUT
1768    attributes instead.
1769
1770    """
1771
1772    resources = [(constants.InterfaceType.asrl, "INSTR")]
1773
1774    py_name = "break_state"
1775
1776    visa_name = "VI_ATTR_ASRL_BREAK_STATE"
1777
1778    visa_type = "ViInt16"
1779
1780    default = constants.LineState.unasserted
1781
1782    read, write, local = True, True, False
1783
1784    enum_type = constants.LineState
1785
1786
1787class AttrVI_ATTR_ASRL_REPLACE_CHAR(CharAttribute):
1788    """Character to be used to replace incoming characters that arrive with errors.
1789
1790    This refers for example to character that arrives with parity error.
1791
1792    """
1793
1794    resources = [(constants.InterfaceType.asrl, "INSTR")]
1795
1796    py_name = "replace_char"
1797
1798    visa_name = "VI_ATTR_ASRL_REPLACE_CHAR"
1799
1800    visa_type = "ViUInt8"
1801
1802    default = 0
1803
1804    read, write, local = True, True, True
1805
1806
1807class AttrVI_ATTR_ASRL_XOFF_CHAR(CharAttribute):
1808    """XOFF character used for XON/XOFF flow control (both directions).
1809
1810    If XON/XOFF flow control (software handshaking) is not being used, the value of
1811    this attribute is ignored.
1812
1813    """
1814
1815    resources = [(constants.InterfaceType.asrl, "INSTR")]
1816
1817    py_name = "xoff_char"
1818
1819    visa_name = "VI_ATTR_ASRL_XOFF_CHAR"
1820
1821    visa_type = "ViUInt8"
1822
1823    default = 0x13
1824
1825    read, write, local = True, True, True
1826
1827
1828class AttrVI_ATTR_ASRL_XON_CHAR(CharAttribute):
1829    """XON character used for XON/XOFF flow control (both directions).
1830
1831    If XON/XOFF flow control (software handshaking) is not being used, the value of
1832    this attribute is ignored.
1833
1834    """
1835
1836    resources = [(constants.InterfaceType.asrl, "INSTR")]
1837
1838    py_name = "xon_char"
1839
1840    visa_name = "VI_ATTR_ASRL_XON_CHAR"
1841
1842    visa_type = "ViUInt8"
1843
1844    default = 0x11
1845
1846    read, write, local = True, True, True
1847
1848
1849class AttrVI_ATTR_ASRL_CTS_STATE(EnumAttribute):
1850    """Current state of the Clear To Send (CTS) input signal."""
1851
1852    resources = [(constants.InterfaceType.asrl, "INSTR")]
1853
1854    py_name = ""
1855
1856    visa_name = "VI_ATTR_ASRL_CTS_STATE"
1857
1858    visa_type = "ViInt16"
1859
1860    default = NotAvailable
1861
1862    read, write, local = True, False, False
1863
1864    enum_type = constants.LineState
1865
1866
1867class AttrVI_ATTR_ASRL_DSR_STATE(EnumAttribute):
1868    """Current state of the Data Set Ready (DSR) input signal."""
1869
1870    resources = [(constants.InterfaceType.asrl, "INSTR")]
1871
1872    py_name = ""
1873
1874    visa_name = "VI_ATTR_ASRL_DSR_STATE"
1875
1876    visa_type = "ViInt16"
1877
1878    default = NotAvailable
1879
1880    read, write, local = True, False, False
1881
1882    enum_type = constants.LineState
1883
1884
1885class AttrVI_ATTR_ASRL_DTR_STATE(EnumAttribute):
1886    """Current state of the Data Terminal Ready (DTR) input signal."""
1887
1888    resources = [(constants.InterfaceType.asrl, "INSTR")]
1889
1890    py_name = ""
1891
1892    visa_name = "VI_ATTR_ASRL_DTR_STATE"
1893
1894    visa_type = "ViInt16"
1895
1896    default = NotAvailable
1897
1898    read, write, local = True, True, False
1899
1900    enum_type = constants.LineState
1901
1902
1903class AttrVI_ATTR_ASRL_RTS_STATE(EnumAttribute):
1904    """Manually assert or unassert the Request To Send (RTS) output signal."""
1905
1906    resources = [(constants.InterfaceType.asrl, "INSTR")]
1907
1908    py_name = ""
1909
1910    visa_name = "VI_ATTR_ASRL_RTS_STATE"
1911
1912    visa_type = "ViInt16"
1913
1914    default = NotAvailable
1915
1916    read, write, local = True, True, False
1917
1918    enum_type = constants.LineState
1919
1920
1921class AttrVI_ATTR_ASRL_WIRE_MODE(EnumAttribute):
1922    """Current wire/transceiver mode.
1923
1924    For RS-485 hardware, this attribute is valid only with the RS-485 serial
1925    driver developed by National Instruments.
1926
1927    For RS-232 hardware, the values RS232/DCE and RS232/AUTO are valid only
1928    with RS-232 serial drivers developed by National Instruments and documented
1929    to support this feature with the corresponding National Instruments hardware.
1930    When this feature is not supported, RS232/DTE is the only valid value.
1931
1932    """
1933
1934    resources = [(constants.InterfaceType.asrl, "INSTR")]
1935
1936    py_name = ""
1937
1938    visa_name = "VI_ATTR_ASRL_WIRE_MODE"
1939
1940    visa_type = "ViInt16"
1941
1942    default = NotAvailable
1943
1944    read, write, local = True, True, False
1945
1946    enum_type = constants.WireMode
1947
1948
1949class AttrVI_ATTR_ASRL_DCD_STATE(EnumAttribute):
1950    """Current state of the Data Carrier Detect (DCD) input signal.
1951
1952    The DCD signal is often used by modems to indicate the detection of a
1953    carrier (remote modem) on the telephone line. The DCD signal is also known
1954    as Receive Line Signal Detect (RLSD).
1955
1956    This attribute is Read Only except when the VI_ATTR_ASRL_WIRE_MODE attribute
1957    is set to VI_ASRL_WIRE_232_DCE, or VI_ASRL_WIRE_232_AUTO with the hardware
1958    currently in the DCE state.
1959
1960    """
1961
1962    resources = [(constants.InterfaceType.asrl, "INSTR")]
1963
1964    py_name = ""
1965
1966    visa_name = "VI_ATTR_ASRL_DCD_STATE"
1967
1968    visa_type = "ViInt16"
1969
1970    default = NotAvailable
1971
1972    read, write, local = True, True, False
1973
1974    enum_type = constants.LineState
1975
1976
1977class AttrVI_ATTR_ASRL_RI_STATE(EnumAttribute):
1978    """Current state of the Ring Indicator (RI) input signal.
1979
1980    The RI signal is often used by modems to indicate that the telephone line
1981    is ringing. This attribute is Read Only except when the VI_ATTR_ASRL_WIRE_MODE
1982    attribute is set to VI_ASRL_WIRE_232_DCE, or VI_ASRL_WIRE_232_AUTO with the
1983    hardware currently in the DCE state.
1984
1985    """
1986
1987    resources = [(constants.InterfaceType.asrl, "INSTR")]
1988
1989    py_name = ""
1990
1991    visa_name = "VI_ATTR_ASRL_RI_STATE"
1992
1993    visa_type = "ViInt16"
1994
1995    default = NotAvailable
1996
1997    read, write, local = True, True, False
1998
1999    enum_type = constants.LineState
2000
2001
2002class AttrVI_ATTR_USB_INTFC_NUM(RangeAttribute):
2003    """USB interface number used by the given session."""
2004
2005    resources = [
2006        (constants.InterfaceType.usb, "INSTR"),
2007        (constants.InterfaceType.usb, "RAW"),
2008    ]
2009
2010    py_name = "interface_number"
2011
2012    visa_name = "VI_ATTR_USB_INTFC_NUM"
2013
2014    visa_type = "ViInt16"
2015
2016    default = 0
2017
2018    read, write, local = True, False, False
2019
2020    min_value, max_value, values = 0, 0xFE, None
2021
2022
2023class AttrVI_ATTR_USB_SERIAL_NUM(Attribute):
2024    """USB serial number of this device."""
2025
2026    resources = [
2027        (constants.InterfaceType.usb, "INSTR"),
2028        (constants.InterfaceType.usb, "RAW"),
2029    ]
2030
2031    py_name = "serial_number"
2032
2033    visa_name = "VI_ATTR_USB_SERIAL_NUM"
2034
2035    visa_type = "ViString"
2036
2037    default = NotAvailable
2038
2039    read, write, local = True, False, False
2040
2041
2042class AttrVI_ATTR_USB_PROTOCOL(RangeAttribute):
2043    """USB protocol used by this USB interface."""
2044
2045    resources = [
2046        (constants.InterfaceType.usb, "INSTR"),
2047        (constants.InterfaceType.usb, "RAW"),
2048    ]
2049
2050    py_name = "usb_protocol"
2051
2052    visa_name = "VI_ATTR_USB_PROTOCOL"
2053
2054    visa_type = "ViInt16"
2055
2056    default = NotAvailable
2057
2058    read, write, local = True, False, False
2059
2060    min_value, max_value, values = 0, 0xFF, None
2061
2062
2063class AttrVI_ATTR_USB_MAX_INTR_SIZE(RangeAttribute):
2064    """Maximum size of data that will be stored by any given USB interrupt.
2065
2066    If a USB interrupt contains more data than this size, the data in excess of
2067    this size will be lost.
2068
2069    """
2070
2071    resources = [
2072        (constants.InterfaceType.usb, "INSTR"),
2073        (constants.InterfaceType.usb, "RAW"),
2074    ]
2075
2076    py_name = "maximum_interrupt_size"
2077
2078    visa_name = "VI_ATTR_USB_MAX_INTR_SIZE"
2079
2080    visa_type = "ViUInt16"
2081
2082    default = NotAvailable
2083
2084    read, write, local = True, True, True
2085
2086    min_value, max_value, values = 0, 0xFFFF, None
2087
2088
2089class AttrVI_ATTR_USB_CLASS(RangeAttribute):
2090    """USB class used by this USB interface."""
2091
2092    resources = [(constants.InterfaceType.usb, "RAW")]
2093
2094    py_name = ""
2095
2096    visa_name = "VI_ATTR_USB_CLASS"
2097
2098    visa_type = "ViInt16"
2099
2100    default = NotAvailable
2101
2102    read, write, local = True, False, False
2103
2104    min_value, max_value, values = 0, 0xFF, None
2105
2106
2107class AttrVI_ATTR_USB_SUBCLASS(RangeAttribute):
2108    """USB subclass used by this USB interface."""
2109
2110    resources = [(constants.InterfaceType.usb, "RAW")]
2111
2112    py_name = ""
2113
2114    visa_name = "VI_ATTR_USB_SUBCLASS"
2115
2116    visa_type = "ViInt16"
2117
2118    default = NotAvailable
2119
2120    read, write, local = True, False, False
2121
2122    min_value, max_value, values = 0, 0xFF, None
2123
2124
2125class AttrVI_ATTR_USB_BULK_IN_STATUS(RangeAttribute):
2126    """Status of the USB bulk-in pipe used by the given session is stalled or ready.
2127
2128    This attribute can be set to only VI_USB_PIPE_READY.
2129
2130    """
2131
2132    resources = [(constants.InterfaceType.usb, "RAW")]
2133
2134    py_name = ""
2135
2136    visa_name = "VI_ATTR_USB_BULK_IN_STATUS"
2137
2138    visa_type = "ViInt16"
2139
2140    default = NotAvailable
2141
2142    read, write, local = True, True, True
2143
2144    min_value, max_value, values = -32768, 32767, None
2145
2146
2147class AttrVI_ATTR_USB_BULK_IN_PIPE(RangeAttribute):
2148    """Endpoint address of the USB bulk-in pipe used by the given session.
2149
2150    An initial value of -1 signifies that this resource does not have any
2151    bulk-in pipes. This endpoint is used in viRead and related operations.
2152
2153    """
2154
2155    resources = [(constants.InterfaceType.usb, "RAW")]
2156
2157    py_name = ""
2158
2159    visa_name = "VI_ATTR_USB_BULK_IN_PIPE"
2160
2161    visa_type = "ViInt16"
2162
2163    default = NotAvailable
2164
2165    read, write, local = True, True, True
2166
2167    min_value, max_value, values = 0x81, 0x8F, [-1]
2168
2169
2170class AttrVI_ATTR_USB_BULK_OUT_STATUS(RangeAttribute):
2171    """Status of the USB bulk-out or interrupt-out pipe used by the given session.
2172
2173    The status can be stalled or ready.
2174
2175    This attribute can be set to only VI_USB_PIPE_READY.
2176
2177    """
2178
2179    resources = [(constants.InterfaceType.usb, "RAW")]
2180
2181    py_name = ""
2182
2183    visa_name = "VI_ATTR_USB_BULK_OUT_STATUS"
2184
2185    visa_type = "ViInt16"
2186
2187    default = NotAvailable
2188
2189    read, write, local = True, True, True
2190
2191    min_value, max_value, values = -32768, 32767, None
2192
2193
2194class AttrVI_ATTR_USB_BULK_OUT_PIPE(RangeAttribute):
2195    """Endpoint address of the USB bulk-out or interrupt-out pipe.
2196
2197    An initial value of –1 signifies that this resource does not have any
2198    bulk-out or interrupt-out pipes. This endpoint is used in viWrite
2199    and related operations.
2200
2201    """
2202
2203    resources = [(constants.InterfaceType.usb, "RAW")]
2204
2205    py_name = ""
2206
2207    visa_name = "VI_ATTR_USB_BULK_OUT_PIPE"
2208
2209    visa_type = "ViInt16"
2210
2211    default = NotAvailable
2212
2213    read, write, local = True, True, True
2214
2215    min_value, max_value, values = 0x01, 0x0F, [-1]
2216
2217
2218class AttrVI_ATTR_USB_INTR_IN_PIPE(RangeAttribute):
2219    """Endpoint address of the USB interrupt-in pipe used by the given session.
2220
2221    An initial value of -1 signifies that this resource does not have any
2222    interrupt-in pipes. This endpoint is used in viEnableEvent for VI_EVENT_USB_INTR.
2223
2224    """
2225
2226    resources = [(constants.InterfaceType.usb, "RAW")]
2227
2228    py_name = ""
2229
2230    visa_name = "VI_ATTR_USB_INTR_IN_PIPE"
2231
2232    visa_type = "ViInt16"
2233
2234    default = NotAvailable
2235
2236    read, write, local = True, True, True
2237
2238    min_value, max_value, values = 0x81, 0x8F, [-1]
2239
2240
2241class AttrVI_ATTR_USB_ALT_SETTING(RangeAttribute):
2242    """USB alternate setting used by this USB interface."""
2243
2244    resources = [(constants.InterfaceType.usb, "RAW")]
2245
2246    py_name = ""
2247
2248    visa_name = "VI_ATTR_USB_ALT_SETTING"
2249
2250    visa_type = "ViInt16"
2251
2252    default = 0
2253
2254    read, write, local = True, True, False
2255
2256    min_value, max_value, values = 0, 0xFF, None
2257
2258
2259class AttrVI_ATTR_USB_END_IN(EnumAttribute):
2260    """Method used to terminate read operations."""
2261
2262    resources = [(constants.InterfaceType.usb, "RAW")]
2263
2264    py_name = ""
2265
2266    visa_name = "VI_ATTR_USB_END_IN"
2267
2268    visa_type = "ViUInt16"
2269
2270    default = constants.VI_USB_END_SHORT_OR_COUNT
2271
2272    read, write, local = True, True, True
2273
2274    enum_type = constants.USBEndInput
2275
2276
2277class AttrVI_ATTR_USB_NUM_INTFCS(RangeAttribute):
2278    """Number of interfaces supported by this USB device."""
2279
2280    resources = [(constants.InterfaceType.usb, "RAW")]
2281
2282    py_name = ""
2283
2284    visa_name = "VI_ATTR_USB_NUM_INTFCS"
2285
2286    visa_type = "ViInt16"
2287
2288    default = NotAvailable
2289
2290    read, write, local = True, False, False
2291
2292    min_value, max_value, values = 1, 0xFF, None
2293
2294
2295class AttrVI_ATTR_USB_NUM_PIPES(RangeAttribute):
2296    """Number of pipes supported by this USB interface.
2297
2298    This does not include the default control pipe.
2299
2300    """
2301
2302    resources = [(constants.InterfaceType.usb, "RAW")]
2303
2304    py_name = ""
2305
2306    visa_name = "VI_ATTR_USB_NUM_PIPES"
2307
2308    visa_type = "ViInt16"
2309
2310    default = NotAvailable
2311
2312    read, write, local = True, False, False
2313
2314    min_value, max_value, values = 0, 30, None
2315
2316
2317class AttrVI_ATTR_USB_INTR_IN_STATUS(RangeAttribute):
2318    """Whether the USB interrupt-in pipe used by the given session is stalled or ready.
2319
2320    This attribute can be set to only VI_USB_PIPE_READY.
2321
2322    """
2323
2324    resources = [(constants.InterfaceType.usb, "RAW")]
2325
2326    py_name = ""
2327
2328    visa_name = "VI_ATTR_USB_INTR_IN_STATUS"
2329
2330    visa_type = "ViInt16"
2331
2332    default = NotAvailable
2333
2334    read, write, local = True, True, True
2335
2336    min_value, max_value, values = -32768, 32767, None
2337
2338
2339class AttrVI_ATTR_USB_CTRL_PIPE(RangeAttribute):
2340    """Endpoint address of the USB control pipe used by the given session.
2341
2342    A value of 0 signifies that the default control pipe will be used.
2343    This endpoint is used in viUsbControlIn and viUsbControlOut operations.
2344    Nonzero values may not be supported on all platforms.
2345
2346    """
2347
2348    resources = [(constants.InterfaceType.usb, "RAW")]
2349
2350    py_name = ""
2351
2352    visa_name = "VI_ATTR_USB_CTRL_PIPE"
2353
2354    visa_type = "ViInt16"
2355
2356    default = 0x00
2357
2358    read, write, local = True, True, True
2359
2360    min_value, max_value, values = 0x00, 0x0F, None
2361
2362
2363class AttrVI_ATTR_MANF_NAME(Attribute):
2364    """Manufacturer name."""
2365
2366    resources = [
2367        (constants.InterfaceType.pxi, "INSTR"),
2368        (constants.InterfaceType.pxi, "BACKPLANE"),
2369        (constants.InterfaceType.usb, "INSTR"),
2370        (constants.InterfaceType.usb, "RAW"),
2371        (constants.InterfaceType.vxi, "INSTR"),
2372    ]
2373
2374    py_name = "manufacturer_name"
2375
2376    visa_name = "VI_ATTR_MANF_NAME"
2377
2378    visa_type = "ViString"
2379
2380    default = NotAvailable
2381
2382    read, write, local = True, False, False
2383
2384
2385class AttrVI_ATTR_MANF_ID(RangeAttribute):
2386    """Manufacturer identification number of the device."""
2387
2388    resources = [
2389        (constants.InterfaceType.pxi, "INSTR"),
2390        (constants.InterfaceType.usb, "INSTR"),
2391        (constants.InterfaceType.usb, "RAW"),
2392        (constants.InterfaceType.vxi, "INSTR"),
2393    ]
2394
2395    py_name = "manufacturer_id"
2396
2397    visa_name = "VI_ATTR_MANF_ID"
2398
2399    visa_type = "ViUInt16"
2400
2401    default = NotAvailable
2402
2403    read, write, local = True, False, False
2404
2405    min_value, max_value, values = 0x0, 0xFFFF, None
2406
2407
2408class AttrVI_ATTR_MODEL_NAME(Attribute):
2409    """Model name of the device."""
2410
2411    resources = [
2412        (constants.InterfaceType.pxi, "INSTR"),
2413        (constants.InterfaceType.pxi, "BACKPLANE"),
2414        (constants.InterfaceType.usb, "INSTR"),
2415        (constants.InterfaceType.usb, "RAW"),
2416        (constants.InterfaceType.vxi, "INSTR"),
2417    ]
2418
2419    py_name = "model_name"
2420
2421    visa_name = "VI_ATTR_MODEL_NAME"
2422
2423    visa_type = "ViString"
2424
2425    default = NotAvailable
2426
2427    read, write, local = True, False, False
2428
2429
2430class AttrVI_ATTR_MODEL_CODE(RangeAttribute):
2431    """Model code for the device."""
2432
2433    resources = [
2434        (constants.InterfaceType.pxi, "INSTR"),
2435        (constants.InterfaceType.usb, "INSTR"),
2436        (constants.InterfaceType.usb, "RAW"),
2437        (constants.InterfaceType.vxi, "INSTR"),
2438    ]
2439
2440    py_name = "model_code"
2441
2442    visa_name = "VI_ATTR_MODEL_CODE"
2443
2444    visa_type = "ViUInt16"
2445
2446    default = NotAvailable
2447
2448    read, write, local = True, False, False
2449
2450    min_value, max_value, values = 0x0, 0xFFFF, None
2451
2452
2453class AttrVI_ATTR_DEV_STATUS_BYTE(CharAttribute):
2454    """488-style status byte of the local controller or device for this session."""
2455
2456    resources = [
2457        (constants.InterfaceType.gpib, "INTFC"),
2458        (constants.InterfaceType.vxi, "SERVANT"),
2459    ]
2460
2461    py_name = ""
2462
2463    visa_name = "VI_ATTR_DEV_STATUS_BYTE"
2464
2465    visa_type = "ViUInt8"
2466
2467    default = NotAvailable
2468
2469    read, write, local = True, True, False
2470
2471
2472class AttrVI_ATTR_4882_COMPLIANT(BooleanAttribute):
2473    """Whether the device is 488.2 compliant."""
2474
2475    resources = [
2476        (constants.InterfaceType.usb, "INSTR"),
2477        (constants.InterfaceType.vxi, "INSTR"),
2478    ]
2479
2480    py_name = "is_4882_compliant"
2481
2482    visa_name = "VI_ATTR_4882_COMPLIANT"
2483
2484    visa_type = "ViBoolean"
2485
2486    default = NotAvailable
2487
2488    read, write, local = True, False, False
2489
2490
2491class AttrVI_ATTR_SLOT(RangeAttribute):
2492    """Physical slot location of the device.
2493
2494    If the slot number is not known, VI_UNKNOWN_SLOT is returned.
2495
2496    For VXI resources the maximum value is 12, 18 is the maximum for PXI resources.
2497
2498    """
2499
2500    resources = [
2501        (constants.InterfaceType.pxi, "INSTR"),
2502        (constants.InterfaceType.vxi, "INSTR"),
2503    ]
2504
2505    py_name = ""
2506
2507    visa_name = "VI_ATTR_SLOT"
2508
2509    visa_type = "ViInt16"
2510
2511    default = NotAvailable
2512
2513    read, write, local = True, False, False
2514
2515    min_value, max_value, values = 1, 18, [constants.VI_UNKNOWN_SLOT]
2516
2517
2518class AttrVI_ATTR_WIN_ACCESS(RangeAttribute):
2519    """Modes in which the current window may be accessed."""
2520
2521    resources = [
2522        (constants.InterfaceType.pxi, "INSTR"),
2523        (constants.InterfaceType.pxi, "MEMACC"),
2524        (constants.InterfaceType.vxi, "INSTR"),
2525        (constants.InterfaceType.vxi, "MEMACC"),
2526    ]
2527
2528    py_name = ""
2529
2530    visa_name = "VI_ATTR_WIN_ACCESS"
2531
2532    visa_type = "ViUInt16"
2533
2534    default = constants.VI_NMAPPED
2535
2536    read, write, local = True, False, True
2537
2538    min_value, max_value, values = 0, 65535, None
2539
2540
2541class AttrVI_ATTR_WIN_BASE_ADDR(RangeAttribute):
2542    """Base address of the interface bus to which this window is mapped."""
2543
2544    resources = [
2545        (constants.InterfaceType.pxi, "INSTR"),
2546        (constants.InterfaceType.pxi, "MEMACC"),
2547        (constants.InterfaceType.vxi, "INSTR"),
2548        (constants.InterfaceType.vxi, "MEMACC"),
2549    ]
2550
2551    py_name = ""
2552
2553    visa_name = "VI_ATTR_WIN_BASE_ADDR"
2554
2555    visa_type = "ViBusAddress64" if constants.is_64bits else "ViBusAddress"
2556
2557    default = NotAvailable
2558
2559    read, write, local = True, False, True
2560
2561    min_value, max_value, values = (
2562        0,
2563        0xFFFFFFFFFFFFFFFF if constants.is_64bits else 0xFFFFFFFF,
2564        None,
2565    )
2566
2567
2568class AttrVI_ATTR_WIN_SIZE(RangeAttribute):
2569    """Base address of the interface bus to which this window is mapped."""
2570
2571    resources = [
2572        (constants.InterfaceType.pxi, "INSTR"),
2573        (constants.InterfaceType.pxi, "MEMACC"),
2574        (constants.InterfaceType.vxi, "INSTR"),
2575        (constants.InterfaceType.vxi, "MEMACC"),
2576    ]
2577
2578    py_name = ""
2579
2580    visa_name = "VI_ATTR_WIN_SIZE"
2581
2582    visa_type = "ViBusSize64" if constants.is_64bits else "ViBusSize"
2583
2584    default = NotAvailable
2585
2586    read, write, local = True, False, True
2587
2588    min_value, max_value, values = (
2589        0,
2590        0xFFFFFFFFFFFFFFFF if constants.is_64bits else 0xFFFFFFFF,
2591        None,
2592    )
2593
2594
2595class AttrVI_ATTR_SRC_INCREMENT(RangeAttribute):
2596    """Number of elements by which to increment the source offset after a transfer.
2597
2598    The default value of this attribute is 1 (that is, the source address will be
2599    incremented by 1 after each transfer), and the viMoveInXX() operations move from
2600    consecutive elements. If this attribute is set to 0, the viMoveInXX() operations
2601    will always read from the same element, essentially treating the source as a
2602    FIFO register.
2603
2604    """
2605
2606    resources = [
2607        (constants.InterfaceType.pxi, "INSTR"),
2608        (constants.InterfaceType.pxi, "MEMACC"),
2609        (constants.InterfaceType.vxi, "INSTR"),
2610        (constants.InterfaceType.vxi, "MEMACC"),
2611    ]
2612
2613    py_name = "source_increment"
2614
2615    visa_name = "VI_ATTR_SRC_INCREMENT"
2616
2617    visa_type = "ViInt32"
2618
2619    default = 1
2620
2621    read, write, local = True, True, True
2622
2623    min_value, max_value, values = 0, 1, None
2624
2625
2626class AttrVI_ATTR_DEST_INCREMENT(RangeAttribute):
2627    """Number of elements by which to increment the destination offset after a transfer.
2628
2629    The default value of this attribute is 1 (that is, the destination address will be
2630    incremented by 1 after each transfer), and the viMoveOutXX() operations move
2631    into consecutive elements. If this attribute is set to 0, the viMoveOutXX()
2632    operations will always write to the same element, essentially treating the
2633    destination as a FIFO register.
2634
2635    """
2636
2637    resources = [
2638        (constants.InterfaceType.pxi, "INSTR"),
2639        (constants.InterfaceType.pxi, "MEMACC"),
2640        (constants.InterfaceType.vxi, "INSTR"),
2641        (constants.InterfaceType.vxi, "MEMACC"),
2642    ]
2643
2644    py_name = "destination_increment"
2645
2646    visa_name = "VI_ATTR_DEST_INCREMENT"
2647
2648    visa_type = "ViInt32"
2649
2650    default = 1
2651
2652    read, write, local = True, True, True
2653
2654    min_value, max_value, values = 0, 1, None
2655
2656
2657class AttrVI_ATTR_FDC_CHNL(RangeAttribute):
2658    """Which Fast Data Channel (FDC) to use to transfer the buffer."""
2659
2660    resources = [(constants.InterfaceType.vxi, "INSTR")]
2661
2662    py_name = ""
2663
2664    visa_name = "VI_ATTR_FDC_CHNL"
2665
2666    visa_type = "ViUInt16"
2667
2668    default = NotAvailable
2669
2670    read, write, local = True, True, True
2671
2672    min_value, max_value, values = 0, 7, None
2673
2674
2675class AttrVI_ATTR_FDC_MODE(RangeAttribute):
2676    """Which Fast Data Channel (FDC) mode to use (either normal or stream mode)."""
2677
2678    resources = [(constants.InterfaceType.vxi, "INSTR")]
2679
2680    py_name = ""
2681
2682    visa_name = "VI_ATTR_FDC_MODE"
2683
2684    visa_type = "ViUInt16"
2685
2686    default = constants.VI_FDC_NORMAL
2687
2688    read, write, local = True, True, True
2689
2690    min_value, max_value, values = 0, 65535, None
2691
2692
2693class AttrVVI_ATTR_FDC_GEN_SIGNAL_EN(BooleanAttribute):
2694    """Fast Data Channel (FDC) signal enable."""
2695
2696    resources = [(constants.InterfaceType.vxi, "INSTR")]
2697
2698    py_name = ""
2699
2700    visa_name = "VI_ATTR_FDC_GEN_SIGNAL_EN"
2701
2702    visa_type = "ViBool"
2703
2704    default = NotAvailable
2705
2706    read, write, local = True, True, True
2707
2708
2709class AttrVI_ATTR_FDC_USE_PAIR(BooleanAttribute):
2710    """Use a channel pair for transferring data.
2711
2712    If set to False, only one channel will be used.
2713
2714    """
2715
2716    resources = [(constants.InterfaceType.vxi, "INSTR")]
2717
2718    py_name = ""
2719
2720    visa_name = "VI_ATTR_FDC_USE_PAIR"
2721
2722    visa_type = "ViBoolean"
2723
2724    default = False
2725
2726    read, write, local = True, True, True
2727
2728
2729class AttrVI_ATTR_MAINFRAME_LA(RangeAttribute):
2730    """Lowest logical address in the mainframe.
2731
2732    If the logical address is not known, VI_UNKNOWN_LA is returned.
2733
2734    """
2735
2736    resources = [
2737        (constants.InterfaceType.vxi, "INSTR"),
2738        (constants.InterfaceType.vxi, "BACKPLANE"),
2739    ]
2740
2741    py_name = ""
2742
2743    visa_name = "VI_ATTR_MAINFRAME_LA"
2744
2745    visa_type = "ViInt16"
2746
2747    default = NotAvailable
2748
2749    read, write, local = True, False, False
2750
2751    min_value, max_value, values = 0, 255, [constants.VI_UNKNOWN_LA]
2752
2753
2754class AttrVI_ATTR_VXI_LA(RangeAttribute):
2755    """Logical address of the VXI or VME device.
2756
2757    For a MEMACC or SERVANT session, this attribute specifies the logical
2758    address of the local controller.
2759
2760    """
2761
2762    resources = [
2763        (constants.InterfaceType.vxi, "INSTR"),
2764        (constants.InterfaceType.vxi, "MEMACC"),
2765        (constants.InterfaceType.vxi, "SERVANT"),
2766    ]
2767
2768    py_name = ""
2769
2770    visa_name = "VI_ATTR_VXI_LA"
2771
2772    visa_type = "ViInt16"
2773
2774    default = NotAvailable
2775
2776    read, write, local = True, False, False
2777
2778    min_value, max_value, values = 0, 511, None
2779
2780
2781class AttrVI_ATTR_CMDR_LA(RangeAttribute):
2782    """Unique logical address of the commander of the VXI device."""
2783
2784    resources = [
2785        (constants.InterfaceType.vxi, "INSTR"),
2786        (constants.InterfaceType.vxi, "SERVANT"),
2787    ]
2788
2789    py_name = ""
2790
2791    visa_name = "VI_ATTR_CMDR_LA"
2792
2793    visa_type = "ViInt16"
2794
2795    default = NotAvailable
2796
2797    read, write, local = True, False, False
2798
2799    min_value, max_value, values = 0, 255, [constants.VI_UNKNOWN_LA]
2800
2801
2802class AttrVI_ATTR_MEM_SPACE(EnumAttribute):
2803    """VI_ATTR_MEM_SPACE specifies the VXIbus address space used by the device.
2804
2805    The four types are A16, A24, A32 or A64 memory address space.
2806
2807    """
2808
2809    resources = [(constants.InterfaceType.vxi, "INSTR")]
2810
2811    py_name = ""
2812
2813    visa_name = "VI_ATTR_MEM_SPACE"
2814
2815    visa_type = "ViUInt16"
2816
2817    default = constants.VI_A16_SPACE
2818
2819    read, write, local = True, False, False
2820
2821    enum_type = constants.AddressSpace
2822
2823
2824class AttrVI_ATTR_MEM_SIZE(RangeAttribute):
2825    """Unique logical address of the commander of the VXI device."""
2826
2827    resources = [
2828        (constants.InterfaceType.vxi, "INSTR"),
2829        (constants.InterfaceType.vxi, "SERVANT"),
2830    ]
2831
2832    py_name = ""
2833
2834    visa_name = "VI_ATTR_MEM_SIZE"
2835
2836    visa_type = "ViBusSize64" if constants.is_64bits else "ViUInt32"
2837
2838    default = NotAvailable
2839
2840    read, write, local = True, False, False
2841
2842    min_value, max_value, values = (
2843        0,
2844        0xFFFFFFFFFFFFFFFF if constants.is_64bits else 0xFFFFFFFF,
2845        None,
2846    )
2847
2848
2849class AttrVI_ATTR_MEM_BASE(RangeAttribute):
2850    """Unique logical address of the commander of the VXI device."""
2851
2852    resources = [
2853        (constants.InterfaceType.vxi, "INSTR"),
2854        (constants.InterfaceType.vxi, "SERVANT"),
2855    ]
2856
2857    py_name = ""
2858
2859    visa_name = "VI_ATTR_MEM_BASE"
2860
2861    visa_type = "ViBusAddress64" if constants.is_64bits else "ViUInt32"
2862
2863    default = NotAvailable
2864
2865    read, write, local = True, False, False
2866
2867    min_value, max_value, values = (
2868        0,
2869        0xFFFFFFFFFFFFFFFF if constants.is_64bits else 0xFFFFFFFF,
2870        None,
2871    )
2872
2873
2874class AttrVI_ATTR_IMMEDIATE_SERV(BooleanAttribute):
2875    """Is the device an immediate servant of the controller running VISA."""
2876
2877    resources = [(constants.InterfaceType.vxi, "INSTR")]
2878
2879    py_name = ""
2880
2881    visa_name = "VI_ATTR_IMMEDIATE_SERV"
2882
2883    visa_type = "ViBoolean"
2884
2885    default = NotAvailable
2886
2887    read, write, local = True, False, False
2888
2889
2890class AttrVI_ATTR_DEST_ACCESS_PRIV(RangeAttribute):
2891    """Address modifier to be used in high-level write operations.
2892
2893    High level operations are viOutXX() and viMoveOutXX().
2894
2895    """
2896
2897    resources = [
2898        (constants.InterfaceType.vxi, "INSTR"),
2899        (constants.InterfaceType.vxi, "MEMACC"),
2900    ]
2901
2902    py_name = ""
2903
2904    visa_name = "VI_ATTR_DEST_ACCESS_PRIV"
2905
2906    visa_type = "ViUInt16"
2907
2908    default = constants.VI_DATA_PRIV
2909
2910    read, write, local = True, True, True
2911
2912    min_value, max_value, values = 0, 65535, None
2913
2914
2915class AttrVI_ATTR_DEST_BYTE_ORDER(EnumAttribute):
2916    """Byte order to be used in high-level write operations.
2917
2918    High level operations are viOutXX() and viMoveOutXX().
2919
2920    """
2921
2922    resources = [
2923        (constants.InterfaceType.vxi, "INSTR"),
2924        (constants.InterfaceType.vxi, "MEMACC"),
2925    ]
2926
2927    py_name = ""
2928
2929    visa_name = "VI_ATTR_DEST_BYTE_ORDER"
2930
2931    visa_type = "ViUInt16"
2932
2933    default = constants.VI_BIG_ENDIAN
2934
2935    read, write, local = True, True, True
2936
2937    enum_type = constants.ByteOrder
2938
2939
2940class AttrVI_ATTR_SRC_ACCESS_PRIV(EnumAttribute):
2941    """Address modifier to be used in high-level read operations.
2942
2943    High level operations are viInXX() and viMoveinXX().
2944
2945    """
2946
2947    resources = [
2948        (constants.InterfaceType.vxi, "INSTR"),
2949        (constants.InterfaceType.vxi, "MEMACC"),
2950    ]
2951
2952    py_name = ""
2953
2954    visa_name = "VI_ATTR_SRC_ACCESS_PRIV"
2955
2956    visa_type = "ViUInt16"
2957
2958    default = constants.VI_DATA_PRIV
2959
2960    read, write, local = True, True, True
2961
2962    enum_type = constants.AddressModifiers
2963
2964
2965class AttrVI_ATTR_SRC_BYTE_ORDER(EnumAttribute):
2966    """Byte order to be used in high-level read operations.
2967
2968    High level operations are viOutXX() and viMoveOutXX().
2969
2970    """
2971
2972    resources = [
2973        (constants.InterfaceType.vxi, "INSTR"),
2974        (constants.InterfaceType.vxi, "MEMACC"),
2975    ]
2976
2977    py_name = ""
2978
2979    visa_name = "VI_ATTR_SRC_BYTE_ORDER"
2980
2981    visa_type = "ViUInt16"
2982
2983    default = constants.VI_BIG_ENDIAN
2984
2985    read, write, local = True, True, True
2986
2987    enum_type = constants.ByteOrder
2988
2989
2990class AttrVI_ATTR_WIN_ACCESS_PRIV(EnumAttribute):
2991    """Address modifier to be used in low-level access operations.
2992
2993    Low-level operation are viMapAddress(), viPeekXX(), and viPokeXX(),
2994    when accessing the mapped window.
2995
2996    """
2997
2998    resources = [
2999        (constants.InterfaceType.vxi, "INSTR"),
3000        (constants.InterfaceType.vxi, "MEMACC"),
3001    ]
3002
3003    py_name = ""
3004
3005    visa_name = "VI_ATTR_WIN_ACCESS_PRIV"
3006
3007    visa_type = "ViUInt16"
3008
3009    default = constants.VI_DATA_PRIV
3010
3011    read, write, local = True, True, True
3012
3013    enum_type = constants.AddressModifiers
3014
3015
3016class AttrVI_ATTR_WIN_BYTE_ORDER(EnumAttribute):
3017    """Byte order to be used in low- level access operations.
3018
3019    Low-level operation are viMapAddress(), viPeekXX(), and viPokeXX(),
3020    when accessing the mapped window.
3021
3022    """
3023
3024    resources = [
3025        (constants.InterfaceType.vxi, "INSTR"),
3026        (constants.InterfaceType.vxi, "MEMACC"),
3027    ]
3028
3029    py_name = ""
3030
3031    visa_name = "VI_ATTR_WIN_BYTE_ORDER"
3032
3033    visa_type = "ViUInt16"
3034
3035    default = constants.VI_BIG_ENDIAN
3036
3037    read, write, local = True, True, True
3038
3039    enum_type = constants.ByteOrder
3040
3041
3042class AttrVI_ATTR_VXI_TRIG_SUPPORT(RangeAttribute):
3043    """VXI trigger lines this implementation supports.
3044
3045    This is a bit vector. Bits 0-7 correspond to VI_TRIG_TTL0 to VI_TRIG_TTL7.
3046    Bits 8-13 correspond to VI_TRIG_ECL0 to VI_TRIG_ECL5. Bits 14-25 correspond
3047    to VI_TRIG_STAR_SLOT1 to VI_TRIG_STAR_SLOT12. Bit 27 corresponds to
3048    VI_TRIG_PANEL_IN and bit 28 corresponds to VI_TRIG_PANEL_OUT. Bits 29-31
3049    correspond to VI_TRIG_STAR_VXI0 to VI_TRIG_STAR_VXI2. VXI does not use
3050    VI_TRIG_TTL8 to VI_TRIG_TTL11.
3051
3052    """
3053
3054    resources = [
3055        (constants.InterfaceType.vxi, "INSTR"),
3056        (constants.InterfaceType.vxi, "BACKPLANE"),
3057    ]
3058
3059    py_name = ""
3060
3061    visa_name = "VI_ATTR_VXI_TRIG_SUPPORT"
3062
3063    visa_type = "ViUInt32"
3064
3065    default = NotAvailable
3066
3067    read, write, local = True, False, False
3068
3069    min_value, max_value, values = 0, 4294967295, None
3070
3071
3072# GPIB-VXI is not supported
3073# class AttrVI_ATTR_INTF_PARENT_NUM(RangeAttribute):
3074#     """This attribute shows the current state of the VXI/VME interrupt lines.
3075#     This is a bit vector with bits 0-6 corresponding to interrupt
3076#     lines 1-7.
3077#     """
3078
3079#     resources = [(constants.InterfaceType.vxi, "BACKPLANE")]
3080
3081#     py_name = ""
3082
3083#     visa_name = "VI_ATTR_INTF_PARENT_NUM"
3084
3085#     visa_type = "ViUInt16"
3086
3087#     default = NotAvailable
3088
3089#     read, write, local = True, False, False
3090
3091#     min_value, max_value, values = 0, 65535, None
3092
3093
3094class AttrVI_ATTR_VXI_DEV_CLASS(EnumAttribute):
3095    """VXI-defined device class to which the resource belongs.
3096
3097    This can be either:
3098
3099    - message based (VI_VXI_CLASS_MESSAGE)
3100    - register based (VI_VXI_CLASS_REGISTER)
3101    - extended (VI_VXI_CLASS_EXTENDED)
3102    - memory (VI_VXI_CLASS_MEMORY)
3103    - other (VI_VXI_CLASS_OTHER)
3104
3105    VME devices are usually either register based or belong to a miscellaneous
3106    class (VI_VXI_CLASS_OTHER).
3107
3108    """
3109
3110    resources = [(constants.InterfaceType.vxi, "INSTR")]
3111
3112    py_name = ""
3113
3114    visa_name = "VI_ATTR_VXI_DEV_CLASS"
3115
3116    visa_type = "ViUInt16"
3117
3118    default = NotAvailable
3119
3120    read, write, local = True, False, False
3121
3122    enum_type = constants.VXIClass
3123
3124
3125class AttrVI_ATTR_VXI_TRIG_DIR(RangeAttribute):
3126    """Bit map of the directions of the mapped TTL trigger lines.
3127
3128    Bits 0-7 represent TTL triggers 0-7 respectively. A bit's value of 0 means
3129    the line is routed out of the frame, and a value of 1 means into the frame.
3130    In order for a direction to be set, the line must also be enabled using
3131    VI_ATTR_VXI_TRIG_LINES_EN.
3132
3133    """
3134
3135    resources = [(constants.InterfaceType.vxi, "INSTR")]
3136
3137    py_name = ""
3138
3139    visa_name = "VI_ATTR_VXI_TRIG_DIR"
3140
3141    visa_type = "ViUInt16"
3142
3143    default = 0
3144
3145    read, write, local = True, True, False
3146
3147    min_value, max_value, values = 0, 65535, None
3148
3149
3150class AttrVI_ATTR_VXI_TRIG_LINES_EN(RangeAttribute):
3151    """Bit map of what VXI TLL triggers have mappings.
3152
3153    Bits 0-7 represent TTL triggers 0-7 respectively. A bit's value of 0 means
3154    the trigger line is unmapped, and 1 means a mapping exists. Use
3155    VI_ATTR_VXI_TRIG_DIR to set an enabled line's direction.
3156
3157    """
3158
3159    resources = [(constants.InterfaceType.vxi, "INSTR")]
3160
3161    py_name = ""
3162
3163    visa_name = "VI_ATTR_VXI_TRIG_LINES_EN"
3164
3165    visa_type = "ViUInt16"
3166
3167    default = 0
3168
3169    read, write, local = True, True, False
3170
3171    min_value, max_value, values = 0, 65535, None
3172
3173
3174class AttrVI_ATTR_VXI_VME_INTR_STATUS(RangeAttribute):
3175    """Current state of the VXI/VME interrupt lines.
3176
3177    This is a bit vector with bits 0-6 corresponding to interrupt lines 1-7.
3178
3179    """
3180
3181    resources = [(constants.InterfaceType.vxi, "BACKPLANE")]
3182
3183    py_name = ""
3184
3185    visa_name = "VI_ATTR_VXI_VME_INTR_STATUS"
3186
3187    visa_type = "ViUInt16"
3188
3189    default = NotAvailable
3190
3191    read, write, local = True, False, False
3192
3193    min_value, max_value, values = 0, 65535, None
3194
3195
3196class AttrVI_ATTR_VXI_TRIG_STATUS(RangeAttribute):
3197    """Current state of the VXI trigger lines.
3198
3199    This is a bit vector with bits 0-9 corresponding to VI_TRIG_TTL0
3200    through VI_TRIG_ECL1.
3201
3202    """
3203
3204    resources = [(constants.InterfaceType.vxi, "BACKPLANE")]
3205
3206    py_name = ""
3207
3208    visa_name = "VI_ATTR_VXI_TRIG_STATUS"
3209
3210    visa_type = "ViUInt32"
3211
3212    default = NotAvailable
3213
3214    read, write, local = True, False, False
3215
3216    min_value, max_value, values = 0, 4294967295, None
3217
3218
3219class AttrVI_ATTR_VXI_VME_SYSFAIL_STATE(EnumAttribute):
3220    """Current state of the VXI/VME SYSFAIL (SYStem FAILure) backplane line."""
3221
3222    resources = [(constants.InterfaceType.vxi, "BACKPLANE")]
3223
3224    py_name = ""
3225
3226    visa_name = "VI_ATTR_VXI_VME_SYSFAIL_STATE"
3227
3228    visa_type = "ViInt16"
3229
3230    default = NotAvailable
3231
3232    read, write, local = True, False, False
3233
3234    enum_type = constants.LineState
3235
3236
3237class AttrVI_ATTR_PXI_DEV_NUM(RangeAttribute):
3238    """PXI device number."""
3239
3240    resources = [(constants.InterfaceType.pxi, "INSTR")]
3241
3242    py_name = ""
3243
3244    visa_name = "VI_ATTR_PXI_DEV_NUM"
3245
3246    visa_type = "ViUInt16"
3247
3248    default = NotAvailable
3249
3250    read, write, local = True, False, False
3251
3252    min_value, max_value, values = 0, 31, None
3253
3254
3255class AttrVI_ATTR_PXI_FUNC_NUM(RangeAttribute):
3256    """PCI function number of the PXI/PCI resource.
3257
3258    For most devices, the function number is 0, but a multifunction device may
3259    have a function number up to 7. The meaning of a function number other than
3260    0 is device specific.
3261
3262    """
3263
3264    resources = [(constants.InterfaceType.pxi, "INSTR")]
3265
3266    py_name = ""
3267
3268    visa_name = "VI_ATTR_PXI_FUNC_NUM"
3269
3270    visa_type = "ViUInt16"
3271
3272    default = 0
3273
3274    read, write, local = True, False, False
3275
3276    min_value, max_value, values = 0, 7, None
3277
3278
3279class AttrVI_ATTR_PXI_BUS_NUM(RangeAttribute):
3280    """PCI bus number of this device."""
3281
3282    resources = [(constants.InterfaceType.pxi, "INSTR")]
3283
3284    py_name = ""
3285
3286    visa_name = "VI_ATTR_PXI_BUS_NUM"
3287
3288    visa_type = "ViUInt16"
3289
3290    default = NotAvailable
3291
3292    read, write, local = True, False, False
3293
3294    min_value, max_value, values = 0, 255, None
3295
3296
3297class AttrVI_ATTR_PXI_CHASSIS(RangeAttribute):
3298    """PXI chassis number of this device.
3299
3300    A value of –1 means the chassis number is unknown.
3301
3302    """
3303
3304    resources = [
3305        (constants.InterfaceType.pxi, "INSTR"),
3306        (constants.InterfaceType.pxi, "BACKPLANE"),
3307    ]
3308
3309    py_name = ""
3310
3311    visa_name = "VI_ATTR_PXI_CHASSIS"
3312
3313    visa_type = "ViInt16"
3314
3315    default = NotAvailable
3316
3317    read, write, local = True, False, False
3318
3319    min_value, max_value, values = 0, 255, [-1]
3320
3321
3322class AttrVI_ATTR_PXI_SLOTPATH(Attribute):
3323    """Slot path of this device."""
3324
3325    resources = [(constants.InterfaceType.pxi, "INSTR")]
3326
3327    py_name = ""
3328
3329    visa_name = "VI_ATTR_PXI_SLOTPATH"
3330
3331    visa_type = "ViString"
3332
3333    default = NotAvailable
3334
3335    read, write, local = True, False, False
3336
3337
3338class AttrVI_ATTR_PXI_SLOT_LBUS_LEFT(RangeAttribute):
3339    """Slot number or special feature connected to the local bus left lines."""
3340
3341    resources = [(constants.InterfaceType.pxi, "INSTR")]
3342
3343    py_name = ""
3344
3345    visa_name = "VI_ATTR_PXI_SLOT_LBUS_LEFT"
3346
3347    visa_type = "ViInt16"
3348
3349    default = NotAvailable
3350
3351    read, write, local = True, False, False
3352
3353    min_value, max_value, values = (
3354        1,
3355        18,
3356        [
3357            constants.VI_PXI_LBUS_UNKNOWN,
3358            constants.VI_PXI_LBUS_NONE,
3359            constants.VI_PXI_LBUS_STAR_TRIG_BUS_0,
3360            constants.VI_PXI_LBUS_STAR_TRIG_BUS_1,
3361            constants.VI_PXI_LBUS_STAR_TRIG_BUS_2,
3362            constants.VI_PXI_LBUS_STAR_TRIG_BUS_3,
3363            constants.VI_PXI_LBUS_STAR_TRIG_BUS_4,
3364            constants.VI_PXI_LBUS_STAR_TRIG_BUS_5,
3365            constants.VI_PXI_LBUS_STAR_TRIG_BUS_6,
3366            constants.VI_PXI_LBUS_STAR_TRIG_BUS_7,
3367            constants.VI_PXI_LBUS_STAR_TRIG_BUS_8,
3368            constants.VI_PXI_LBUS_STAR_TRIG_BUS_9,
3369            constants.VI_PXI_STAR_TRIG_CONTROLLER,
3370            constants.VI_PXI_LBUS_SCXI,
3371        ],
3372    )
3373
3374
3375class AttrVI_ATTR_PXI_SLOT_LBUS_RIGHT(RangeAttribute):
3376    """Slot number or special feature connected to the local bus right lines."""
3377
3378    resources = [(constants.InterfaceType.pxi, "INSTR")]
3379
3380    py_name = ""
3381
3382    visa_name = "VI_ATTR_PXI_SLOT_LBUS_RIGHT"
3383
3384    visa_type = "ViInt16"
3385
3386    default = NotAvailable
3387
3388    read, write, local = True, False, False
3389
3390    min_value, max_value, values = (
3391        1,
3392        18,
3393        [
3394            constants.VI_PXI_LBUS_UNKNOWN,
3395            constants.VI_PXI_LBUS_NONE,
3396            constants.VI_PXI_LBUS_STAR_TRIG_BUS_0,
3397            constants.VI_PXI_LBUS_STAR_TRIG_BUS_1,
3398            constants.VI_PXI_LBUS_STAR_TRIG_BUS_2,
3399            constants.VI_PXI_LBUS_STAR_TRIG_BUS_3,
3400            constants.VI_PXI_LBUS_STAR_TRIG_BUS_4,
3401            constants.VI_PXI_LBUS_STAR_TRIG_BUS_5,
3402            constants.VI_PXI_LBUS_STAR_TRIG_BUS_6,
3403            constants.VI_PXI_LBUS_STAR_TRIG_BUS_7,
3404            constants.VI_PXI_LBUS_STAR_TRIG_BUS_8,
3405            constants.VI_PXI_LBUS_STAR_TRIG_BUS_9,
3406            constants.VI_PXI_STAR_TRIG_CONTROLLER,
3407            constants.VI_PXI_LBUS_SCXI,
3408        ],
3409    )
3410
3411
3412class AttrVI_ATTR_PXI_IS_EXPRESS(BooleanAttribute):
3413    """Whether the device is PXI/PCI or PXI/PCI Express."""
3414
3415    resources = [(constants.InterfaceType.pxi, "INSTR")]
3416
3417    py_name = ""
3418
3419    visa_name = "VI_ATTR_PXI_IS_EXPRESS"
3420
3421    visa_type = "ViBoolean"
3422
3423    default = NotAvailable
3424
3425    read, write, local = True, False, False
3426
3427
3428class AttrVI_ATTR_PXI_SLOT_LWIDTH(ValuesAttribute):
3429    """PCI Express link width of the PXI Express peripheral slot of the device.
3430
3431    A value of –1 indicates that the device is not a PXI Express device.
3432
3433    """
3434
3435    resources = [(constants.InterfaceType.pxi, "INSTR")]
3436
3437    py_name = ""
3438
3439    visa_name = "VI_ATTR_PXI_SLOT_LWIDTH"
3440
3441    visa_type = "ViInt16"
3442
3443    default = NotAvailable
3444
3445    read, write, local = True, False, False
3446
3447    values = [-1, 1, 4, 8]
3448
3449
3450class AttrVI_ATTR_PXI_MAX_LWIDTH(ValuesAttribute):
3451    """Maximum PCI Express link width of the device.
3452
3453    A value of –1 indicates that the device is not a PXI/PCI Express device.
3454
3455    """
3456
3457    resources = [(constants.InterfaceType.pxi, "INSTR")]
3458
3459    py_name = ""
3460
3461    visa_name = "VI_ATTR_PXI_MAX_LWIDTH"
3462
3463    visa_type = "ViInt16"
3464
3465    default = NotAvailable
3466
3467    read, write, local = True, False, False
3468
3469    values = [-1, 1, 2, 4, 8, 16]
3470
3471
3472class AttrVI_ATTR_PXI_ACTUAL_LWIDTH(ValuesAttribute):
3473    """PCI Express link width negotiated between the host controller and the device.
3474
3475    A value of –1 indicates that the device is not a PXI/PCI Express device.
3476
3477    """
3478
3479    resources = [(constants.InterfaceType.pxi, "INSTR")]
3480
3481    py_name = ""
3482
3483    visa_name = "VI_ATTR_PXI_ACTUAL_LWIDTH"
3484
3485    visa_type = "ViInt16"
3486
3487    default = NotAvailable
3488
3489    read, write, local = True, False, False
3490
3491    values = [-1, 1, 2, 4, 8, 16]
3492
3493
3494class AttrVI_ATTR_PXI_DSTAR_BUS(RangeAttribute):
3495    """Differential star bus number of this device.
3496
3497    A value of –1 means the chassis is unidentified or does not have a timing slot.
3498
3499    """
3500
3501    resources = [(constants.InterfaceType.pxi, "INSTR")]
3502
3503    py_name = ""
3504
3505    visa_name = "VI_ATTR_PXI_DSTAR_BUS"
3506
3507    visa_type = "ViInt16"
3508
3509    default = NotAvailable
3510
3511    read, write, local = True, False, False
3512
3513    min_value, max_value, values = -32768, 32767, None
3514
3515
3516class AttrVI_ATTR_PXI_DSTAR_SET(RangeAttribute):
3517    """Set of PXI_DSTAR lines connected to this device."""
3518
3519    resources = [(constants.InterfaceType.pxi, "INSTR")]
3520
3521    py_name = ""
3522
3523    visa_name = "VI_ATTR_PXI_DSTAR_SET"
3524
3525    visa_type = "ViInt16"
3526
3527    default = NotAvailable
3528
3529    read, write, local = True, False, False
3530
3531    min_value, max_value, values = 0, 16, [-1]
3532
3533
3534class AttrVI_ATTR_PXI_TRIG_BUS(RangeAttribute):
3535    """The trigger bus number of this device."""
3536
3537    resources = [
3538        (constants.InterfaceType.pxi, "INSTR"),
3539        (constants.InterfaceType.pxi, "BACKPLANE"),
3540    ]
3541
3542    py_name = ""
3543
3544    visa_name = "VI_ATTR_PXI_TRIG_BUS"
3545
3546    visa_type = "ViInt16"
3547
3548    default = NotAvailable
3549
3550    read, write, local = True, True, True
3551
3552    min_value, max_value, values = 1, 3, [-1]
3553
3554
3555class AttrVI_ATTR_PXI_STAR_TRIG_BUS(RangeAttribute):
3556    """The star trigger bus number of this device."""
3557
3558    resources = [(constants.InterfaceType.pxi, "INSTR")]
3559
3560    py_name = ""
3561
3562    visa_name = "VI_ATTR_PXI_STAR_TRIG_BUS"
3563
3564    visa_type = "ViInt16"
3565
3566    default = NotAvailable
3567
3568    read, write, local = True, False, False
3569
3570    min_value, max_value, values = 1, 3, [-1]
3571
3572
3573class AttrVI_ATTR_PXI_STAR_TRIG_LINE(RangeAttribute):
3574    """The PXI_STAR line connected to this device."""
3575
3576    resources = [(constants.InterfaceType.pxi, "INSTR")]
3577
3578    py_name = ""
3579
3580    visa_name = "VI_ATTR_PXI_STAR_TRIG_LINE"
3581
3582    visa_type = "ViInt16"
3583
3584    default = NotAvailable
3585
3586    read, write, local = True, False, False
3587
3588    min_value, max_value, values = 0, 32767, None
3589
3590
3591class AttrVI_ATTR_PXI_SRC_TRIG_BUS(RangeAttribute):
3592    """VThe segment to use to qualify trigSrc in viMapTrigger."""
3593
3594    resources = [(constants.InterfaceType.pxi, "BACKPLANE")]
3595
3596    py_name = ""
3597
3598    visa_name = "VI_ATTR_PXI_SRC_TRIG_BUS"
3599
3600    visa_type = "ViInt16"
3601
3602    default = -1
3603
3604    read, write, local = True, True, True
3605
3606    min_value, max_value, values = 1, 3, [-1]
3607
3608
3609class AttrVI_ATTR_PXI_DEST_TRIG_BUS(RangeAttribute):
3610    """The segment to use to qualify trigDest in viMapTrigger."""
3611
3612    resources = [(constants.InterfaceType.pxi, "BACKPLANE")]
3613
3614    py_name = ""
3615
3616    visa_name = "VI_ATTR_PXI_DEST_TRIG_BUS"
3617
3618    visa_type = "ViInt16"
3619
3620    default = -1
3621
3622    read, write, local = True, True, True
3623
3624    min_value, max_value, values = 1, 3, [-1]
3625
3626
3627class _AttrVI_ATTR_PXI_MEM_TYPE_BARX(EnumAttribute):
3628    """Memory type used by the device in the specified BAR (if applicable)."""
3629
3630    resources = [(constants.InterfaceType.pxi, "INSTR")]
3631
3632    py_name = ""
3633
3634    visa_type = "ViUInt16"
3635
3636    default = NotAvailable
3637
3638    read, write, local = True, False, False
3639
3640    enum_type = constants.PXIMemory
3641
3642
3643class _AttrVI_ATTR_PXI_MEM_BASE_BARX(RangeAttribute):
3644    """PXI memory base address assigned to the specified BAR.
3645
3646    If the value of the corresponding VI_ATTR_PXI_MEM_TYPE_BARx is
3647    constants.PXIMemory.none, the value of this attribute is meaningless for
3648    the given PXI device.
3649
3650    """
3651
3652    resources = [(constants.InterfaceType.pxi, "INSTR")]
3653
3654    py_name = ""
3655
3656    visa_type = "ViUInt32"
3657
3658    default = NotAvailable
3659
3660    read, write, local = True, False, False
3661
3662    min_value, max_value, values = 0, 0xFFFFFFFF, None
3663
3664
3665class _AttrVI_ATTR_PXI_MEM_SIZE_BARX(RangeAttribute):
3666    """Memory size used by the device in the specified BAR.
3667
3668    If the value of the corresponding VI_ATTR_PXI_MEM_TYPE_BARx is
3669    constants.PXIMemory.none, the value of this attribute is meaningless for
3670    the given PXI device.
3671
3672    """
3673
3674    resources = [(constants.InterfaceType.pxi, "INSTR")]
3675
3676    py_name = ""
3677
3678    visa_type = "ViUInt32"
3679
3680    default = NotAvailable
3681
3682    read, write, local = True, False, False
3683
3684    min_value, max_value, values = 0, 0xFFFFFFFF, None
3685
3686
3687mod = sys.modules[__name__]
3688for i in range(0, 5):
3689    setattr(
3690        mod,
3691        f"AttrVI_ATTR_PXI_MEM_TYPE_BAR{i}",
3692        type(
3693            f"AttrVI_ATTR_PXI_MEM_TYPE_BAR{i}",
3694            (_AttrVI_ATTR_PXI_MEM_TYPE_BARX,),
3695            {"visa_name": f"VI_ATTR_PXI_MEM_TYPE_BAR{i}"},
3696        ),
3697    )
3698
3699    setattr(
3700        mod,
3701        f"AttrVI_ATTR_PXI_MEM_TYPE_BAR{i}",
3702        type(
3703            f"AttrVI_ATTR_PXI_MEM_BASE_BAR{i}",
3704            (_AttrVI_ATTR_PXI_MEM_BASE_BARX,),
3705            {"visa_name": f"VI_ATTR_PXI_MEM_BASE_BAR{i}"},
3706        ),
3707    )
3708
3709    setattr(
3710        mod,
3711        f"AttrVI_ATTR_PXI_MEM_TYPE_BAR{i}",
3712        type(
3713            f"AttrVI_ATTR_PXI_MEM_SIZE_BAR{i}",
3714            (_AttrVI_ATTR_PXI_MEM_SIZE_BARX,),
3715            {"visa_name": f"VI_ATTR_PXI_MEM_SIZE_BAR{i}"},
3716        ),
3717    )
3718
3719
3720# --- Event type attributes ------------------------------------------------------------
3721
3722
3723class AttrVI_ATTR_STATUS(EnumAttribute):
3724    """Status code of the operation generating this event."""
3725
3726    resources = [constants.EventType.exception, constants.EventType.io_completion]
3727
3728    py_name = "status"
3729
3730    visa_name = "VI_ATTR_STATUS"
3731
3732    visa_type = "ViStatus"
3733
3734    default = NotAvailable
3735
3736    read, write, local = True, False, True
3737
3738    enum_type = constants.StatusCode
3739
3740
3741class AttrVI_ATTR_OPER_NAME(Attribute):
3742    """Name of the operation generating this event."""
3743
3744    resources = [constants.EventType.io_completion, constants.EventType.exception]
3745
3746    py_name = "operation_name"
3747
3748    visa_name = "VI_ATTR_OPER_NAME"
3749
3750    visa_type = "ViString"
3751
3752    default = NotAvailable
3753
3754    read, write, local = True, False, True
3755
3756
3757class AttrVI_ATTR_JOB_ID(Attribute):
3758    """Job ID of the asynchronous operation that has completed."""
3759
3760    resources = [constants.EventType.io_completion]
3761
3762    py_name = "job_id"
3763
3764    visa_name = "VI_ATTR_JOB_ID"
3765
3766    visa_type = "ViJobId"
3767
3768    default = NotAvailable
3769
3770    read, write, local = True, False, True
3771
3772
3773class AttrVI_ATTR_RET_COUNT(RangeAttribute):
3774    """Actual number of elements that were asynchronously transferred."""
3775
3776    resources = [constants.EventType.io_completion]
3777
3778    py_name = "return_count"
3779
3780    visa_name = "VI_ATTR_RET_COUNT"
3781
3782    visa_type = "ViUInt32"
3783
3784    default = NotAvailable
3785
3786    read, write, local = True, False, True
3787
3788    min_value, max_value, values = 0, 0xFFFFFFFF, None
3789
3790
3791class AttrVI_ATTR_BUFFER(Attribute):
3792    """Buffer that was used in an asynchronous operation."""
3793
3794    resources = [constants.EventType.io_completion]
3795
3796    py_name = "buffer"
3797
3798    visa_name = "VI_ATTR_BUFFER"
3799
3800    visa_type = "ViBuf"
3801
3802    default = NotAvailable
3803
3804    read, write, local = True, False, True
3805
3806    def __get__(  # type: ignore
3807        self, instance: Optional["IOCompletionEvent"], owner
3808    ) -> Optional[Union[SupportsBytes, "AttrVI_ATTR_BUFFER"]]:
3809        """Retrieve the buffer stored on the library using the jod Id."""
3810        if instance is None:
3811            return self
3812        # The buffer we need to access has been created in an earlier call
3813        # starting an asynchronous read. When starting that call we stored
3814        # the buffer on the resource and we can now retrieve it
3815        return instance.visalib.get_buffer_from_id(instance.job_id)
3816
3817
3818class AttrVI_ATTR_RECV_TRIG_ID(EnumAttribute):
3819    """Id of the trigger that generated the event."""
3820
3821    resources = [constants.EventType.trig]
3822
3823    py_name = "received_trigger_id"
3824
3825    visa_name = "VI_ATTR_RECV_TRIG_ID"
3826
3827    visa_type = "ViInt16"
3828
3829    default = NotAvailable
3830
3831    read, write, local = True, False, True
3832
3833    enum_type = constants.TriggerEventID
3834
3835
3836class AttrVI_ATTR_GPIB_RECV_CIC_STATE(BooleanAttribute):
3837    """Whether the event by the gain or the loss of the CIC state."""
3838
3839    resources = [constants.EventType.gpib_controller_in_charge]
3840
3841    py_name = "cic_state"
3842
3843    visa_name = "VI_ATTR_GPIB_RECV_CIC_STATE"
3844
3845    visa_type = "ViBool"
3846
3847    default = NotAvailable
3848
3849    read, write, local = True, False, True
3850
3851
3852class AttrVI_ATTR_RECV_TCPIP_ADDR(Attribute):
3853    """Address of the device from which the session received a connection."""
3854
3855    resources = [constants.EventType.tcpip_connect]
3856
3857    py_name = "tcpip_connect"
3858
3859    visa_name = "VI_ATTR_RECV_TCPIP_ADDR"
3860
3861    visa_type = "ViString"
3862
3863    default = NotAvailable
3864
3865    read, write, local = True, False, True
3866
3867
3868class AttrVI_ATTR_USB_RECV_INTR_SIZE(RangeAttribute):
3869    """Size of the data that was received from the USB interrupt-IN pipe."""
3870
3871    resources = [constants.EventType.usb_interrupt]
3872
3873    py_name = "size"
3874
3875    visa_name = "VI_ATTR_USB_RECV_INTR_SIZE"
3876
3877    visa_type = "ViUInt16"
3878
3879    default = NotAvailable
3880
3881    read, write, local = True, False, True
3882
3883    min_value, max_value, values = 0, 0xFFFF, None
3884
3885
3886class AttrVI_ATTR_USB_RECV_INTR_DATA(Attribute):
3887    """Actual data that was received from the USB interrupt-IN pipe."""
3888
3889    resources = [constants.EventType.pxi_interrupt]
3890
3891    py_name = "data"
3892
3893    visa_name = "VI_ATTR_USB_RECV_INTR_DATA"
3894
3895    visa_type = "ViBuf"
3896
3897    default = NotAvailable
3898
3899    read, write, local = True, False, True
3900
3901
3902class AttrVI_ATTR_SIGP_STATUS_ID(RangeAttribute):
3903    """16-bit Status/ID retrieved during the IACK cycle or from the Signal register."""
3904
3905    resources = [constants.EventType.vxi_signal_interrupt]
3906
3907    py_name = "signal_register_status_id"
3908
3909    visa_name = "VI_ATTR_SIGP_STATUS_ID"
3910
3911    visa_type = "ViUInt16"
3912
3913    default = NotAvailable
3914
3915    read, write, local = True, False, True
3916
3917    min_value, max_value, values = 0, 0xFFFF, None
3918
3919
3920class AttrVI_ATTR_INTR_STATUS_ID(RangeAttribute):
3921    """32-bit status/ID retrieved during the IACK cycle."""
3922
3923    resources = [constants.EventType.vxi_vme_interrupt]
3924
3925    py_name = "status_id"
3926
3927    visa_name = "VI_ATTR_INTR_STATUS_ID"
3928
3929    visa_type = "ViUInt32"
3930
3931    default = NotAvailable
3932
3933    read, write, local = True, False, True
3934
3935    min_value, max_value, values = 0, 0xFFFFFFFF, None
3936
3937
3938class AttrVI_ATTR_RECV_INTR_LEVEL(RangeAttribute):
3939    """VXI interrupt level on which the interrupt was received."""
3940
3941    resources = [constants.EventType.vxi_vme_interrupt]
3942
3943    py_name = "level"
3944
3945    visa_name = "VI_ATTR_RECV_INTR_LEVEL"
3946
3947    visa_type = "ViInt16"
3948
3949    default = NotAvailable
3950
3951    read, write, local = True, False, True
3952
3953    min_value, max_value, values = 1, 7, [constants.VI_UNKNOWN_LEVEL]
3954
3955
3956class AttrVI_ATTR_PXI_RECV_INTR_SEQ(Attribute):
3957    """Index of the interrupt sequence that detected the interrupt condition."""
3958
3959    resources = [constants.EventType.pxi_interrupt]
3960
3961    py_name = "sequence"
3962
3963    visa_name = "VI_ATTR_PXI_RECV_INTR_SEQ"
3964
3965    visa_type = "ViInt16"
3966
3967    default = NotAvailable
3968
3969    read, write, local = True, False, True
3970
3971
3972class AttrVI_ATTR_PXI_RECV_INTR_DATA(Attribute):
3973    """First PXI/PCI register read in the successful interrupt detection sequence."""
3974
3975    resources = [constants.EventType.pxi_interrupt]
3976
3977    py_name = "data"
3978
3979    visa_name = "VI_ATTR_PXI_RECV_INTR_DATA"
3980
3981    visa_type = "ViUInt32"
3982
3983    default = NotAvailable
3984
3985    read, write, local = True, False, True
3986