I'm having a problem controlling the PeriodicFuncGen frequency when the module is controlled from my integrated code (AW Designer is not running). Directly setting the .freq value doesn't change the frequency. The frequency is controllable using server commands (as expected) when the same layout is running in AW Designer. My periodic function generator is configured as isTunable = true. I made a workaround to make it work: I added a DCSource driving a ParamSet for the periodic function generator frequency value. A peculiar behavior I'm seeing is I can directly control other PeriodicFuncGen parameters (like .amplitude and .functionType) without using my DCSource/ParamSet work around.
That seems like a bug on the surface but I'm wondering if I might have a broken some caveat that is special to the PeriodicFuncGen.freq value. Can anyone explain why my workaround is necessary?
Integrated code snippet:
status = awe_fwGetObjectByID(&g_AWEInstance,<ID from my generated target files>,&pInstance,&classID);
if((status == E_SUCCESS) && (classID == CLASSID_PERIODICFUNCTIONGEN))
awe_modPeriodicFunctionGenInstance *p = (awe_modPeriodicFunctionGenInstance *)(pInstance);
p->amplitude = 1.0F;
p->freq = (FLOAT32)(frequency); // frequency is confirmed to be an integer value of 1000
Thanks - John Speth