ottlukas opened a new issue, #612:
URL: https://github.com/apache/plc4x/issues/612

   I want to get data from plc with period = 1 ms. I try it using consumer:
   ```
   
   val modbusConsumerEndpoint = Plc4XEndpoint(modbusEndpointUri, 
plcComponent).apply {
    tags = mapOf(fieldName
   to "input-register:$plcInputPort")
    period = 1
   }
   
   from(modbusConsumerEndpoint)
                  
   .process {
                       it.message.body = (it.message.body as Map<String, 
Any>)[ModbusEndpointParams.fieldName]
   
                      it.setMainBody(ctx)
                   }
                   .marshal().json()
        
             .setHeader(KafkaConstants.KEY, constant(""))
                   .to(mainKafkaEndpoint)
   ```
   
   But I have only one loop. {color:#000000}*Plc4XConsumer* may work with 
trigger, but I couldn't find any examples for that.
   {color}
   
   {color:#000000}Either I try to use camel chain with timer:{color}
   ```
   
   from("timer:foo?period=1")
    .process {
    it.message.body =
    mapOf(fieldName to "input-register:$plcInputPort")
   
   }
    .to("plc4x:modbus://uri")
   ```
   
   But *Plc4XProducer* works only for writting. I solve this problem by 
creating own Endpoint with custom Producer includes ReadRequestBuilder extend  
Plc4XEndpoint and Plc4XProducer. It looks not like production decision.
   
   What is a right way to do this task?
   
   Imported from Jira 
[PLC4X-292](https://issues.apache.org/jira/browse/PLC4X-292). Original Jira may 
contain additional context.
   Reported by: dtadescu.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to