CODESYS plugin issues

Topics about the Software of Revolution Pi
Post Reply
laazik
Posts: 1
Joined: 17 May 2024, 17:42

CODESYS plugin issues

Post by laazik »

Hi,

So tried to get the CODESYS working with Connect4 and DO module on the right + S+S env sensor over RS485 (19.2-E-1 and then 38.4-E-1). Result is the same no matter if I use the beta plugin on the production one.

Ewith the 6.1 kernel the kern.log was full of piBridge errors on invalid bytes and checksums.

Code: Select all

May 17 16:01:07 RevPi108565 kernel: [  152.787046] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:07 RevPi108565 kernel: [  152.912248] pi-bridge serial1-0: invalid checksum (expected: 0x20, got 0x00
May 17 16:01:07 RevPi108565 kernel: [  152.968946] pi-bridge serial1-0: invalid checksum (expected: 0x00, got 0x06
May 17 16:01:07 RevPi108565 kernel: [  153.158078] pi-bridge serial1-0: invalid checksum (expected: 0x20, got 0x00
May 17 16:01:08 RevPi108565 kernel: [  153.772296] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:08 RevPi108565 kernel: [  153.772310] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:08 RevPi108565 kernel: [  154.388452] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:08 RevPi108565 kernel: [  154.388465] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:09 RevPi108565 kernel: [  154.443835] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:09 RevPi108565 kernel: [  154.443848] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:09 RevPi108565 kernel: [  154.855073] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:09 RevPi108565 kernel: [  154.855087] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:10 RevPi108565 kernel: [  155.703954] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:10 RevPi108565 kernel: [  155.703985] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:10 RevPi108565 kernel: [  155.827328] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:10 RevPi108565 kernel: [  155.827342] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:10 RevPi108565 kernel: [  156.103201] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:10 RevPi108565 kernel: [  156.103214] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:10 RevPi108565 kernel: [  156.245071] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:10 RevPi108565 kernel: [  156.245083] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:11 RevPi108565 kernel: [  156.951095] pi-bridge serial1-0: failed to discard 2 bytes within timeout
May 17 16:01:11 RevPi108565 kernel: [  156.951107] pi-bridge serial1-0: received packet truncated (2 bytes missing)
May 17 16:01:11 RevPi108565 kernel: [  156.951112] piDIOComm_sendCyclicTelegram: 27 callbacks suppressed
May 17 16:01:11 RevPi108565 kernel: [  156.951117] piControl: DIO addr 32: communication failed (req:6,ret:-5)
May 17 16:01:11 RevPi108565 kernel: [  157.337459] pibridge_req_io: 16 callbacks suppressed
May 17 16:01:11 RevPi108565 kernel: [  157.337473] pi-bridge serial1-0: invalid checksum (expected: 0x20, got 0x00
May 17 16:01:11 RevPi108565 kernel: [  157.337480] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:11 RevPi108565 kernel: [  157.361325] pi-bridge serial1-0: unexpected response addr 0x00
May 17 16:01:11 RevPi108565 kernel: [  157.361337] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:12 RevPi108565 kernel: [  157.572137] pi-bridge serial1-0: invalid checksum (expected: 0x64, got 0x00
May 17 16:01:12 RevPi108565 kernel: [  157.572150] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:12 RevPi108565 kernel: [  157.595925] pi-bridge serial1-0: invalid checksum (expected: 0x00, got 0x03
May 17 16:01:12 RevPi108565 kernel: [  157.595936] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:12 RevPi108565 kernel: [  157.641641] pi-bridge serial1-0: failed to discard 10 bytes within timeout
May 17 16:01:12 RevPi108565 kernel: [  157.641653] pi-bridge serial1-0: received packet truncated (10 bytes missing)
May 17 16:01:12 RevPi108565 kernel: [  157.641658] piControl: DIO addr 32: communication failed (req:6,ret:-5)
May 17 16:01:12 RevPi108565 kernel: [  157.811361] piControl: DIO addr 32: communication failed (req:6,ret:-5)
May 17 16:01:12 RevPi108565 kernel: [  157.832903] pi-bridge serial1-0: invalid checksum (expected: 0x64, got 0x00
May 17 16:01:12 RevPi108565 kernel: [  157.832915] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:12 RevPi108565 kernel: [  157.869283] piControl: DIO addr 32: communication failed (req:6,ret:-5)
May 17 16:01:12 RevPi108565 kernel: [  157.888103] pi-bridge serial1-0: invalid checksum (expected: 0x64, got 0x00
May 17 16:01:12 RevPi108565 kernel: [  157.888114] piControl: DIO addr 32: communication failed (req:6,ret:-74)
May 17 16:01:12 RevPi108565 kernel: [  157.940886] pi-bridge serial1-0: invalid checksum (expected: 0x01, got 0x19
May 17 16:01:12 RevPi108565 kernel: [  157.952662] pi-bridge serial1-0: invalid checksum (expected: 0x00, got 0x06
May 17 16:01:12 RevPi108565 kernel: [  157.979054] pi-bridge serial1-0: invalid checksum (expected: 0x00, got 0x06
May 17 16:01:12 RevPi108565 kernel: [  158.139804] pi-bridge serial1-0: invalid checksum (expected: 0x00, got 0x06
May 17 16:01:12 RevPi108565 kernel: [  158.288295] pi-bridge serial1-0: invalid checksum (expected: 0x00, got 0x03
Digging through forum I can see that there is an issue identified (though with AIO) to the serial comms. Would I assume correctly that this can be the issue here as well? Because removing the modbus RTU device from the codesys application fixed the issue at least to the level of the device and DO turning green.

The highest the S+S sensor goes is 38.4k and this seemed not to resolve the issue. Downgrading kernel to 5.10 did not change anything, though errors went away from the kernel.log.

When I remove the modbus part DO seems to work (at least something is happening) though, not correctly. The relay to which the DO is connected is flipping and I wasn't able to figure out if it is in PWM mode or something else weird is going on (wasn't with a constant frequency). Setting the bits through piTest works correctly.

Additionally I identified 2 issues:
The configuration change for the IEC file paths worked ok. But apparently the plugin needs to read /var/log/kern.log which it obviously does not have access to (and I found nothing to map this neither, perhaps you can add a similar placeholder that the rconfig is using to the codesys code - or if it is there, then can you let know what it is)

Code: Select all

2024-05-17T15:38:04.777Z, 0x00000104, 2, 39, 4, !!!! Warning: Access denied to '/var/log/kern.log' due to ForceIecFilePath
2024-05-17T15:38:04.777Z, 0x00000104, 1, 0, 0, To grant access, this path may be configured as a PlaceholderFilePath
2024-05-17T15:38:04.777Z, 0x00008000, 4, 1, 1, **** ERROR: ErrorCode: 8451, piControl read kernel log failed.
And ... the CODESYS shows the DO output map as DI_CH1 etc., which I think is bit incorrect?
Screenshot 2024-05-17 191040.png
User avatar
dirk
KUNBUS
Posts: 1998
Joined: 15 Dec 2016, 13:19

Re: CODESYS plugin issues

Post by dirk »

Hello laazik thank you very much for your detailed error picture and your patience here. Can you please send me an SOS report:
https://kunbus-gmbh.atlassian.net/servi ... 2036400208
Then we can get a detailed overview of your system.

Plesae bring your system up to date using the steps in this checklists
Post Reply