示例#1
0
    def initialize(self):
        """
        Controller intialization : opens a single socket for all 3 axes.
        """

        self.trace("controller initialize")
        self.host = self.config.get("host")
        self.trace("opening socket")
        self.sock = pi_gcs.get_pi_comm(self.config, TCP)

        # just in case
        self.sock.flush()
示例#2
0
    def initialize(self):
        """
        Controller intialization : opens a single serial for all axes.
        """
        self.serial = pi_gcs.get_pi_comm(self.config, SERIAL, baudrate=115200)

        self._status = ""
        try:
            self.serial.write("ERR?\n")
            _ans = self.serial.readline()
            print "err=%r" % _ans
            self.serial.write("*IDN?\n")
            _ans = self.serial.readline()
            print _ans
            # 871 : '(c)2013 Physik Instrumente (PI) GmbH & Co. KG, E-871.1A1, 0, 01.00'
            # 873 : '(c)2015 Physik Instrumente (PI) GmbH & Co. KG, E-873.1A1, 115072229, 01.09'
            elog.debug(_ans)

            try:
                id_pos = _ans.index("E-871")
            except:
                elog.info("not a 871")
                raise

            try:
                id_pos = _ans.index("E-873")
            except:
                elog.info("not a 873")
                raise

            if id_pos > 0 and id_pos < 100:
                elog.debug("controller is responsive ID=%s" % _ans)
            elif id_pos == 0:
                elog.debug("error : *IDN? -> %r" % _ans)
        except:
            self._status = "communication error : no PI E871 or E873 found on serial \"%s\"" % self.serial_line
            print self._status
            elog.debug(self._status)
示例#3
0
    def initialize(self):
        """
        Controller intialization : opens a single serial for all axes.
        """
        self.serial = pi_gcs.get_pi_comm(self.config, SERIAL)

        self._status = ""
        try:
            self.serial.write("ERR?\n")
            _ans = self.serial.readline()
            print "err=%r" % _ans
            self.serial.write("*IDN?\n")
            _ans = self.serial.readline()
            print _ans
            # _ans =='(c)2013 Physik Instrumente(PI) Karlsruhe, C-663.11,0,1.2.1.0'
            elog.debug(_ans)
            if _ans.index("C-663.11") == 0:
                print "zero"
                elog.debug("*IDN? -> %r" % _ans)
        except:
            self._status = "communication error : no PI C663 found on serial \"%s\"" % self.serial_line
            print self._status
            elog.debug(self._status)
示例#4
0
    def initialize(self):
        """
        Controller intialization : opens a single serial for all axes.
        """
        self.serial = pi_gcs.get_pi_comm(self.config, SERIAL)

        self._status = ""
        try:
            self.serial.write("ERR?\n")
            _ans = self.serial.readline()
            print "err=%r" % _ans
            self.serial.write("*IDN?\n")
            _ans = self.serial.readline()
            print _ans
            # _ans =='(c)2013 Physik Instrumente(PI) Karlsruhe, C-663.11,0,1.2.1.0'
            elog.debug(_ans)
            if _ans.index("C-663.11") == 0:
                print "zero"
                elog.debug("*IDN? -> %r" % _ans)
        except:
            self._status = "communication error : no PI C663 found on serial \"%s\"" % self.serial_line
            print self._status
            elog.debug(self._status)
示例#5
0
 def initialize(self):
     """
     Controller intialization : opens a single socket for all 3 axes.
     """
     self.sock = pi_gcs.get_pi_comm(self.config, TCP)
示例#6
0
 def initialize(self):
     """
     Controller intialization : opens a single socket for all 3 axes.
     """
     self.sock = pi_gcs.get_pi_comm(self.config, TCP)
示例#7
0
 def initialize(self):
     self.sock = pi_gcs.get_pi_comm(self.config, TCP)
示例#8
0
 def initialize(self):
     self.sock = pi_gcs.get_pi_comm(self.config, TCP)