예제 #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])
예제 #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])
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #11
0
 def buildGetDataRate(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadDataRate'))
예제 #12
0
 def buildGetSerialNo(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetSerialNo'))
예제 #13
0
 def buildGetUnitNo(self, channelNo):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetUnitNo'), [channelNo])
예제 #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)
예제 #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)
예제 #16
0
 def buildGetTXMode(self, index):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetTXMode'), [index])
예제 #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)
예제 #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)
예제 #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)
예제 #20
0
 def buildReadUserOffset(self, channelNo):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('ReadUserOffset'), [channelNo])
예제 #21
0
 def buildgetFirmwareVersion(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetFirmwareVersion'))
예제 #22
0
 def buildWriteSetZero(self, channelNo):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetZero'), [channelNo])
예제 #23
0
 def buildWriteSaveAll(self, slot=0):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SaveAll'), [slot])
예제 #24
0
 def buildWriteSaveAll(self, slot=0):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SaveAll'), [slot])
예제 #25
0
 def buildgetFirmwareVersion(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetFirmwareVersion'))
예제 #26
0
 def buildSetInputTypeGSV8(self, channelNo, inputType):
     data = bytearray([channelNo, inputType])
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetInputType'), data)
예제 #27
0
 def buildSetInputTypeGSV8(self, channelNo, sensIndex, inputType):
     data = bytearray([channelNo, inputType])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetInputType'), data)
예제 #28
0
 def buildSetMEid(self, minor):
     magicCode = bytearray([0x4D, 0x45, 0x69, minor])
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('MEsetID'), magicCode)
예제 #29
0
 def buildGetDIOdirection(self, gruppe):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDIOdirection'),[gruppe])
예제 #30
0
 def buildGetTXMode(self, index):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetTXMode'), [index])
예제 #31
0
 def buildSetMode(self, ModeFlags_32Bit):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetMode'), ModeFlags_32Bit)
예제 #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)
예제 #33
0
 def buildWriteDataRate(self, dataRate):
     #dataRate = str(dataRate)
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('WriteDataRate'), dataRate)
예제 #34
0
 def buildGetDIOdirection(self, gruppe):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetDIOdirection'), [gruppe])
예제 #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)
예제 #36
0
 def buildGetDeviceHours(self, slot=0):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetDeviceHours'), [slot])
예제 #37
0
 def buildGetDeviceHours(self, slot=0):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDeviceHours'), [slot])
예제 #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)
예제 #39
0
 def buildWriteDataRate(self, dataRate):
     dataRate = str(dataRate)
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('WriteDataRate'), dataRate)
예제 #40
0
 def buildGetMode(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetMode'))
예제 #41
0
 def buildWriteSetZero(self, channelNo):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('SetZero'), [channelNo])
예제 #42
0
 def buildSetMode(self, ModeFlags_32Bit):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('SetMode'), ModeFlags_32Bit)
예제 #43
0
 def buildReadUserOffset(self, channelNo):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('ReadUserOffset'), [channelNo])
예제 #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)
예제 #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)
예제 #46
0
 def buildGetSerialNo(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetSerialNo'))
예제 #47
0
 def buildSetMEid(self, minor):
     magicCode = bytearray([0x4D, 0x45, 0x69, minor])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('MEsetID'), magicCode)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #52
0
 def buildGetUnitNo(self, channelNo):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetUnitNo'), [channelNo])
예제 #53
0
 def buildGetMode(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetMode'))
예제 #54
0
 def buildGetUnitText(self, slot):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetUnitText'), [
         slot])
예제 #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)
예제 #56
0
 def buildGetUnitText(self, slot):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('GetUnitText'), [slot])
예제 #57
0
 def buildGetDIOtype(self, IOPin):
     data = bytearray([self.convertUInt8ToBytes(IOPin)])
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('GetDIOtype'),data)
예제 #58
0
 def buildGetDataRate(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('ReadDataRate'))
예제 #59
0
 def buildGet1WireTempValue(self):
     return self.encode_anfrage_frame(anfrage_code_to_shortcut.get('Get1WireTempValue'), [])
예제 #60
0
 def buildGet1WireTempValue(self):
     return self.encode_anfrage_frame(
         anfrage_code_to_shortcut.get('Get1WireTempValue'), [])