easymodbus/modbusClient.py
def convert_double_to_two_registers(doubleValue, register_order=RegisterOrder.lowHigh):
    """
    Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers
    doubleValue: Value to be converted
    register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh
    return: 16 Bit Register values int[]
    """
    myList = list()

    myList.append(int(doubleValue & 0x0000FFFF))  # Append Least Significant Word
    myList.append(int((doubleValue & 0xFFFF0000) >> 16))  # Append Most Significant Word
    if register_order == RegisterOrder.highLow:
        myList[0] = int((doubleValue & 0xFFFF0000) >> 16)
        myList[1] = int(doubleValue & 0x0000FFFF)
    return myList

    Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers
    doubleValue: Value to be converted
    register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh
    return: 16 Bit Register values int[]
    
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers
doubleValue: Value to be converted
register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh
return: 16 Bit Register values int[]
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue : Value to be converted register_order : Desired Word Order ( Low Register first or High Register first - Default : RegisterOrder . lowHigh return : 16 Bit Register values int []
def convert_double_to_two_registers(doubleValue, register_order=RegisterOrder.lowHigh):
    myList = list()
    myList.append(int(doubleValue & 0x0000FFFF))  
    myList.append(int((doubleValue & 0xFFFF0000) >> 16))  
    if register_order == RegisterOrder.highLow:
        myList[0] = int((doubleValue & 0xFFFF0000) >> 16)
        myList[1] = int(doubleValue & 0x0000FFFF)
    return myList
def convert_double_to_two_registers ( doubleValue , register_order = RegisterOrder . lowHigh ) : myList = list ( ) myList . append ( int ( doubleValue & 0x0000FFFF ) ) myList . append ( int ( ( doubleValue & 0xFFFF0000 ) >> 16 ) ) if register_order == RegisterOrder . highLow : myList [ 0 ] = int ( ( doubleValue & 0xFFFF0000 ) >> 16 ) myList [ 1 ] = int ( doubleValue & 0x0000FFFF ) return myList
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers
doubleValue: Value to be converted
register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh
return: 16 Bit Register values int[]
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue : Value to be converted register_order : Desired Word Order ( Low Register first or High Register first - Default : RegisterOrder . lowHigh return : 16 Bit Register values int []
"""
    Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers
    doubleValue: Value to be converted
    register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh
    return: 16 Bit Register values int[]
    """ # Append Least Significant Word # Append Most Significant Word
doubleValue
register_order