西门子 S7 输入插件
此插件通过 S7 协议从 Siemens PLC 读取指标。
引入于: Telegraf v1.28.0 标签: hardware 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
启动错误行为选项
除了插件特定的和全局的配置设置外,该插件还支持使用 startup_error_behavior 设置来指定出现启动错误时的行为。可用值如下:
error:如果出现启动错误,Telegraf 将停止并退出。这是默认行为。ignore:Telegraf 将忽略此插件的启动错误,并禁用它,但会继续处理所有其他插件。retry: Telegraf 会在每次收集或写入周期内尝试启动插件,以防出现启动错误。在启动成功之前,插件将被禁用。probe: Telegraf 将(如果可能)探测插件的功能,并在探测失败时禁用该插件。如果插件不支持探测,Telegraf 将表现得如同设置了ignore一样。
配置
# Plugin for retrieving data from Siemens PLCs via the S7 protocol (RFC1006)
[[inputs.s7comm]]
## Parameters to contact the PLC (mandatory)
## The server is in the <host>[:port] format where the port defaults to 102
## if not explicitly specified.
server = "127.0.0.1:102"
rack = 0
slot = 0
## Connection or drive type of S7 protocol
## Available options are "PD" (programming device), "OP" (operator panel) or "basic" (S7 basic communication).
# connection_type = "PD"
## Max count of fields to be bundled in one batch-request. (PDU size)
# pdu_size = 20
## Timeout for requests
# timeout = "10s"
## Idle timeout for requests
# idle_timeout = "60s"
## Log detailed connection messages for tracing issues
# log_level = "trace"
## Metric definition(s)
[[inputs.s7comm.metric]]
## Name of the measurement
# name = "s7comm"
## Field definitions
## name - field name
## address - indirect address "<area>.<type><address>[.extra]"
## area - e.g. be "DB1" for data-block one
## type - supported types are (uppercase)
## X -- bit, requires the bit-number as 'extra'
## parameter
## B -- byte (8 bit)
## C -- character (8 bit)
## W -- word (16 bit)
## DW -- double word (32 bit)
## I -- integer (16 bit)
## DI -- double integer (32 bit)
## LI -- long integer (64 bit) only S7-1200 S7-1500 suported
## R -- IEEE 754 real floating point number (32 bit)
## LR -- IEEE 754 long real floating point number (64 bit) only S7-1200 S7-1500 suported
## DT -- date-time, always converted to unix timestamp
## with nano-second precision
## S -- string, requires the maximum length of the
## string as 'extra' parameter
## address - start address to read if not specified otherwise
## in the type field
## extra - extra parameter e.g. for the bit and string type
fields = [
{ name="rpm", address="DB1.R4" },
{ name="status_ok", address="DB1.X2.1" },
{ name="last_error", address="DB2.S1.32" },
{ name="last_error_time", address="DB2.DT2" },
{ name="long_counter", address="DB3.LR12" }
]
## Tags assigned to the metric
# [inputs.s7comm.metric.tags]
# device = "compressor"
# location = "main building"示例输出
s7comm,host=Hugin rpm=712i,status_ok=true,last_error="empty slot",last_error_time=1611319681000000000i 1611332164000000000Metrics
此插件生成的指标格式取决于指标配置。
此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。