示例#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'), [])