コード例 #1
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_resource_class(self):
     try:
         resource_class = \
             vpp43.get_attribute(self.vi, VI_ATTR_RSRC_CLASS).upper()
     except VisaIOError, error:
         if error.error_code == VI_ERROR_NSUP_ATTR:
             return None
         else: raise
コード例 #2
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_resource_class(self):
     try:
         resource_class = \
             vpp43.get_attribute(self.vi, VI_ATTR_RSRC_CLASS).upper()
     except VisaIOError, error:
         if error.error_code == VI_ERROR_NSUP_ATTR:
             return None
         else: raise
コード例 #3
0
 def __get_stop_bits(self):
     deci_bits = vpp43.get_attribute(self.vi, VI_ATTR_ASRL_STOP_BITS)
     if deci_bits == 10:
         return 1
     elif deci_bits == 15:
         return 1.5
     elif deci_bits == 20:
         return 2
コード例 #4
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
    def resource_class(self):
        """The resource class of the resource as a string."""

        try:
            resource_class = \
                vpp43.get_attribute(self.vi, VI_ATTR_RSRC_CLASS).upper()
        except VisaIOError as error:
            if error.error_code != VI_ERROR_NSUP_ATTR:
                raise
        return resource_class  # FIXME: local variable referenced before assignment
コード例 #5
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
    def stop_bits(self):
        """Number of stop bits contained in each frame (1, 1.5, or 2)."""

        deci_bits = vpp43.get_attribute(self.vi, VI_ATTR_ASRL_STOP_BITS)
        if deci_bits == 10:
            return 1
        elif deci_bits == 15:
            return 1.5
        elif deci_bits == 20:
            return 2
コード例 #6
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
    def timeout(self):
        """The timeout in seconds for all resource I/O operations.

        Note that the VISA library may round up this value heavily.  I
        experienced that my NI VISA implementation had only the values 0, 1, 3
        and 10 seconds.

        """
        timeout = vpp43.get_attribute(self.vi, VI_ATTR_TMO_VALUE)
        if timeout == VI_TMO_INFINITE:
            raise NameError("no timeout is specified")
        return timeout / 1000.0
コード例 #7
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_timeout(self):
     timeout = vpp43.get_attribute(self.vi, VI_ATTR_TMO_VALUE)
     if timeout == VI_TMO_INFINITE:
         raise NameError, "no timeout is specified"
     return timeout / 1000.0
コード例 #8
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
 def end_input(self):
     """indicates the method used to terminate read operations"""
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_END_IN)
コード例 #9
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
    def parity(self):
        """The parity used with every frame transmitted and received."""

        return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_PARITY)
コード例 #10
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
    def data_bits(self):
        """Number of data bits contained in each frame (from 5 to 8)."""

        return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_DATA_BITS)
コード例 #11
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_timeout(self):
     timeout = vpp43.get_attribute(self.vi, VI_ATTR_TMO_VALUE)
     if timeout == VI_TMO_INFINITE:
         raise NameError, "no timeout is specified"
     return timeout / 1000.0
コード例 #12
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_baud_rate(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_BAUD)
コード例 #13
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_data_bits(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_DATA_BITS)
コード例 #14
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_send_end(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_SEND_END_EN) == VI_TRUE
コード例 #15
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_end_input(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_END_IN)
コード例 #16
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_parity(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_PARITY)
コード例 #17
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_data_bits(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_DATA_BITS)
コード例 #18
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_resource_name(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_RSRC_NAME)
コード例 #19
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_parity(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_PARITY)
コード例 #20
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_resource_name(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_RSRC_NAME)
コード例 #21
0
ファイル: visa.py プロジェクト: mikeMcoder/myRepository
 def __get_send_end(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_SEND_END_EN) == VI_TRUE
コード例 #22
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_baud_rate(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_BAUD)
コード例 #23
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
 def resource_name(self):
     """The VISA resource name of the resource as a string."""
     return vpp43.get_attribute(self.vi, VI_ATTR_RSRC_NAME)
コード例 #24
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_stop_bits(self):
     deci_bits = vpp43.get_attribute(self.vi, VI_ATTR_ASRL_STOP_BITS)
     if deci_bits == 10: return 1
     elif deci_bits == 15: return 1.5
     elif deci_bits == 20: return 2
コード例 #25
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
    def send_end(self):
        """Whether or not to assert EOI (or something equivalent after each
        write operation.
        """

        return vpp43.get_attribute(self.vi, VI_ATTR_SEND_END_EN) == VI_TRUE
コード例 #26
0
ファイル: visa.py プロジェクト: rasmusto/pyvisa
 def __get_end_input(self):
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_END_IN)
コード例 #27
0
ファイル: visa.py プロジェクト: debarghyab88/pyvisa
 def baud_rate(self):
     """The baud rate of the serial instrument."""
     return vpp43.get_attribute(self.vi, VI_ATTR_ASRL_BAUD)