Reputation: 966
I am working on a project in which I'm using Pymodbus to connect to an industrial fan system. I am able to read some addresses on this fan, but not others. The fan's instruction booklet I am working with puts the addresses into "parameter groups", as follows:
Grouping | Description |
---|---|
Group 00 | Basic parameters |
Group 01 | V/F pattern selections and setup |
Group 02 | Motor parameters |
Group 03 | Multi function digital Inputs/Outputs |
... | |
Group 15 | PLC monitoring function |
For each grouping (1-15) above, there are then more specific addresses provided in later pages of the manual. For example, for Group 00, above, there are address entries specified as below:
Group-address | Description | Range |
---|---|---|
00-00 | Control Mode Selection | 0: V/F Mode, 1: Vector mode |
00-02 | Main run command. | 0: Keypad, 1:Communication, 2: PLC |
... | ||
00-20. | Jog deceleration time. | ~0.1-3600.0 |
I am able to access and print the above addresses (for the case of the grouping of '00') with the following Python script:
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
modbus_conn = ModbusClient(method='rtu', port="/dev/tty.usbserial-AQ00BYCR",baudrate=38400,parity = 'O')
modbus_conn.connect()
print(modbus_conn.read_holding_registers(0,20,unit=1).registers[0])
The problem, however, is that I cannot access the higher groupings ('01' -> '15'). For example, if I try to access any address higher than 20 with the above script, I get a "no registers there" error. I'm assuming this is because I am locked into sampling the first grouping ('00') with my script.
I explored the idea that groupings specify different address starting points, so I tested to see whether '01', for example, meant an address starting at the location of '100', as below:
modbus_conn.read_holding_registers(100,5,unit=1).registers[0]
but this turned out not to work (since I again got 'no register exists there' errors).
What am I doing wrong?
What am I missing?
Does anyone out there know how to access addresses that are grouped in the above way? This is the first time I've seen this, and I am stumped.
Thank you in advance!
Upvotes: 0
Views: 273
Reputation: 18380
As per the comments the first issue was that the manual you were using was out of date. By searching for "V/F pattern selections and setup"
I located an updated manual. This updated manual included a table that linked the 'groupings' to registers (pages 'App3-13' to 'App3-18'). For example function 01-0
(part of group 01) 'Volts/Hz Patterns' is in holding register 0100H (100 hex).
With the updated manual it is easier to determine how to map from grouping/function to the appropriate register. One potential issue is that the manual refers to the registers in hex (100H
) so when querying in Python you need to use something like modbus_conn.read_holding_registers(0x100,1,unit=1).registers[0]
(this probably explains why your initial attempt failed).
note: when posting this kind of question the more details you can provide the better e.g. device manufacturer, model etc).
Upvotes: 2
Reputation: 389
There might be a scheme like below in the documentation of the device:
Address GGnnH: GG means parameter group, nn means parameter number, for example, the address of Pr 04-01 is 0401H. (The 'H' means that the number, 401 in this example, is hexadecimal. Thus 0401H is register 1025)
Upvotes: 2
Reputation: 4127
Classifying it as groupings for me is very confusing.
To read holding registers you have to pass the offset of the first one and how many you want to read, that's all.
Perhaps the device has no more than 20 readable registers, so if you pass an offset of 10 with a quantity of 20 then you are trying to read up to the 30th register which may not exist.
Upvotes: 0