Hi Brian,
Here’s a code snippet from the minimalmodbus docs page that may be of help:
#!/usr/bin/env python
import minimalmodbus
instrument = minimalmodbus.Instrument('/dev/ttyUSB1', 1) # port name, slave address (in decimal)
## Read temperature ##
temperature = instrument.read_register(289, 1) # Registernumber, number of decimals
Since I’m not familair with the Helios device you’re using, some of this is a SWAG.
That should make the comand to read register 18, an unsigned 16-bit value representing max CO2 concenration, something like this:
max_co2 = instrument.read_register(18, 0)
Going on the premise the value in register 20 is a signed integer,
reading register 20 should be similar to this:
outdoor_air_temp = instrument.read_register(20, 0, 3, true)
where:
20 = register number
0 = number of decimal places
3 = function number (read holding registers)
true = signed integer flag
The minimalmodbus API docs are at:
https://minimalmodbus.readthedocs.io/en/master/apiminimalmodbus.html
and details are at:
https://minimalmodbus.readthedocs.io/en/master/modbusdetails.html
Here’s another link that should help get you going:
If you have a way to ensure only one of the two masters can transmit at any given time, and the 3.5 character “silent interval” (~4 mS at 9600 bps) passes before a subsequent transmision, more than one master shouldn’t be a problem.
Ref: http://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf (section 2.5.1.1, page 13)