Hello, i am unable to compile Element Collections Example because Codesys (3.5.10, 3.5.14.10, 3.5.14.30) does not recognize pInstance^.__vfInit();
__in MyElementFactory.Create with C0004 and C0046 errors.
What could be the reason?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey, I know that this is an old topic, but was useful to me too knowing this error wouldn't actually prevent the system from running.
However, this means that there is now always an error in my code. is there any way to hide this error? I have found there is the {warning disable} command but it doesn't appear to work for errors.
π
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Interesting topic... Can we please get an update or a little bit more explanation of these former system calls - used mostly by library developers?
As far as I understand, __vfInit() is to be called on "typed" pointers, typically on pointers to function block types, to execute the init sequence, ie. variable initialization.
So... in theory all 3 alternatives should work the same:
Question:
1. Is this still correct to use vfInit() in library development (so that it doesn't depend on "Dynamic memory allocation" )?
2. Is it OK to use SysMem, or is there a better wrapping platform for such purpose? (also from the library development aspect)
Last edit: Strucc.c 2022-11-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, i am unable to compile Element Collections Example because Codesys (3.5.10, 3.5.14.10, 3.5.14.30) does not recognize pInstance^.__vfInit();
__in MyElementFactory.Create with C0004 and C0046 errors.
What could be the reason?
more posts ...
Are they just precompile errors? It should still compile.
Yes, indeed, thanks!
Hey, I know that this is an old topic, but was useful to me too knowing this error wouldn't actually prevent the system from running.
However, this means that there is now always an error in my code. is there any way to hide this error? I have found there is the {warning disable} command but it doesn't appear to work for errors.
Hello,
It seems that with {implicit on} it is managed by the compiler.
Last edit: rlie 2022-11-24
Interesting topic... Can we please get an update or a little bit more explanation of these former system calls - used mostly by library developers?
As far as I understand, __vfInit() is to be called on "typed" pointers, typically on pointers to function block types, to execute the init sequence, ie. variable initialization.
So... in theory all 3 alternatives should work the same:
Declaration:
Code:
Question:
1. Is this still correct to use vfInit() in library development (so that it doesn't depend on "Dynamic memory allocation" )?
2. Is it OK to use SysMem, or is there a better wrapping platform for such purpose? (also from the library development aspect)
Last edit: Strucc.c 2022-11-26