func (m *Modbus) floatGetter(op modbus.Operation) (float64, error) {
	var res meters.MeasurementResult
	var err error

	if dev, ok := m.device.(*rs485.RS485); ok {
		res, err = dev.QueryOp(m.conn, op.MBMD)
	}

	if dev, ok := m.device.(*sunspec.SunSpec); ok {
		if op.MBMD.IEC61850 != 0 {
			res, err = dev.QueryOp(m.conn, op.MBMD.IEC61850)
		} else {
			res, err = dev.QueryPoint(
				m.conn,
				op.SunSpec.Model,
				op.SunSpec.Block,
				op.SunSpec.Point,
			)
		}
	}

	// silence NaN reading errors by assuming zero
	if err != nil && errors.Is(err, meters.ErrNaN) {
		res.Value = 0
		err = nil
	}

	if err == nil {
		m.log.TRACE.Printf("%+v", res)
	}

	return res.Value, err
}
// floatGetter executes configured modbus read operation and implements func() (float64, error)
floatGetter executes configured modbus read operation and implements func() (float64, error)
// floatGetter executes configured modbus read operation and implements func () ( float64 error )
func (m *Modbus) floatGetter(op modbus.Operation) (float64, error) {
	var res meters.MeasurementResult
	var err error
	if dev, ok := m.device.(*rs485.RS485); ok {
		res, err = dev.QueryOp(m.conn, op.MBMD)
	}
	if dev, ok := m.device.(*sunspec.SunSpec); ok {
		if op.MBMD.IEC61850 != 0 {
			res, err = dev.QueryOp(m.conn, op.MBMD.IEC61850)
		} else {
			res, err = dev.QueryPoint(
				m.conn,
				op.SunSpec.Model,
				op.SunSpec.Block,
				op.SunSpec.Point,
			)
		}
	}
	if err != nil && errors.Is(err, meters.ErrNaN) {
		res.Value = 0
		err = nil
	}
	if err == nil {
		m.log.TRACE.Printf("%+v", res)
	}
	return res.Value, err
}
func ( m * Modbus ) floatGetter ( op modbus . Operation ) ( float64 , error ) { var res meters . MeasurementResult var err error if dev , ok := m . device . ( * rs485 . RS485 ) ; ok { res , err = dev . QueryOp ( m . conn , op . MBMD ) } if dev , ok := m . device . ( * sunspec . SunSpec ) ; ok { if op . MBMD . IEC61850 != 0 { res , err = dev . QueryOp ( m . conn , op . MBMD . IEC61850 ) } else { res , err = dev . QueryPoint ( m . conn , op . SunSpec . Model , op . SunSpec . Block , op . SunSpec . Point , ) } } if err != nil && errors . Is ( err , meters . ErrNaN ) { res . Value = 0 err = nil } if err == nil { m . log . TRACE . Printf ( " " , res ) } return res . Value , err }
floatGetter executes configured modbus read operation and implements func() (float64, error)
floatGetter executes configured modbus read operation and implements func () ( float64 error )
// silence NaN reading errors by assuming zero