Error.... Initializer is not a Constant ???
TurnipTruck
Posts: 1,485
Greetings,
I am creating a DEV array within a module of six devices that are defined in the main program. The devices are carried into the module in the DEFINE_MODULE of the program and the MODULE_NAME of the module.
Upon compilation of the module, I get the message that Initializer is not a constant, referring to the line where I create the DEV of the six devices.
I am just getting into module writing and would appreciate any suggestions.
Thanks.
I am creating a DEV array within a module of six devices that are defined in the main program. The devices are carried into the module in the DEFINE_MODULE of the program and the MODULE_NAME of the module.
Upon compilation of the module, I get the message that Initializer is not a constant, referring to the line where I create the DEV of the six devices.
I am just getting into module writing and would appreciate any suggestions.
Thanks.
0
Comments
Thanks.
Passing the entire array works because you aren't initializing it within the module anymore, you are simply allocating the memory space. It gets populated at runtime (when it applies the parameters to the instance) instead of compile time. You could also accomplish the same thing by populating your array in DEFINE_START of the module.