How to Send Multiple Modbus Commands via Console

We are currently communicating between a Tektelic Industrial Sensor and an RTU via serial RS-232, and able to poll Modbus data through the Things Network console. Modbus polling was enabled, and a Modbus command (e.g., 01 03 00 6B 00 03 74 17 - to read holding registers) is entered into the Downlink Payload field, port 20.

The sensor returns the correct data for any type of Modbus command, but the question is, is it possible to send more than one “type” of Modbus command in a single Downlink Payload through the console? The Modbus types being, Coil Status (FC01), Input Status (FC02), Holding Register (FC03), and Input Registers (FC04). It seems limiting that the console can only repeat a single Modbus command and not be able to cycle through other commands.

Am I missing something here or doing something wrong?

That fully depends on the handling in your node. If, say, each command has a specific length, then the handling in the device could split a single downlink into multiple commands, when not using a specific port for each command. But all that’s not the responsibility of the LoRaWAN protocol, nor the network provider. In fact, LoRaWAN Class A is not very suitable to control things.

Also note that while scheduling a downlink you can either replace the existing scheduled downlink (if any), or schedule an additional downlink. So, you could schedule multiple downlinks, and then it’s up to the Class A device to transmit another uplink to get the next downlink. LoRaWAN should indicate if more downlinks are pending, but I’ve never tested if TTN has implemented that, and you’ll need to check if your device handles it too:

4.3.1.4 Frame pending bit (FPending in FCtrl, downlink only)

The frame pending bit (FPending) is only used in downlink communication, indicating that the gateway has more data pending to be sent and therefore asking the end-device to open another receive window as soon as possible by sending another uplink message.

The exact use of FPending bit is described in Chapter 18.3.

Asides: rather than using TTN Console you could also use ttnctl or the data API to schedule downlinks. When creating downlinks from an application, they might not be sent immediately; see My application's downlink is always queued for next uplink. Beware that on the TTN community network you are only allowed 10 downlinks per day, including confirmations. And remember this is radio: your downlink might not be received.

2 Likes

I don’t know details of the Tektelic industrial sensor but with Tektelic’s Smart Room Sensor (aka Kona Home Sensor) it is possible to send multiple commands in a single downlink message. That is standard supported by the message protocol implemented in the Smart Room Sensor.

I’m not aware if you use the public TTN or a private LoRaWAN network, but be aware of the limitation of max downlink messages allowed per day.
For the Smart Room Sensor this is not an issue because the downlink messages are mainly used for setting up/configuring the device.

1 Like