Hello,
I have created a test page which is linked to some hardware signals to test a device functionality.
In this page I have created some property like ManualEnable, ManualSpeed, ecc that I use to control signals in this page (set/reset some hardware output, PWM, DAC and so on).

The OnSet method for each propery set a "native" output variable (global variable in the device integration code) which is linked to the hardware in a thread running in background.
So, to set an output, the corresponding variable must be set (for example, to set enable output, the boolean variable of a struct "Out.enable" must be set to true).
When I switch to another pages from this page, I need to reset all the outputs, stop PWM and set DAC to 0 value. How and where can I do this?
I tried to do this in te Done method, but got the following error:

The method OnSetManualFeederEnableBoth is this:
// The value doesn't change - nothing to do.
if ( pure ManualFeederEnableBoth == value )
return;
// Remember the property's new value.
pure ManualFeederEnableBoth = value;
$if !$prototyper
native (value)
{
if (value)
{
Out.df_not_reset = 1;
Out.df_not_enable = 0;
}
else
{
Out.df_not_reset = 1;
Out.df_not_enable = 1;
}
}
$endif
I thought to do it in the Done() method just before the page is "deleted".
But I don't understand why I got this error.
PS: to change page I use the SwitchToDialog command.
Nicola