Search code examples
panelcan-buscaplcanoe

How to reset all environment varible (In DBC) from 1 button (using panel) in CANoe


I working in Canoe software and i try to reset my all environment variable , which is present in DBC(Database) and i create a button using panel in canoe software. and try to insert this panel in one network node in configuration but i don't know how to insert this panel and how to reset my all environment variable using function in CAPL programming.

Please give me some suggestions. Thank you .


Solution

  • There is no specific function to reset all envVars (or sysvars to that matter) to default values in CAPL.

    You have only the Reset Now button in CANoe Options.

    The only solution I see: You open/create the panel in Panel Designer. You create the button through Toolbox, link it to the Sysvar specifically used for resetting envVars (in the buttons properties). You can create that sysvar in CANoe\Environment\System Variables.

    Then, you create an on event trigger on that sysvar in a Simulation Node you choose (must be Active Simulation node).

    on sysvar SYSVARName_YouCreated 
    {
    putValue(EnvVar1, 0);
    putValue(EnvVar2, 0);
    putValue(EnvVar3, 0);
    }
    

    Hard code the setting of EnvVars to initial value by hand (brute, but will do the work).