I’ve been using the Collection library for a long time, mostly with Stack, LinkedList, and List.
From your examples I was able to manage the different factories, even for custom elements.
Now I need a hashtable, but with this object I’m running into a lot of random access violations.
If I append something inside FB_Init after constructing the hashtable, it crashes, even though the list was already created.
If I only create the hashtable in FB_Init and append afterwards, it usually works.
I don’t understand the meaning of the dispose call in this code:
Without the dispose call, every second cold reset crashes immediately when I try to access iVal, even if eError doesn’t report any error.
With the dispose call, the cold reset issue disappears, but I get other problems:
a) If I start the runtime using systemctl start codesyscontrol, it crashes at
IFhash.CountKeys()=0THEN
b) If I delete the files in PlcLogic and download again, it works and survives multiple cold resets.
But as soon as I run systemctl restart codesyscontrol, everything gets corrupted again and it starts crashing at that point.
The append method is the one shown above, and I call it after the runtime has started.
The accesses are performed by a single task, and in any case I’m working on an isolated single core.
I’ve tried everything, moving the create, the instances, and all the rest several times, but nothing seems to work.
I’d like to point out that these FBs are part of our own library, which is used in many applications.
Good morning,
I’ve been using the Collection library for a long time, mostly with Stack, LinkedList, and List.
From your examples I was able to manage the different factories, even for custom elements.
Now I need a hashtable, but with this object I’m running into a lot of random access violations.
If I append something inside FB_Init after constructing the hashtable, it crashes, even though the list was already created.
If I only create the hashtable in FB_Init and append afterwards, it usually works.
I don’t understand the meaning of the dispose call in this code:
Without the dispose call, every second cold reset crashes immediately when I try to access iVal, even if eError doesn’t report any error.
With the dispose call, the cold reset issue disappears, but I get other problems:
a) If I start the runtime using systemctl start codesyscontrol, it crashes at
b) If I delete the files in PlcLogic and download again, it works and survives multiple cold resets.
But as soon as I run systemctl restart codesyscontrol, everything gets corrupted again and it starts crashing at that point.
In its FB_Init I create it:
In another FB I instantiate it statically:
The append method is the one shown above, and I call it after the runtime has started.
The accesses are performed by a single task, and in any case I’m working on an isolated single core.
I’ve tried everything, moving the create, the instances, and all the rest several times, but nothing seems to work.
I’d like to point out that these FBs are part of our own library, which is used in many applications.
Last edit: mondinmr 2025-09-11