Modbus RTU
From Electrical Age
The Modbus RTU is an entity that allows your real life electrical monitoring equipment to communicate with your in game circuits via the Modbus protocol.
It is necessary to enable it in the config before you can use it. The game will warn you if it is not enabled in the configuration file.
some references to other modbus software
- https://github.com/jSCADA (live Jul 28th, 2019)
- https://play.google.com/store/apps/details?id=modbus.tesla.scada (live Jul 28th, 2019)
- https://play.google.com/store/apps/details?id=tesla.scada2.android (live Jul 28th, 2019)
- https://play.google.com/store/apps/details?id=com.bencatlin.modbusdroid (dead Jul 28th, 2019)
- Modbus RTU documentation (pdf) (dead Jul 28th, 2019)
example server side Python code
Note that you need to install the pymodbus pip package:
pip install --user pymodbus
Code listing
import time from pymodbus.client.sync import ModbusTcpClient client = ModbusTcpClient('127.0.0.1', 1502) while True: read = client.read_input_registers(10, 4).registers print(read) client.write_coil(15, read[3] > 1024*32) time.sleep(0.1) client.close()
You will also need to enable the Modbus RTU in the game config file. It only interacts with wireless signals at the time of writing, examples will be eventually provided.