def buildGetInterface(self, uebertragung=None): if uebertragung is None: return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetInterface'), [0x00]) elif uebertragung: return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetInterface'), [0x02]) else: return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetInterface'), [0x01])
def buildGetInterface(self, uebertragung=None): if uebertragung is None: return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetInterface'), [0x00]) elif uebertragung: return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetInterface'), [0x02]) else: return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetInterface'), [0x01])
def buildWriteDIOthreshold(self, IOPin, upper_or_lower_trigger, threshold_value): #data = bytearray([self.convertUInt8ToBytes(IOPin), self.convertUInt8ToBytes(upper_or_lower_trigger)]) data = bytearray([IOPin, upper_or_lower_trigger]) data.extend(self.convertFloatToBytes(threshold_value)) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('WriteDIOthreshold'), data)
def buildSetUnitText(self, text, slot=0): if slot <= 0 or slot > 1: data = bytearray([0x00, 0x00]) else: data = bytearray([0x01, 0x00]) data.extend(bytearray(text.encode('ascii', 'replace'))) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetUnitText'), data)
def buildWriteInputType(self, channelNo, sensIndex, inputType, isGSV_6=True): if isGSV_6: channelNo = 0 data = bytearray([channelNo]) data.append(sensIndex) data.extend(inputType) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get("MEwriteInputRange"), data)
def buildSetDIOtype(self, IOPin, DIOtype, assignedDMSchannel): data = bytearray([self.convertUInt8ToBytes(IOPin)]) if(type(DIOtype) is bytearray): data.extend(DIOtype) else: data.extend(self.convertUInt32ToBytes(DIOtype)[1:]) data.append(self.convertUInt8ToBytes(assignedDMSchannel)) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetDIOtype'), data)
def buildSetUnitText(self, text, slot=0): if slot <= 0 or slot > 1: data = bytearray([0x00, 0x00]) else: data = bytearray([0x01, 0x00]) data.extend(bytearray(text.encode('ascii', 'replace'))) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetUnitText'), data)
def buildSetDIOdirection(self, gruppe, direction): # level umwandeln #data = bytearray([self.convertUInt8ToBytes(gruppe)]) data = bytearray([gruppe]) #data.append(self.convertUInt8ToBytes(direction)) data.append(direction) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetDIOdirection'), data)
def buildSetDIOtype(self, IOPin, DIOtype, assignedDMSchannel): #data = bytearray([self.convertUInt8ToBytes(IOPin)]) data = bytearray([IOPin]) if (type(DIOtype) is bytearray): data.extend(DIOtype) else: data.extend(self.convertUInt32ToBytes(DIOtype)[1:]) #data.append(self.convertUInt8ToBytes(assignedDMSchannel)) data.append(assignedDMSchannel) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetDIOtype'), data)
def buildWriteInputType(self, channelNo, sensIndex, inputType, isGSV_6=True): if isGSV_6: channelNo = 0 data = bytearray([channelNo]) data.append(sensIndex) data.extend(inputType) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('MEwriteInputRange'), data)
def buildGetDataRate(self): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadDataRate'))
def buildGetSerialNo(self): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetSerialNo'))
def buildGetUnitNo(self, channelNo): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetUnitNo'), [channelNo])
def buildWriteDIOthreshold(self, IOPin, upper_or_lower_trigger, threshold_value): data = bytearray([self.convertUInt8ToBytes(IOPin), self.convertUInt8ToBytes(upper_or_lower_trigger)]) data.extend(self.convertFloatToBytes(threshold_value)) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('WriteDIOthreshold'), data)
def buildSetDIOinitialLevel(self, IOPin, newlevel): data = bytearray([self.convertUInt8ToBytes(IOPin)]) data.extend(self.convertUInt16ToBytes(newlevel)) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetDIOinitialLevel'), data)
def buildGetTXMode(self, index): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetTXMode'), [index])
def buildWriteUserOffset(self, channelNo, userOffset): data = bytearray([channelNo]) data.extend(userOffset) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('WriteUserOffset'), data)
def buildReadInputType(self, channelNo, sensindex=0x00): #data = bytearray([self.convertUInt8ToBytes(channelNo), self.convertUInt8ToBytes(sensindex)]) data = bytearray([channelNo, sensindex]) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetInputType'), data)
def buildWriteUserOffset(self, channelNo, userOffset): data = bytearray([channelNo]) data.extend(userOffset) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('WriteUserOffset'), data)
def buildReadUserOffset(self, channelNo): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('ReadUserOffset'), [channelNo])
def buildgetFirmwareVersion(self): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetFirmwareVersion'))
def buildWriteSetZero(self, channelNo): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetZero'), [channelNo])
def buildWriteSaveAll(self, slot=0): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SaveAll'), [slot])
def buildWriteSaveAll(self, slot=0): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SaveAll'), [slot])
def buildgetFirmwareVersion(self): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetFirmwareVersion'))
def buildSetInputTypeGSV8(self, channelNo, inputType): data = bytearray([channelNo, inputType]) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetInputType'), data)
def buildSetInputTypeGSV8(self, channelNo, sensIndex, inputType): data = bytearray([channelNo, inputType]) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetInputType'), data)
def buildSetMEid(self, minor): magicCode = bytearray([0x4D, 0x45, 0x69, minor]) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('MEsetID'), magicCode)
def buildGetDIOdirection(self, gruppe): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDIOdirection'),[gruppe])
def buildGetTXMode(self, index): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetTXMode'), [index])
def buildSetMode(self, ModeFlags_32Bit): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetMode'), ModeFlags_32Bit)
def buildSetTXMode(self, index, mode): data = bytearray([index]) data.extend(mode) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetTXMode'), data)
def buildWriteDataRate(self, dataRate): #dataRate = str(dataRate) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('WriteDataRate'), dataRate)
def buildGetDIOdirection(self, gruppe): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetDIOdirection'), [gruppe])
def buildWriteUnitNo(self, channelNo, unitNo): data = bytearray([channelNo]) data.append(unitNo) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetUnitNo'), data)
def buildGetDeviceHours(self, slot=0): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetDeviceHours'), [slot])
def buildGetDeviceHours(self, slot=0): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDeviceHours'), [slot])
def buildSetDIOinitialLevel(self, IOPin, newlevel): #data = bytearray([self.convertUInt8ToBytes(IOPin)]) data = bytearray([IOPin]) data.extend(self.convertUInt16ToBytes(newlevel)) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetDIOinitialLevel'), data)
def buildWriteDataRate(self, dataRate): dataRate = str(dataRate) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('WriteDataRate'), dataRate)
def buildGetMode(self): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetMode'))
def buildWriteSetZero(self, channelNo): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetZero'), [channelNo])
def buildSetMode(self, ModeFlags_32Bit): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetMode'), ModeFlags_32Bit)
def buildReadUserOffset(self, channelNo): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadUserOffset'), [channelNo])
def buildReadDIOthreshold(self, IOPin, upper_or_lower_trigger): #data = bytearray([self.convertUInt8ToBytes(IOPin), self.convertUInt8ToBytes(upper_or_lower_trigger)]) data = bytearray([IOPin, upper_or_lower_trigger]) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('ReadDIOthreshold'), data)
def buildReadInputType(self, channelNo, sensindex=0x00): data = bytearray([self.convertUInt8ToBytes(channelNo), sensindex]) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetInputType'), data)
def buildGetSerialNo(self): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetSerialNo'))
def buildSetMEid(self, minor): magicCode = bytearray([0x4D, 0x45, 0x69, minor]) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('MEsetID'), magicCode)
def buildGetDIOtype(self, IOPin): #data = bytearray([self.convertUInt8ToBytes(IOPin)]) data = bytearray([IOPin]) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetDIOtype'), data)
def buildSetTXMode(self, index, mode): data = bytearray([index]) data.extend(mode) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetTXMode'), data)
def buildWriteUnitNo(self, channelNo, unitNo): data = bytearray([channelNo]) data.append(unitNo) return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('SetUnitNo'), data)
def buildSetDIOdirection(self, gruppe, direction): # level umwandeln data = bytearray([self.convertUInt8ToBytes(gruppe)]) data.append(self.convertUInt8ToBytes(direction)) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetDIOdirection'), data)
def buildGetUnitNo(self, channelNo): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetUnitNo'), [channelNo])
def buildGetMode(self): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetMode'))
def buildGetUnitText(self, slot): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetUnitText'), [ slot])
def buildReadDIOthreshold(self, IOPin,upper_or_lower_trigger): data = bytearray([self.convertUInt8ToBytes(IOPin), self.convertUInt8ToBytes(upper_or_lower_trigger)]) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadDIOthreshold'),data)
def buildGetUnitText(self, slot): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('GetUnitText'), [slot])
def buildGetDIOtype(self, IOPin): data = bytearray([self.convertUInt8ToBytes(IOPin)]) return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDIOtype'),data)
def buildGetDataRate(self): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('ReadDataRate'))
def buildGet1WireTempValue(self): return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('Get1WireTempValue'), [])
def buildGet1WireTempValue(self): return self.encode_anfrage_frame( anfrage_code_to_shortcut.get('Get1WireTempValue'), [])