-
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
Modbus Input plugin #6154
Modbus Input plugin #6154
Conversation
Hello da
Added a datatype to the tag so that the result can be converted to a float32 if required.
fix typo in example telegraf config
fix typo in example config in code
Allow for float32 registers
- implement convert endianness
This reverts commit ac234ee.
@garciaolais To get the tests running you will need to run |
Yes, I've already reviewed his code except for the Test projects. Yes. This new commit from @garciaolais supersedes my #4623 plugin. |
Done 👍 |
I've ran the modbust_test.go project and it covers about 77.5% of the code. I'll get some further test code added so that we can get this up to 100%. Will review over the weekend. |
Hi Do I need additional steps? Maybe update my Because if I remove the Gopkg.* files I get this error...
|
Perhaps this will help
https://itiskj.hatenablog.com/entry/2018/08/30/101017
fdamador
Sent from XFINITY Connect Mobile App
------ Original Message ------
From: Antonio Garcia
To: influxdata/telegraf
Cc: fdamador, Mention
Sent: January 25, 2020 at 6:21 PM
Subject: Re: [influxdata/telegraf] Modbus Input plugin (#6154)
We recently switched to using Go modules instead of dep, you can upgrade by removing Gopkg.lock and Gopkg.toml and then running make && make check, this should modify go.mod and go.sum and you should be good.
Hi
Do I need additional steps?
Maybe update my Makefile or something else.
Because if I remove the Gopkg.* files I get this error...
could not find project Gopkg.toml, use dep init to initiate a manifest
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#6154?email_source=notifications&email_token=AAMWYEP2PMQFVQ76TZ6LNDTQ7TXRZA5CNFSM4IF7NJAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ5KFJI#issuecomment-578462373), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAMWYEJG2EKU67XRQPHXJ33Q7TXRZANCNFSM4IF7NJAA).
|
@garciaolais Thanks for bearing with me during this transition, perhaps it will help if you merge the master branch? If that's not all there is to it, do you mind if I push to your branch and fix it? |
@danielnelson any help is highly appreciated 👍 |
Is it possible to make a conversion to FLOAT32 more neat? |
Found one more issue: if host associated with input plugin is down it prevents telegraf service from starting. Service goes into loop with following message: |
On the float noise, we probably can't improve upon it. Could be interesting to see what value you get if you set the data type to UINT32 with no scale (just to look at the raw value). One thing that could possilby be done is a manual setting for precision and we could round the value. In most cases I would recommend handling this in the tool you are using to display the value. @garciaolais For the initialization issue, would we be able to remove the |
UINT32 (1.0) => FLOAT32 (0.01) |
Oh, yes we can fix this, we just need to convert to float64 before we apply the scale. |
@garciaolais
|
@serrj-sv Thanks for your feedback. I think the conversion its the normal result, please check the next example -> float64-golang and this post -> why-am-i-losing-precision-while-converting-float32-to-float64 |
Hi, maybe I'm missing something, but is I have signals where the values needs to be remapped to a certain range, say [-50, 150], so I would need a way to specify an offset as well (or ideally just (min, max)).` |
@fbergroth Can you open a new feature request? |
@danielnelson Sure: #7009 |
Hello everyone, The manufacturers manual shows this for the Modbus adress list:
I have configured in telegraf.conf:
When I click together a query in Chronograph (and modify the query as shown below), the left scale of the graph shows as values: 1.13e+9 Volt or 1.13B Volt. Expected would be something around 230.0 Volt (float value).
So I had it exported as CSV. It looks like this:
1st question: 2nd question: |
Hello @ToM-MaS I can help you with your first question
I read the documentation for your device UMG-604 Please note two things
So, I made a little test with my device telegraf.conf { name = "VL1-N",byte_order = "ABCD",data_type = "FLOAT32-IEEE", scale=1.0, address = [2,1]} modbus,host=9e88b516fd94,name=Device,type=holding_register VL1-N= 228.78521728515625 ✨PD. You can get the same value with different configuration for example { name = "VL1-N-ABCD", { name = "VL1-N-CDAB", |
Hello @garciaolais BTW, I solved my question about the query frequency by adding the line
|
Hello @ToM-MaS Well, The device manufacturer define the datatype You can find a lot of information about it in this link |
Hello @garciaolais, The template configuration of the modbus plugin says about supported formats: So "DOUBLE64" and "DOUBLE64-IEEE" or something similar is not supported? It would be intersting to know what datatypes are accepted in telegraf.conf besides the ones listed above. |
This adds a new input plugin for Modbus TCP/RTU protocol
closes #5412
Required for all PRs: