Ejemplo n.º 1
0
def write_single_coil(slave_id, address, value):
    """ Return ADU for Modbus function code 05: Write Single Coil.

    :param slave_id: Number of slave.
    :return: Byte array with ADU.
    """
    function = WriteSingleCoil()
    function.address = address
    function.value = value

    return _create_request_adu(slave_id, function.request_pdu)
Ejemplo n.º 2
0
def write_single_coil(slave_id, address, value):
    """ Return ADU for Modbus function code 05: Write Single Coil.

    :param slave_id: Number of slave.
    :return: Byte array with ADU.
    """
    function = WriteSingleCoil()
    function.address = address
    function.value = value

    return _create_request_adu(slave_id, function.request_pdu)
Ejemplo n.º 3
0
def write_single_coil():
    instance = WriteSingleCoil()
    instance.address = 100
    instance.value = 1

    return instance
def write_single_coil():
    instance = WriteSingleCoil()
    instance.address = 100
    instance.value = 1

    return instance