-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inputs.modbus support string holding registers #9062
Comments
@tacuna have you been able to implement a workaround in the meanwhile? If so, are you willing to share it here? Might be helpful :) Much appreciated |
@tacuna tacuna) I'm interested as well like @steynovich already asked you. |
Unfortunately i have not. I was lucky enough that the string field is not mandatory information for my use-case thus simply do not read it out for the time being. |
A bit late to the party but a +1 for me |
Can you please test the binary in PR #14145 available once CI finished the tests successfully!? Let me know if this fixes the issue! |
Firstly, thank you so much for this. This is going to be a game changer for us in terms of device monitoring. Haven't had a lot of time to play with this, but at first glance I'm having a slight issue when polling an M580 Schneider PLC. The byte order does not seem to apply to the string, I tried them all. Might be something I'm doing wrong. This is a development instance of influx running in parallel to the production instance on a Wastewater Treatment works plant. Here's the telegraf: [[inputs.modbus]]
name = "casa"
timeout = "1s"
interval = "10s"
controller = "tcp://192.168.100.180:502"
transmission_mode = "auto"
debug_connection = true
configuration_type = "request"
[[inputs.modbus.request]]
byte_order = "CDAB"
slave_id = 1
register = "holding"
measurement = "casa_Aerobic"
fields = [
{ address=2540, name="XZVT_45_AE_107_HZ", type="FLOAT32"},
{ address=2530, name="XZVT_45_AE_107_VFLT", type="STRING", length=8 },
{ address=2544, name="XZVT_45_AE_107_VER", type="STRING", length=8 },
] Here's the debug stream:
PLC currently showing "No Fault" for those registers, and you can see the bytes are all swapped form the result "oNF uatl". Thanks again |
@KE-PaulBright first of all thank you for testing and thank you for reporting the, otherwise unnoticed, issue! I pushed a potential fix to PR #14145. Can you test once CI finished the tests!?! |
@KE-PaulBright any chance you can give the PR a test with your device? |
Sorry about the delay in getting back to you. Initial tests are positive, Getting "No Fault" & "KE MVI 1.0" as expected now when I swap the byte order. Will leave it running, add some more registers and report back after some more testing. Only Caveat is the Float value is now reversed as I can't specify the byte order per item in Modbus request as far as I know. Could create another request for strings only, but it would be awesome if there was a reverse word order option for strings that could be configured somewhere to prevent a clumsy conf. We already have two requests per PLC on the plant, one for high resolution metrics like levels, flows, frequencies, etc and one for low resolution metrics like flow totalizers, motor run hours, etc. That is obviously all a "nice to have" and this is already a huge leap forward for me. Thanks again for all your effort!
|
@KE-PaulBright thanks for testing! Just as a hint, the |
Thanks, I figured. We standardised on 8 registers for all strings on our PLC DFB's. |
Feature Request
Support reading (fixed size) strings from holding registers.
The documentation states:
However
string
does not seem to be accepted, or at least i did not manage to get it to work. If this is possible this issue should be converted to a "documentation clarification/bug" issue instead.Proposal:
Add support for
data_type = "string"
Current behavior:
There is no way to read strings without custom post-processing?
Desired behavior:
Be able to read (fixed size) string holding registers out of the box.
Use case:
The device i'm reading out has string data in its holding registers.
The text was updated successfully, but these errors were encountered: