How to acquire data from Modbus TCP devices #10
Unanswered
guangyuzhang
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Login MyEMS admin
Go to System Settings | Gateway Settings
Click 'Add Gateway' to add a gateway, click 'Save' then copy the ID and Token for configuring myems-modbus-tcp service.
Go to System Settings | Data Source Settings
Click 'Add Data Source' to add a datasource, the default tab is 'Data Source'
Select the Gateway created in Step 3, input 'modbus-tcp' for Protocol, input '{"host":"192.168.9.101","port":502}' for Connection, change the IP address and Port according to your Modbus device.
Click the 'Point' tab of Data Source Settings, select the datasource created in Step 6.
Click 'Add Point' to create a point.
In the 'Object Type' dropdown list, 'ENERGY_VALUE' is an incremental energy consumption value of parameter of a meter, 'ANALOG_VALUE' is time-varying "quantities" (voltage, current, etc.), and 'DIGITAL_VALUE' must have a finite set of possible values. The number of values in the set can be anywhere between two and a-very-large-number-that's-not-infinity. Most commonly digital signals will be one of two values -- like either 0V or 5V. Timing graphs of these signals look like square waves.
If 'Is Trend' is checked, the value will be saved to the historical database(myems_historcial_db)
In 'Address(JSON)' area, for 'modbus-tcp' protocol, please use the template below,
{"byte_swap":true,"format":"<l","function_code":3,"number_of_registers":2,"offset":6401,"slave_id":1}
'byte_swap' for Byte Swapping
'format': refer to Format Strings
Once you have add all Gateways, Data Sources and Points, please update config.py under myems_modbus-tcp and then install and start the myems_modbus_tcp service. Refer to myems_modbus_tcp
Beta Was this translation helpful? Give feedback.
All reactions