Class FC5WriteCoilTask

java.lang.Object
io.openems.edge.bridge.modbus.api.task.AbstractTask<com.ghgande.j2mod.modbus.msg.WriteCoilRequest,com.ghgande.j2mod.modbus.msg.WriteCoilResponse>
io.openems.edge.bridge.modbus.api.task.AbstractWriteTask<com.ghgande.j2mod.modbus.msg.WriteCoilRequest,com.ghgande.j2mod.modbus.msg.WriteCoilResponse>
io.openems.edge.bridge.modbus.api.task.AbstractWriteTask.Single<com.ghgande.j2mod.modbus.msg.WriteCoilRequest,com.ghgande.j2mod.modbus.msg.WriteCoilResponse,CoilElement>
io.openems.edge.bridge.modbus.api.task.FC5WriteCoilTask
All Implemented Interfaces:
Task, WriteTask, ManagedTask

public class FC5WriteCoilTask extends AbstractWriteTask.Single<com.ghgande.j2mod.modbus.msg.WriteCoilRequest,com.ghgande.j2mod.modbus.msg.WriteCoilResponse,CoilElement>
Implements a Write Single Coil Task, using Modbus function code 5 (http://www.simplymodbus.ca/FC05.htm).
  • Constructor Details

    • FC5WriteCoilTask

      public FC5WriteCoilTask(int startAddress, CoilElement element)
  • Method Details

    • createModbusRequest

      protected com.ghgande.j2mod.modbus.msg.WriteCoilRequest createModbusRequest() throws OpenemsException
      Description copied from class: AbstractWriteTask.Single
      Factory for a ModbusRequest.
      Specified by:
      createModbusRequest in class AbstractWriteTask.Single<com.ghgande.j2mod.modbus.msg.WriteCoilRequest,com.ghgande.j2mod.modbus.msg.WriteCoilResponse,CoilElement>
      Returns:
      a new ModbusRequest
      Throws:
      OpenemsException - on error
    • payloadToString

      protected String payloadToString(com.ghgande.j2mod.modbus.msg.WriteCoilRequest request)
      Description copied from class: AbstractTask
      Converts the actual payload of the REQUEST to a human readable format suitable for logs; without header data (like Unit-ID, function code, checksum, etc).
      Specified by:
      payloadToString in class AbstractTask<com.ghgande.j2mod.modbus.msg.WriteCoilRequest,com.ghgande.j2mod.modbus.msg.WriteCoilResponse>
      Parameters:
      request - the request
      Returns:
      a string