Hello! I am using runtime application and got issue with modbus. I am using IAcyclicCommunicationService with PdiRead and PdiWrite to read values from modbus. 1. Requests go once a minute 2. I maked request: 0x0b 0x04 0x00 0x04 0x00 0x01 and got response: 0x0b 0x04 0x02 0x0a 0x7f. This time is ok. 3. Now i disconnected device, but in next cycle i have gotten response again. And only next requests give me error. 4. Is it some duplicates? 5. Now i want to read registers in series 5. First request: 0x0b 0x04 0x00 0x04 0x00 0x01; response: 0x0b 0x04 0x02 0x0a 0x7f. Second request: 0x0b 0x04 0x00 0x68 0x00 0x02; but response again same as in first request 6. In next cycle request: 0x0b 0x04 0x00 0x04 0x00 0x01, but response from second request of previos cycle: 0x0b 0x04 0x04 0x00 0x17 0x6f 0x25 and so on Configuration: 0x13 0x74 0x0d 0x0a 0x24 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 What i am missing? Thanks!
I guess this is Modbus/RTU, right? With the PLC as the Modbus master, right? What I/O module are you using for the Modbus/RTU communication? If you are doing the PDI Read immediately after the PDI write, then there will not be time for the serial module to transmit the request to the slave and to receive the reply before you do the PDI Read. Have you considered this delay? Out of interest, it is possible to use the Process Data read/write functions on the Axioline service for process data exchange, rather than PDI Read/write, which is typically used only for configuration and diagnostics.
[quote]I guess this is Modbus/RTU, right?[/quote] Yes [quote]With the PLC as the Modbus master, right?[/quote] Yes [quote]What I/O module are you using for the Modbus/RTU communication?[/quote] AXL F RS UNI 1H [quote]If you are doing the PDI Read immediately after the PDI write, then there will not be time for the serial module to transmit the request to the slave and to receive the reply before you do the PDI Read. Have you considered this delay?[/quote] Yes. 1-10 ms. In one cycle i send two requests with response delay 1-10 ms between write read. And delay between requests 50ms. Then in next cycle (after < 1 min) i have gotten result from previos second request [quote]Out of interest, it is possible to use the Process Data read/write functions on the Axioline service for process data exchange, rather than PDI Read/write, which is typically used only for configuration and diagnostics.[/quote] I will try Process Data if PDI read/write no success Thanks
I don’t really understand the application timing you’re describing (sorry). I need to check the details of the default Axioline message timing in the PLC, but it may take 50ms or so for a PDI Write request to be transmitted to the Axioline I/O module, and another 50ms (or so) for data to be available from the module to a PdiRead request. i.e. a call to PdiWrite does not write directly to the Axioline I/O module, and a PdiRead does not read directly from the Axioline I/O module. Would those sorts of delays explain what you are seeing?