Page 1 of 1

Warning: Device offset ERROR in piCtory configuration!

Posted: 24 Mar 2022, 14:31
by saardrimer
We are building a new system and have used the same .rsc PiCtory setup file from an existing system that works fine. However, when we try to run the our software we get the following warnings and error:

Code: Select all

WARNING  | 2022-03-23 16:14:21,484 | /usr/lib/python3/dist-packages/revpimodio2/device.py:171: Warning: Device offset ERROR in piCtory configuration! Offset of 'RevPi DO' must be 140 but is 117 - Overlapping devices overwrite the same memory, which has unpredictable effects!!!
WARNING  | 2022-03-23 16:14:21,486 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Output_Status is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,487 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Status is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,492 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Input is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,493 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Counter_1 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,495 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Counter_2 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,497 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Counter_3 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,499 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Counter_4 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,501 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Counter_5 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,510 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Counter_6 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,519 | /usr/lib/python3/dist-packages/revpimodio2/device.py:171: Warning: Device offset ERROR in piCtory configuration! Offset of 'RevPi Connect/+' must be 246 but is 230 - Overlapping devices overwrite the same memory, which has unpredictable effects!!!
WARNING  | 2022-03-23 16:14:21,521 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO RevPiStatus is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,523 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO RevPiIOCycle is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,525 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO RS485ErrorCnt is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,526 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Core_Temperature is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,528 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO Core_Frequency is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,529 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO RevPiLED is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,530 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO RS485ErrorLimit1 is not in the device offset and will be ignored
WARNING  | 2022-03-23 16:14:21,531 | /usr/lib/python3/dist-packages/revpimodio2/device.py:362: Warning: IO RS485ErrorLimit2 is not in the device offset and will be ignored
<...>
  File "/usr/lib/python3/dist-packages/revpimodio2/modio.py", line 132, in __init__
    self._configure(self.get_jconfigrsc())
  File "/usr/lib/python3/dist-packages/revpimodio2/modio.py", line 252, in _configure
    self, device, simulator=self._simulator
  File "/usr/lib/python3/dist-packages/revpimodio2/device.py", line 215, in __init__
    self._devconfigure()
  File "/usr/lib/python3/dist-packages/revpimodio2/device.py", line 922, in _devconfigure
    super()._devconfigure()
  File "/usr/lib/python3/dist-packages/revpimodio2/device.py", line 631, in _devconfigure
    exp_a1green = lst_led[0].export
IndexError: list index out of range
To be clear, this happens only on the 'new' system.

Running 'piTest -d' also gives different offsets. On the existing system:

Code: Select all

Found 3 devices:

Address: 0 module type: 105 (0x69) RevPi Connect V1.0
Module is present
     input offset: 230 length: 6
    output offset: 236 length: 5

Address: 31 module type: 98 (0x62) RevPi DO V1.5
Module is present
     input offset: 117 length: 70
    output offset: 187 length: 18

Address: 30 module type: 118 (0x76) RevPi MIO V1.0
Module is present
     input offset: 0 length: 34
    output offset: 34 length: 27
On the 'new' system:

Code: Select all

Found 3 devices:

Address: 0 module type: 105 (0x69) RevPi Connect V1.0
Module is present
     input offset: 230 length: 6
    output offset: 236 length: 5

Address: 31 module type: 98 (0x62) RevPi DO V1.5
Module is present
     input offset: 117 length: 70
    output offset: 183 length: 18 <------

Address: 30 module type: 118 (0x76) RevPi MIO V1.0
Module is present
     input offset: 0 length: 34
     output offset: 1 length: 27 <------
I think that the .rsc file was generated with PiCtory 2.0.4, but now we're working with 2.0.5 (on both systems) if that makes a difference.

It would be good to know the source of the issue and any possible solutions. We expected that taking a .rsc file from one system to another should 'just work'.

I found this related thread, but it seems that it's more related to Modbus while we are not using a virtual Modbus device:

viewtopic.php?f=6&t=3197&p=11447&hilit= ... %21#p11447

Re: Warning: Device offset ERROR in piCtory configuration!

Posted: 24 Mar 2022, 14:50
by nicolaiB
Hi,

that looks strange indeed. Could you please share the config file from both system?

Nicolai

Re: Warning: Device offset ERROR in piCtory configuration!

Posted: 03 Apr 2022, 10:04
by RevPiModIO
I think you are using a revpimodio version older than 2.5.8 on your first (running) device. The device offset checks was added in 2.5.8.

The config.rsc section (generated by piCtory) for the MIO device may be wrong. I would like to investigate your config.rsc file.

Background:
RevPiModIO gets the device offsets from one value in the config.rsc file, which was added by piCtory. In older versions, ModIO trusted that value and build the IOs of each device starting at the offset given in that value. Because of errors in piCtory some offsets was wrong and IOs of a device could change data on another device. Now ModIO calculates the length of each created IO (and memory) and sum up to get the total length of each device. This value is compared to the given offset value of the next device. If that does not fit, than you get the warnings (and errors, if the core is not starting at offset 0) and all IOs of that devices will be ignored and not accessible.

In your case:
The warning tells you "DO must have offset 140", which mean, that all of the inputs, outputs and memories of the MIO device in sum are 140, which is wrong, but that is what the config.rsc tells ModIO...

I setup a system like yours, create a config.rsc with piCtory 2.0.4 and in works. All offsets fits...

Code: Select all

Address: 0 module type: 95 (0x5f) RevPi Core V1.2
Module is present
     input offset: 230 length: 6
    output offset: 236 length: 5

Address: 31 module type: 98 (0x62) RevPi DO V1.3
Module is present
     input offset: 117 length: 70
    output offset: 187 length: 18

Address: 30 module type: 118 (0x76) RevPi MIO V1.0
Module is present
     input offset: 0 length: 34
    output offset: 34 length: 27
And ModIO tells the same:

Code: Select all

>>> import revpimodio2
>>> rpi = revpimodio2.RevPiModIO()
>>> rpi.device.mio.offset
0
>>> rpi.device.do.offset
117
>>> rpi.device.core.offset
230