When we start a module. it will call module get and module set with the mask value of 0xFFFFFFFF. when we stop the module .it also will call module set and module get with the mask value of 0x0 ?
We have found documentation describing 0xFFFFFFFF and 0x0. we have the other question.
for example we create two custom modules. one module has a pointer to another module . we hope to get the information of another module through the pointer when the mask is 0xFFFFFFFF in the set function,but the pointer is NULL.when we send a message to the module , the pointer is not null. is there a certain order between the modules ? how to control the initialization order of the modules?
In general the Constructor() function performs additional memory allocation or initialization when a module is instantiated. We either use MATLAB or Constructor() for pointer to other modules as well. The answer would depend on your use case, if you want the other module variable to be called only once during initialization then I would recommend Constructor().
More information on the Bit masks in Set():-
A bit mask of 0xFFFFFFFF is used to force all variables in the Set function to update. This value of the bit mask is used in a call to the Set function after the module is constructed but before it is pumped for the first time. This ensures that all module variables are updated before they are used.
A special case of the bit mask is when it is equal to 0x0. When the destroy tuning command is processed by the AWECore, the Set function of every module is called with a mask of 0x0. This allows the module to do any necessary clean up operations.
You can also use the special mask for each variable defined in the module header file. for example:-
0,create_module,TestBackground1,ModuleTestBackground,0,0,0
0,create_module,SYS_toFloat,ModuleTypeConversion,1,1,0,wire1,wire3,1,0
0,create_module,ScaleOffset1,ModuleScaleOffset,1,1,0,wire3,wire3,1.0,1.0
0,create_module,SYS_inter,ModuleInterleave,1,1,0,wire3,wire4
0,create_module,SYS_toFract,ModuleTypeConversion,1,1,0,wire4,wire2,0,1
0,create_module,Sine1,ModuleSineSmoothedGen,0,1,0,wire5,1000.0,10.0,0.0,0.00208109617,0.0,0.130899698,0.130899698
0,create_module,Router1,ModuleRouter,1,1,0,wire5,wire6
0,write_int_array,Router1.channelIndex[0],0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72
0,create_module,Test1,ModuleTest,1,1,0,wire6,wire7,0
0,create_layout,theLayout_1A0,1,8
0,add_module,theLayout_1A0,0,TestBackground1,SYS_toFloat,ScaleOffset1,SYS_inter,SYS_toFract,Sine1,Router1,Test1
0,set_pointer,TestBackground1.modPtr,Test1
0,audio_pump
The above is the generated aws file. We create two modules: TestBackground1 and Test1.TestBackground1 has a pointer pointing to the module of Test1.I understand that after executing the create_module command, the set function will be called and the mask value is 0xffffffff.But from the above aws file, we can see that the pointer is set to Test1 at the end.so the pointer to another module is null when the set function is called and the mask value is 0xFFFFFFFFF. how can i get a pointer is not null when the set function is called and the mask value is oxfffffff?
2:22am
We have found documentation describing 0xFFFFFFFF and 0x0. we have the other question.
for example we create two custom modules. one module has a pointer to another module . we hope to get the information of another module through the pointer when the mask is 0xFFFFFFFF in the set function,but the pointer is NULL.when we send a message to the module , the pointer is not null. is there a certain order between the modules ? how to control the initialization order of the modules?
12:54pm
Hi Yong,
In general the Constructor() function performs additional memory allocation or initialization when a module is instantiated. We either use MATLAB or Constructor() for pointer to other modules as well. The answer would depend on your use case, if you want the other module variable to be called only once during initialization then I would recommend Constructor().
More information on the Bit masks in Set():-
A bit mask of 0xFFFFFFFF is used to force all variables in the Set function to update. This value of the bit mask is used in a call to the Set function after the module is constructed but before it is pumped for the first time. This ensures that all module variables are updated before they are used.
A special case of the bit mask is when it is equal to 0x0. When the destroy tuning command is processed by the AWECore, the Set function of every module is called with a mask of 0x0. This allows the module to do any necessary clean up operations.
You can also use the special mask for each variable defined in the module header file. for example:-
#define MASK_ScalerSmoothedExample_gain 0x00000100
#define MASK_ScalerSmoothedExample_smoothingTime 0x00000400
#define MASK_ScalerSmoothedExample_currentGain 0x00000200
#define MASK_ScalerSmoothedExample_smoothingCoeff 0x00000800
If you can provide more details about your module, I can guide you accordingly.
Karishma
10:28pm
0,create_module,TestBackground1,ModuleTestBackground,0,0,0
0,create_module,SYS_toFloat,ModuleTypeConversion,1,1,0,wire1,wire3,1,0
0,create_module,ScaleOffset1,ModuleScaleOffset,1,1,0,wire3,wire3,1.0,1.0
0,create_module,SYS_inter,ModuleInterleave,1,1,0,wire3,wire4
0,create_module,SYS_toFract,ModuleTypeConversion,1,1,0,wire4,wire2,0,1
0,create_module,Sine1,ModuleSineSmoothedGen,0,1,0,wire5,1000.0,10.0,0.0,0.00208109617,0.0,0.130899698,0.130899698
0,create_module,Router1,ModuleRouter,1,1,0,wire5,wire6
0,write_int_array,Router1.channelIndex[0],0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72
0,create_module,Test1,ModuleTest,1,1,0,wire6,wire7,0
0,create_layout,theLayout_1A0,1,8
0,add_module,theLayout_1A0,0,TestBackground1,SYS_toFloat,ScaleOffset1,SYS_inter,SYS_toFract,Sine1,Router1,Test1
0,set_pointer,TestBackground1.modPtr,Test1
0,audio_pump
The above is the generated aws file. We create two modules: TestBackground1 and Test1.TestBackground1 has a pointer pointing to the module of Test1.I understand that after executing the create_module command, the set function will be called and the mask value is 0xffffffff.But from the above aws file, we can see that the pointer is set to Test1 at the end.so the pointer to another module is null when the set function is called and the mask value is 0xFFFFFFFFF. how can i get a pointer is not null when the set function is called and the mask value is oxfffffff?