def initialize(self,va):
        self.va = va
        errcode = self.va.fnLMS_InitDevice(self.ID)
        if (errcode !=0):
            errcodereset = self.va.fnLMS_CloseDevice(self.ID)
            if (errcodereset != 0):     #if device fails to initialize, it may be because it was not closed previously. Try closing and reinitializing it.
                logger.error("Failed to initialize Vaunix device {}. Error code {}.".format(self.ID,errcode))
                raise PauseError
            errcode = self.va.fnLMS_InitDevice(self.ID)
            if (errcode != 0):
                logger.error("Failed to initialize Vaunix device {}. Error code {}.".format(self.ID,errcode))
                raise PauseError
        self.maxPower = int(self.va.fnLMS_GetMaxPwr(self.ID)/4)
        self.minPower = int(self.va.fnLMS_GetMinPwr(self.ID)/4)
        self.minFreq = int(self.va.fnLMS_GetMinFreq(self.ID))
        self.maxFreq = int(self.va.fnLMS_GetMaxFreq(self.ID))