UT330BUI/model/UT330.py
def modbusCRC(data):

    """Returns the Modbus CRC as two bytes. Be careful of the order."""

    # If the contnets of the data list are not all integers, this function
    # will have problems. Future action is to check all elements are ints

    crc = 0xFFFF

    for number in data:
        crc = (crc >> 8) ^ TABLE[(crc ^ number) & 0xFF]

    MSB = crc >> 8  # Most Significant Byte
    LSB = crc & 255  # Least Significant Byte

    return MSB, LSB
Returns the Modbus CRC as two bytes. Be careful of the order.
Returns the Modbus CRC as two bytes. Be careful of the order.
Returns the Modbus CRC as two bytes . Be careful of the order .
def modbusCRC(data):
    crc = 0xFFFF
    for number in data:
        crc = (crc >> 8) ^ TABLE[(crc ^ number) & 0xFF]
    MSB = crc >> 8  
    LSB = crc & 255  
    return MSB, LSB
def modbusCRC ( data ) : crc = 0xFFFF for number in data : crc = ( crc >> 8 ) ^ TABLE [ ( crc ^ number ) & 0xFF ] MSB = crc >> 8 LSB = crc & 255 return MSB , LSB
Returns the Modbus CRC as two bytes.
Returns the Modbus CRC as two bytes .
"""Returns the Modbus CRC as two bytes. Be careful of the order.""" # If the contnets of the data list are not all integers, this function # will have problems. Future action is to check all elements are ints # Most Significant Byte # Least Significant Byte
data