-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(inputs.s7comm): Add optional connection type setting #15000
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
feat(inputs.s7comm): Add optional connection type setting #15000
Conversation
6b3ce17
to
70e2ab6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hongliukai thank you very much for your contribution! IMO we should make the config option more speaking by actually using the common abbreviations or even words instead of numbers... What do you think?
Hi srebhan! @srebhan Thanks for the correction, you're right, using abbreviations and a map is more readable . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hongliukai just two more newline removals, then we are good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @Hongliukai! I'll take the liberty to remove the newlines...
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Summary
When we use the S7 protocol to access the PLC, we can do so by modifying the
the third byte in the Called (Dst) TSAP (in COTP) to select whether to connect as PG( a program) or OP ( monitor.....) or S7_basic_communication.
But the existing S7Comm plugin can only be used as a PG connection because of this parameter fixed in the robinson/gos7 NewTCPClientHandler() function。
I often encountered when using telegraf to connect to Siemens PLCs that the PLC supports fewer PG connections and more OP connections, so I'd like to add a parameter to change this connect parameter.
In order to be able to change this connect_type when connecting again I've submitted the new connection function NewTCPClientHandlerWithConnectType to robinson/gos7 and have merged the
robinson/gos7#67
Checklist
Related issues
resolves #14994