Interface Task

    • Method Detail

      • getElements

        ModbusElement<?>[] getElements()
        Gets the ModbusElements.
        Returns:
        an array of ModbusElements
      • getStartAddress

        int getStartAddress()
        Gets the start Modbus register address.
        Returns:
        the address
      • getLength

        int getLength()
        Gets the length from first to last Modbus register address.
        Returns:
        the address
      • getParent

        ModbusComponent getParent()
        Gets the parent.
        Returns:
        the parent
      • deactivate

        void deactivate()
        This is called on deactivate of the Modbus-Bridge. It can be used to clear any references like listeners.
      • execute

        <T> int execute​(AbstractModbusBridge bridge)
                 throws OpenemsException
        Executes the tasks - i.e. sends the query of a ReadTask or writes a WriteTask.
        Type Parameters:
        T - the Modbus-Element
        Parameters:
        bridge - the Modbus-Bridge
        Returns:
        the number of executed Sub-Tasks
        Throws:
        OpenemsException - on error
      • hasBeenExecuted

        boolean hasBeenExecuted()
        Gets whether this ReadTask has been successfully executed before.
        Returns:
        true if this Task has been executed successfully at least once
      • getExecuteDuration

        long getExecuteDuration()
        Gets the execution duration of the last execution (successful or not not successful) in [ms].
        Returns:
        the duration in [ms]