Ejemplo n.º 1
0
 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])
Ejemplo n.º 2
0
 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])
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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)
Ejemplo n.º 7
0
 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)
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 def buildGetDataRate(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadDataRate'))
Ejemplo n.º 12
0
 def buildGetSerialNo(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetSerialNo'))
Ejemplo n.º 13
0
 def buildGetUnitNo(self, channelNo):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetUnitNo'), [channelNo])
Ejemplo n.º 14
0
 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)
Ejemplo n.º 15
0
 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)
Ejemplo n.º 16
0
 def buildGetTXMode(self, index):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetTXMode'), [index])
Ejemplo n.º 17
0
 def buildWriteUserOffset(self, channelNo, userOffset):
     data = bytearray([channelNo])
     data.extend(userOffset)
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('WriteUserOffset'), data)
Ejemplo n.º 18
0
 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)
Ejemplo n.º 19
0
 def buildWriteUserOffset(self, channelNo, userOffset):
     data = bytearray([channelNo])
     data.extend(userOffset)
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('WriteUserOffset'), data)
Ejemplo n.º 20
0
 def buildReadUserOffset(self, channelNo):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('ReadUserOffset'), [channelNo])
Ejemplo n.º 21
0
 def buildgetFirmwareVersion(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetFirmwareVersion'))
Ejemplo n.º 22
0
 def buildWriteSetZero(self, channelNo):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetZero'), [channelNo])
Ejemplo n.º 23
0
 def buildWriteSaveAll(self, slot=0):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SaveAll'), [slot])
Ejemplo n.º 24
0
 def buildWriteSaveAll(self, slot=0):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SaveAll'), [slot])
Ejemplo n.º 25
0
 def buildgetFirmwareVersion(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetFirmwareVersion'))
Ejemplo n.º 26
0
 def buildSetInputTypeGSV8(self, channelNo, inputType):
     data = bytearray([channelNo, inputType])
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetInputType'), data)
Ejemplo n.º 27
0
 def buildSetInputTypeGSV8(self, channelNo, sensIndex, inputType):
     data = bytearray([channelNo, inputType])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetInputType'), data)
Ejemplo n.º 28
0
 def buildSetMEid(self, minor):
     magicCode = bytearray([0x4D, 0x45, 0x69, minor])
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('MEsetID'), magicCode)
Ejemplo n.º 29
0
 def buildGetDIOdirection(self, gruppe):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDIOdirection'),[gruppe])
Ejemplo n.º 30
0
 def buildGetTXMode(self, index):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetTXMode'), [index])
Ejemplo n.º 31
0
 def buildSetMode(self, ModeFlags_32Bit):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetMode'), ModeFlags_32Bit)
Ejemplo n.º 32
0
 def buildSetTXMode(self, index, mode):
     data = bytearray([index])
     data.extend(mode)
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetTXMode'), data)
Ejemplo n.º 33
0
 def buildWriteDataRate(self, dataRate):
     #dataRate = str(dataRate)
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('WriteDataRate'), dataRate)
Ejemplo n.º 34
0
 def buildGetDIOdirection(self, gruppe):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetDIOdirection'), [gruppe])
Ejemplo n.º 35
0
 def buildWriteUnitNo(self, channelNo, unitNo):
     data = bytearray([channelNo])
     data.append(unitNo)
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetUnitNo'), data)
Ejemplo n.º 36
0
 def buildGetDeviceHours(self, slot=0):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetDeviceHours'), [slot])
Ejemplo n.º 37
0
 def buildGetDeviceHours(self, slot=0):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDeviceHours'), [slot])
Ejemplo n.º 38
0
 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)
Ejemplo n.º 39
0
 def buildWriteDataRate(self, dataRate):
     dataRate = str(dataRate)
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('WriteDataRate'), dataRate)
Ejemplo n.º 40
0
 def buildGetMode(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetMode'))
Ejemplo n.º 41
0
 def buildWriteSetZero(self, channelNo):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetZero'), [channelNo])
Ejemplo n.º 42
0
 def buildSetMode(self, ModeFlags_32Bit):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetMode'), ModeFlags_32Bit)
Ejemplo n.º 43
0
 def buildReadUserOffset(self, channelNo):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadUserOffset'), [channelNo])
Ejemplo n.º 44
0
 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)
Ejemplo n.º 45
0
 def buildReadInputType(self, channelNo, sensindex=0x00):
     data = bytearray([self.convertUInt8ToBytes(channelNo), sensindex])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetInputType'), data)
Ejemplo n.º 46
0
 def buildGetSerialNo(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetSerialNo'))
Ejemplo n.º 47
0
 def buildSetMEid(self, minor):
     magicCode = bytearray([0x4D, 0x45, 0x69, minor])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('MEsetID'), magicCode)
Ejemplo n.º 48
0
 def buildGetDIOtype(self, IOPin):
     #data = bytearray([self.convertUInt8ToBytes(IOPin)])
     data = bytearray([IOPin])
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetDIOtype'), data)
Ejemplo n.º 49
0
 def buildSetTXMode(self, index, mode):
     data = bytearray([index])
     data.extend(mode)
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetTXMode'), data)
Ejemplo n.º 50
0
 def buildWriteUnitNo(self, channelNo, unitNo):
     data = bytearray([channelNo])
     data.append(unitNo)
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetUnitNo'), data)
Ejemplo n.º 51
0
 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)
Ejemplo n.º 52
0
 def buildGetUnitNo(self, channelNo):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetUnitNo'), [channelNo])
Ejemplo n.º 53
0
 def buildGetMode(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetMode'))
Ejemplo n.º 54
0
 def buildGetUnitText(self, slot):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetUnitText'), [
         slot])
Ejemplo n.º 55
0
 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)
Ejemplo n.º 56
0
 def buildGetUnitText(self, slot):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetUnitText'), [slot])
Ejemplo n.º 57
0
 def buildGetDIOtype(self, IOPin):
     data = bytearray([self.convertUInt8ToBytes(IOPin)])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDIOtype'),data)
Ejemplo n.º 58
0
 def buildGetDataRate(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('ReadDataRate'))
Ejemplo n.º 59
0
 def buildGet1WireTempValue(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('Get1WireTempValue'), [])
Ejemplo n.º 60
0
 def buildGet1WireTempValue(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('Get1WireTempValue'), [])