我正在实施Apache 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源.属性”如下所示:
#-----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,
enter image description here
我可以确认连接器连接成功。
我不知道哪里出了错。