this error is between engineering talk and runtime tall as IDE give the error on what appears to be an runtime problem.
Playing with dynamic allocation on Codesys Win64 PLC , I get this error C0265 (not enough memory). My PC has 16 Go Ram , so enough I think . Is it a way to increase the memory allocated to Win 64 PLC ?
thank in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
do you mean with the __new operator?
The size is defined by right clicking the application and selecting properties, then going to the Application Build Options tab.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But i got error C0249 even with compilation directive 😨
------ Processus de compilation entamé : application : CODESYS_Control_Win_V3_x64.Application ------- Affecter un type à un code...
[ERREUR] Test_divers: FB_Init CODESYS_Control_Win_V3_x64: Logique API: Application: Robot: C0249: La création d’un tableau avec __NEW n’est pas autorisée pour les types définis par l'utilisateur
La compilation est terminée -- 1 erreurs, 3 avertissements : aucun téléchargement possible
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I didn't make this test .
what I want to do :
Create an object (in real life a machine ) with a number variable (from 400 to 750) of element .Each element has his own carateristics (so my DUT).
So,iwilluseFb_init()tomakedynamicallocationofxelements(asusualinPOO).Ithinkit's possible , isn'tit?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
this error is between engineering talk and runtime tall as IDE give the error on what appears to be an runtime problem.
Playing with dynamic allocation on Codesys Win64 PLC , I get this error C0265 (not enough memory). My PC has 16 Go Ram , so enough I think . Is it a way to increase the memory allocated to Win 64 PLC ?
thank in advance
do you mean with the __new operator?
The size is defined by right clicking the application and selecting properties, then going to the Application Build Options tab.
Thanks you i-campbell !!
the way you give me was the right way and I can compile using dynamic allocation( with __new operator )
But , it seem's it's no possible to create un array of personal object by this way ?
if i declare :
TYPE MyObject :
STRUCT
id :DINT ;
i_Number :INT ;
sz_genotype :STRING ;
sz_Plug :STRING ;
sz_scenario_WS :STRING ;
sz_scenario_SS :STRING ;
f_weight_vide :REAL ;
f_weight_Ref :REAL ;
f_weight_before :REAL ;
f_weight_after :REAL ;
END_STRUCT
END_TYPE
I can't write
pMyObject : pointer of MyObject
....
pMyobject := __new( Myobject,avalue) ;
what a shame !!
MyObject must be a FUNCTION_BLOCK or DUT decorated with the attribute
{attribute 'enable_dynamic_creation'}
https://help.codesys.com/webapp/_cds_operator_new;product=codesys;version=3.5.17.0
Thank's i-campbell
But i got error C0249 even with compilation directive 😨
[ERREUR] Test_divers: FB_Init CODESYS_Control_Win_V3_x64: Logique API: Application: Robot: C0249: La création d’un tableau avec __NEW n’est pas autorisée pour les types définis par l'utilisateur
La compilation est terminée -- 1 erreurs, 3 avertissements : aucun téléchargement possible
interesting. does it work if you use a function block instead of a dut?
Hello I campbell,
I didn't make this test .
what I want to do :
Create an object (in real life a machine ) with a number variable (from 400 to 750) of element .Each element has his own carateristics (so my DUT).