NT18B07 7-channel NTC temperature interface board

../../../../../../_images/nt18b07.jpg
  • Registers 0-6 contain temperature readings in 0.1 degree celcius increments

  • Register 254 contains slave ID, R/W, default 1

namespace NT18B07

Modbus/NT18B07/Device.h

Copyright 2022 mikee47 mike@sillyhouse.net

This file is part of the IOControl Library

This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.

Rayleigh Instruments RI-D35 energy meter

Device registers are read-only. The Node ID corresponds to the register address.

Modbus/NT18B07/Request.h

Copyright 2022 mikee47 mike@sillyhouse.net

This file is part of the IOControl Library

This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see https://www.gnu.org/licenses/.

Typedefs

using TempData = int16_t[channelCount]

Variables

const size_t channelCount = {7}
class Device : public IO::Modbus::Device
#include <Device.h>

Public Functions

virtual IO::Request *createRequest() override

Create a request object for this device.

Return values:

Request* – Caller must destroy or submit the request

int16_t getIntValue(uint8_t channel) const

Get temperature value in 0.1C increments (avoids floating point)

inline virtual uint16_t maxNodes() const override

Determine maximum number of nodes supported by the device.

Return values:

uint16_t – 0 if device doesn’t support nodes

struct Config
#include <Device.h>

NT18B07 device configuration.

Public Members

Modbus::Device::Config modbus

Basic modbus configuration.

struct Comp
#include <Device.h>
class Factory : public IO::RS485::Device::FactoryTemplate<Device>
#include <Device.h>

Public Functions

inline virtual const FlashString &deviceClass() const override

Return the Device class name, e.g. ‘r421a’.

class Request : public IO::Modbus::Request
#include <Request.h>

Public Functions

virtual void getJson(JsonObject json) const override

Get result of a completed request in JSON format.

virtual ErrorCode callback(PDU &pdu) override

Process a received PDU.

Parameters:

pdu

Return values:

ErrorCode – If request is re-submitted, return Error::pending, otherwise request will be completed with given error.