Exemplo n.º 1
0
    def __init__(self):
        Module.__init__(self)
        self.dataformat = bitopt(self.format_attribute, 0x3, 0,
                                 'Engineering units', {0: 'Engineering units'})

        self.inputrange = bitopt(
            self.range_attribute, 0xff, 0, Range.pm_1V, {
                0x08: Range.pm_10V,
                0x09: Range.pm_5V,
                0x0a: Range.pm_1V,
                0x0b: Range.pm_500mV,
                0x0c: Range.pm_150mV,
                0x0d: Range.pm_20mA
            })

        self.integration = bitopt(self.integration_attribute, 0x80, 7, '50 ms',
                                  {
                                      0: '50 ms',
                                      1: '60 ms'
                                  })

        self.attrdict.update({
            self.dataformat: 7,
            self.inputrange: 3,
            self.integration: 7
        })
Exemplo n.º 2
0
 def __init__(self, name, version, configuration_dict, activate):
     Module.__init__(self)
     self.dataformat = bitopt(self.format_attribute,
                              0x3,0,'Engineering units',
                              {0:'Engineering units',
                               1:'% of FSR',
                               2:'hexadecimal'})
     self.slew = bitopt(self.slew_attribute,
                        0x3c,2,'2.0 V/sec 4.0mA/sec',
                        {1:'0.0625 V/sec 0.125mA/sec',
                         2:'0.125 V/sec 0.25mA/sec',
                         3:'0.25 V/sec 0.5mA/sec',
                         4:'0.5 V/sec 1.0mA/sec',
                         5:'1.0 V/sec 2.0mA/sec',
                         6:'2.0 V/sec 4.0mA/sec',
                         7:'4.0 V/sec 8.0mA/sec',
                         8:'8.0 V/sec 16.0mA/sec',
                         9:'16.0 V/sec 32.0mA/sec',
                         10:'32.0 V/sec 64.0mA/sec',
                         11:'64.0 V/sec 128.0mA/sec'})
     self.output = bitopt(self.range_attribute,
                          0xff,0,Range.four_to_twenty_mA,
                          {0x30:Range.zero_to_twenty_mA,
                           0x31:Range.four_to_twenty_mA,
                           0x32:Range.zero_to_ten_V})
     self.attrdict.update({self.dataformat:7,self.slew:7,self.output:3})
Exemplo n.º 3
0
 def __init__(self, name, version, configuration_dict, activate):
     Module.__init__(self)
     self.dataformat = bitopt(self.format_attribute, 0x3, 0,
                              'Engineering units', {
                                  0: 'Engineering units',
                                  1: '% of FSR',
                                  2: 'hexadecimal'
                              })
     self.slew = bitopt(
         self.slew_attribute, 0x3c, 2, '2.0 V/sec 4.0mA/sec', {
             1: '0.0625 V/sec 0.125mA/sec',
             2: '0.125 V/sec 0.25mA/sec',
             3: '0.25 V/sec 0.5mA/sec',
             4: '0.5 V/sec 1.0mA/sec',
             5: '1.0 V/sec 2.0mA/sec',
             6: '2.0 V/sec 4.0mA/sec',
             7: '4.0 V/sec 8.0mA/sec',
             8: '8.0 V/sec 16.0mA/sec',
             9: '16.0 V/sec 32.0mA/sec',
             10: '32.0 V/sec 64.0mA/sec',
             11: '64.0 V/sec 128.0mA/sec'
         })
     self.output = bitopt(
         self.range_attribute, 0xff, 0, Range.four_to_twenty_mA, {
             0x30: Range.zero_to_twenty_mA,
             0x31: Range.four_to_twenty_mA,
             0x32: Range.zero_to_ten_V
         })
     self.attrdict.update({
         self.dataformat: 7,
         self.slew: 7,
         self.output: 3
     })
Exemplo n.º 4
0
 def __init__(self):
     Module.__init__(self)
     self.dataformat = bitopt(self.format_attribute,
                              0x3,0,'Engineering units', 
                              {0:'Engineering units', 
                               1:'% of FSR',  
                               2:'hexadecimal'})
     self.inputrange = bitopt(self.range_attribute,
                              0xff,0,Range.plat_0_to_100,
                              {0x20:Range.plat_m_100_to_100,
                               0x21:Range.plat_0_to_100,
                               0x22:Range.plat_0_to_200})
     self.attrdict.update({self.dataformat:7,self.inputrange:3})
Exemplo n.º 5
0
 def __init__(self):
     self.checksum = bitopt(self.change_checksum,0x40,6,'disabled',
                            {0:'disabled',
                             1:'enabled'})
     self.addr = FuncOpt(self.change_address,retval)
     self.baudrate = bitopt(self.change_baud,0xff,0,9600,
                            {3:1200,
                             4:2400,
                             5:4800,
                             6:9600,
                             7:19200,
                             8:38400})
     self.attrdict = {self.addr:1,
                      self.checksum:7,
                      self.baudrate:5}
Exemplo n.º 6
0
    def __init__(self):
        Module.__init__(self)
        self.type = bitopt("type code",0xff,0,'40XX',
                         {0x40:'40XX'})
        self.id = bitopt("module identification",0x07,0,'ADAM-4050',
                         {0:'ADAM-4050'})
        self.attrdict.update({self.type:3,self.id:7})

        # Add the 4050's Digital Inputs.
        id = 0
        for di in self.di_list:
            di_ion = mpx.lib.factory('mpx.ion.adam.digital_in')
            di_ion.configure({'parent':self, 'name':di, 'id':id})
            id += 1
        # Add the initial output status, see TODO 1!
        self.do_status = [0,0,0,0,0,0,0,0]
        # Add the 4050's Digital Outputs.
        id = 0
        for do in self.do_list:
            do_ion = mpx.lib.factory('mpx.ion.adam.digital_out')
            do_ion.configure({'parent':self, 'name':do, 'id':id})
            id += 1
Exemplo n.º 7
0
    def __init__(self):
        Module.__init__(self)
        self.dataformat = bitopt(self.format_attribute,
                                 0x3,0,'Engineering units',
                                 {0:'Engineering units'})

        self.inputrange = bitopt(self.range_attribute,
                                 0xff,0,Range.pm_1V,
                                 {0x08:Range.pm_10V,
                                  0x09:Range.pm_5V,
                                  0x0a:Range.pm_1V,
                                  0x0b:Range.pm_500mV,
                                  0x0c:Range.pm_150mV,
                                  0x0d:Range.pm_20mA})

        self.integration = bitopt(self.integration_attribute,
                                  0x80,7,'50 ms',
                                  {0:'50 ms',
                                   1:'60 ms'})

        self.attrdict.update({self.dataformat:7, self.inputrange:3,
                              self.integration:7})