Attribute enable_dynamic_creation
The pragma enable_dynamic_creation is required for using the __NEW operator for function blocks.
enable_dynamic_creation
__NEW
{attribute 'enable_dynamic_creation'}
Insert the pragma in the first line in the declaration of the function block.