ArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2025-05-24T18:33:03+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/7355 2025-05-24T18:33:03+02:00 2025-05-24T18:33:03+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45859#p45859 <![CDATA[Re: Using Global Arrays]]> Statistics: Posted by woodslanding — 24 May 2025, 18:33


]]>
2025-05-01T10:19:35+02:00 2025-05-01T10:19:35+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45818#p45818 <![CDATA[Re: Using Global Arrays]]>
Global Arrays are working really fine. It is one of the strongest features in Usine from these last years to have fast and strong access to data everywhere and communicate with shared Usines.
Only one Global Array definition can exist since it is accessible from everywhere in the workspace.
Global Arrays can have a variable length. You can create a GA with a size of 0 but still enter values. But, if you want to access it with script, you need to define a size at creation.
To access it with script, the GA should have a name written with alt-click on the module itself. Can be the same name, but this is its reference name for scripting.
When loading the wkp, Usine starts with rack 1 until the last one. Everytime a rack is loaded, it is immediately initialized. That means, GA declaration must be loaded before a script that used it to avoid errors.
Best
Sylvain

Statistics: Posted by SylvainT — 01 May 2025, 10:19


]]>
2025-04-30T17:46:23+02:00 2025-04-30T17:46:23+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45817#p45817 <![CDATA[Re: Using Global Arrays]]> there could be only one instance of Global array creation, maybe you create the same array in different scripts ?
cheers

Olivar

Statistics: Posted by oli_lab — 30 Apr 2025, 17:46


]]>
2025-04-30T17:03:11+02:00 2025-04-30T17:03:11+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45815#p45815 <![CDATA[Re: Using Global Arrays]]>
I solved this by creating an initializedIN tparameter in the script that references the array, and attaching it to an ON INIT module. I don't run any callbacks until I get the trigger from INIT. Now everything loads and starts up without errors.

Seems like scripts should wait for their patch to be initialized before running callbacks, but I guess they do not.

Hopefully this thread is helpful to someone else.

cheers,
-e

Statistics: Posted by woodslanding — 30 Apr 2025, 17:03


]]>
2025-04-30T16:22:59+02:00 2025-04-30T16:22:59+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45814#p45814 <![CDATA[Re: Using Global Arrays]]>
So an actual patching question:

How can I let the script know when the GA is actually operational so I can read and write to it?

Statistics: Posted by woodslanding — 30 Apr 2025, 16:22


]]>
2025-04-30T16:16:11+02:00 2025-04-30T16:16:11+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45813#p45813 <![CDATA[Re: Using Global Arrays]]>
[1408] Error :
PROC:globalArrayRemoveClient
ERROR:Access violation at address 0000000000523CEB in module 'Usine.exe'. Read of address
FFFFFFFFFFFFFFFF

Maybe this prevents the wkp from saving correctly?

This GA is referenced in multiple scripts, so every time I start up, it creates Access violation errors, because the array is not found. Maybe that is why it doesn't save correctly. I'll search and see if there is a test for the existence of a global array that I can put in the scripts. Maybe then the wkp can save correctly.

EDIT: if there is a test for the existence of a GA, it is not in the docs....

Statistics: Posted by woodslanding — 30 Apr 2025, 16:16


]]>
2025-04-30T16:05:24+02:00 2025-04-30T16:05:24+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45812#p45812 <![CDATA[Using Global Arrays]]>
Before filing a bug report, I want to make sure there isn't something I'm forgetting about.

Should the following situation be possible?? Can you create a GA and name it, and have it not show up in the GA list?
GA not found.png
Let me know, thanks.

I am using the October version of Usine, until such time as I have a reason to buy a new license. If this is a known issue that has been fixed, let me know.

Statistics: Posted by woodslanding — 30 Apr 2025, 16:05


]]>
BrainModular BrainModular Users Forum 2025-05-24T18:33:03+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/7355 2025-05-24T18:33:03+02:00 2025-05-24T18:33:03+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45859#p45859 <![CDATA[Re: Using Global Arrays]]> Statistics: Posted by woodslanding — 24 May 2025, 18:33


]]>
2025-05-01T10:19:35+02:00 2025-05-01T10:19:35+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45818#p45818 <![CDATA[Re: Using Global Arrays]]>
Global Arrays are working really fine. It is one of the strongest features in Usine from these last years to have fast and strong access to data everywhere and communicate with shared Usines.
Only one Global Array definition can exist since it is accessible from everywhere in the workspace.
Global Arrays can have a variable length. You can create a GA with a size of 0 but still enter values. But, if you want to access it with script, you need to define a size at creation.
To access it with script, the GA should have a name written with alt-click on the module itself. Can be the same name, but this is its reference name for scripting.
When loading the wkp, Usine starts with rack 1 until the last one. Everytime a rack is loaded, it is immediately initialized. That means, GA declaration must be loaded before a script that used it to avoid errors.
Best
Sylvain

Statistics: Posted by SylvainT — 01 May 2025, 10:19


]]>
2025-04-30T17:46:23+02:00 2025-04-30T17:46:23+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45817#p45817 <![CDATA[Re: Using Global Arrays]]> there could be only one instance of Global array creation, maybe you create the same array in different scripts ?
cheers

Olivar

Statistics: Posted by oli_lab — 30 Apr 2025, 17:46


]]>
2025-04-30T17:03:11+02:00 2025-04-30T17:03:11+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45815#p45815 <![CDATA[Re: Using Global Arrays]]>
I solved this by creating an initializedIN tparameter in the script that references the array, and attaching it to an ON INIT module. I don't run any callbacks until I get the trigger from INIT. Now everything loads and starts up without errors.

Seems like scripts should wait for their patch to be initialized before running callbacks, but I guess they do not.

Hopefully this thread is helpful to someone else.

cheers,
-e

Statistics: Posted by woodslanding — 30 Apr 2025, 17:03


]]>
2025-04-30T16:22:59+02:00 2025-04-30T16:22:59+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45814#p45814 <![CDATA[Re: Using Global Arrays]]>
So an actual patching question:

How can I let the script know when the GA is actually operational so I can read and write to it?

Statistics: Posted by woodslanding — 30 Apr 2025, 16:22


]]>
2025-04-30T16:16:11+02:00 2025-04-30T16:16:11+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45813#p45813 <![CDATA[Re: Using Global Arrays]]>
[1408] Error :
PROC:globalArrayRemoveClient
ERROR:Access violation at address 0000000000523CEB in module 'Usine.exe'. Read of address
FFFFFFFFFFFFFFFF

Maybe this prevents the wkp from saving correctly?

This GA is referenced in multiple scripts, so every time I start up, it creates Access violation errors, because the array is not found. Maybe that is why it doesn't save correctly. I'll search and see if there is a test for the existence of a global array that I can put in the scripts. Maybe then the wkp can save correctly.

EDIT: if there is a test for the existence of a GA, it is not in the docs....

Statistics: Posted by woodslanding — 30 Apr 2025, 16:16


]]>
2025-04-30T16:05:24+02:00 2025-04-30T16:05:24+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7355&p=45812#p45812 <![CDATA[Using Global Arrays]]>
Before filing a bug report, I want to make sure there isn't something I'm forgetting about.

Should the following situation be possible?? Can you create a GA and name it, and have it not show up in the GA list?
GA not found.png
Let me know, thanks.

I am using the October version of Usine, until such time as I have a reason to buy a new license. If this is a known issue that has been fixed, let me know.

Statistics: Posted by woodslanding — 30 Apr 2025, 16:05


]]>