kafka -plc4x -modbus/tcp-作业刮擦期间的例外
我正在实现 apatche kafka(2.13-3.1.0) PLC4x 连接器来与 PLC(Allen-Bradly - 1756-L83E ControlLogix 5580 控制器)进行通信,但我不断收到以下信息:
[2022-04-01 21:40:09,621] INFO [plc-modbus-source|task-0] Configuring Bootstrap with Configuration{} (org.apache.plc4x.java.transport.tcp.TcpChannelFactory:60)
[2022-04-01 21:40:10,614] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:11,636] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:12,617] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:13,646] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:14,623] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:15,648] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:16,626] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:17,654] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:18,137] INFO [plc-modbus-source|task-0|offsets] WorkerSourceTask{id=plc-modbus-source-0} Either no records were produced by the task since the last offset commit, or every record has been filtered out by a transformation or dropped due to transformation or conversion errors. (org.apache.kafka.connect.runtime.WorkerSourceTask:484)
我的“plc4x-source.properties”看起来像这个:
#-----Kafka Specific properties.
name=plc-modbus-source
connector.class=org.apache.plc4x.kafka.Plc4xSourceConnector
default.topic=connect-test
tasks.max=2
#----PLC4X specific properties
#List of source names. Each source is a specification for a device.
#It can containg mulitple job references
sources=machineA
#The PLC4X connection string to be used. Examples for each protocol are included on the PLC4X website.
sources.machineA.connectionString=modbus:tcp://192.168.110.2:502
#The source 'poll' method should return control to Kafka Connect every so often.
#This value controls how often it returns when no messages are received.
sources.machineA.pollReturnInterval=5000
#There is an internal buffer between the PLC4X scraper and Kafka Connect.
#This is the size of that buffer.
sources.machineA.bufferSize=10000
#A list of jobs associated with this source.
sources.machineA.jobReferences=modbus-heartbeat,modbus-dashboard
#The Kafka topic to use to produce to. The default topic will be used if this isn't specified.
sources.machineA.jobReferences.modbus-heartbeat.topic=heartbeat
#A list of jobs specified in the following section.
jobs=modbus-heartbeat,modbus-dashboard
#The poll rate for this job. the PLC4X scraper will request data every interval (ms).
jobs.modbus-heartbeat.interval=500
#A list of fields. Each field is a map between an alias and a PLC4X address.
#The address formats for each protocol can be found on the PLC4X website.
jobs.modbus-heartbeat.fields=BOOL1,BOOL2,BOOL3,Analog0,Analog1,Analog2,Analog3
jobs.modbus-heartbeat.fields.BOOL1=coil:1:BOOL
jobs.modbus-heartbeat.fields.BOOL2=coil:2:BOOL
jobs.modbus-heartbeat.fields.BOOL3=coil:3:BOOL
jobs.modbus-heartbeat.fields.Analog0=holding-register:40001:REAL
jobs.modbus-heartbeat.fields.Analog1=holding-register:40002:REAL
jobs.modbus-heartbeat.fields.Analog2=holding-register:40003:REAL
jobs.modbus-heartbeat.fields.Analog3=holding-register:40004:REAL
jobs.modbus-dashboard.interval=500
jobs.modbus-dashboard.fields=active
jobs.modbus-dashboard.fields.active=coil:1:BOOL
#-----Kafka Specific properties.
bootstrap.servers=127.0.0.1:9092
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
#key.converter=io.confluent.connect.avro.AvroConverter
#value.converter=io.confluent.connect.avro.AvroConverter
#key.converter.schema.registry.url:http://127.0.0.1:8081
#value.converter.schema.registry.url:http://127.0.0.1:8081
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.file.filename=/tmp/connect.offsets
offset.flush.interval.ms=10000
enable.idempotence=true
acks=all
在我的 PLC 中,我有以下内容,Modbus TCP - AOI,在此处输入图片描述 我可以看到连接器连接成功。 我不知道错误出在哪里。
I'm implementing apatche kafka(2.13-3.1.0) PLC4x connector to communicate with a PLC (Allen-Bradly - 1756-L83E ControlLogix 5580 controller), but I keep getting the following:
[2022-04-01 21:40:09,621] INFO [plc-modbus-source|task-0] Configuring Bootstrap with Configuration{} (org.apache.plc4x.java.transport.tcp.TcpChannelFactory:60)
[2022-04-01 21:40:10,614] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:11,636] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:12,617] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:13,646] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:14,623] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:15,648] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:16,626] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-heartbeat, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:17,654] WARN [plc-modbus-source|task-0] Exception during scraping of Job modbus-dashboard, Connection-Alias machineA: Error-message: null - for stack-trace change logging to DEBUG (org.apache.plc4x.java.scraper.triggeredscraper.TriggeredScraperTask:148)
[2022-04-01 21:40:18,137] INFO [plc-modbus-source|task-0|offsets] WorkerSourceTask{id=plc-modbus-source-0} Either no records were produced by the task since the last offset commit, or every record has been filtered out by a transformation or dropped due to transformation or conversion errors. (org.apache.kafka.connect.runtime.WorkerSourceTask:484)
my "plc4x-source.properties" look like this:
#-----Kafka Specific properties.
name=plc-modbus-source
connector.class=org.apache.plc4x.kafka.Plc4xSourceConnector
default.topic=connect-test
tasks.max=2
#----PLC4X specific properties
#List of source names. Each source is a specification for a device.
#It can containg mulitple job references
sources=machineA
#The PLC4X connection string to be used. Examples for each protocol are included on the PLC4X website.
sources.machineA.connectionString=modbus:tcp://192.168.110.2:502
#The source 'poll' method should return control to Kafka Connect every so often.
#This value controls how often it returns when no messages are received.
sources.machineA.pollReturnInterval=5000
#There is an internal buffer between the PLC4X scraper and Kafka Connect.
#This is the size of that buffer.
sources.machineA.bufferSize=10000
#A list of jobs associated with this source.
sources.machineA.jobReferences=modbus-heartbeat,modbus-dashboard
#The Kafka topic to use to produce to. The default topic will be used if this isn't specified.
sources.machineA.jobReferences.modbus-heartbeat.topic=heartbeat
#A list of jobs specified in the following section.
jobs=modbus-heartbeat,modbus-dashboard
#The poll rate for this job. the PLC4X scraper will request data every interval (ms).
jobs.modbus-heartbeat.interval=500
#A list of fields. Each field is a map between an alias and a PLC4X address.
#The address formats for each protocol can be found on the PLC4X website.
jobs.modbus-heartbeat.fields=BOOL1,BOOL2,BOOL3,Analog0,Analog1,Analog2,Analog3
jobs.modbus-heartbeat.fields.BOOL1=coil:1:BOOL
jobs.modbus-heartbeat.fields.BOOL2=coil:2:BOOL
jobs.modbus-heartbeat.fields.BOOL3=coil:3:BOOL
jobs.modbus-heartbeat.fields.Analog0=holding-register:40001:REAL
jobs.modbus-heartbeat.fields.Analog1=holding-register:40002:REAL
jobs.modbus-heartbeat.fields.Analog2=holding-register:40003:REAL
jobs.modbus-heartbeat.fields.Analog3=holding-register:40004:REAL
jobs.modbus-dashboard.interval=500
jobs.modbus-dashboard.fields=active
jobs.modbus-dashboard.fields.active=coil:1:BOOL
#-----Kafka Specific properties.
bootstrap.servers=127.0.0.1:9092
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
#key.converter=io.confluent.connect.avro.AvroConverter
#value.converter=io.confluent.connect.avro.AvroConverter
#key.converter.schema.registry.url:http://127.0.0.1:8081
#value.converter.schema.registry.url:http://127.0.0.1:8081
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.file.filename=/tmp/connect.offsets
offset.flush.interval.ms=10000
enable.idempotence=true
acks=all
In my PLC I have the following, Modbus TCP - AOI, enter image description here
where I can se that the connector connects successfully.
I have no idea where is the mistake.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下配置文件,这一行很突出,
请仔细检查 Modbus 地址 40001 (4x40001) 是否确实存在,并且您的意思不是
holding-register:1:REAL
。Taking a look at the config file, This line stands out
Double check that the Modbus address 40001 (4x40001) actually exists and you didn't mean
holding-register:1:REAL
.