118 views
in Embedded Wizard Studio by

Hello,

Embedded Wizard debug tool is very powerful, but I can't see in the variable list the Application::Device properties. How can I check their value?

In the specific, in the "classical" Device class, I have created some arrays of property to store some parameter of a device working cycle (power, temperature, speed, etc).

Each array "cell" is related to a cycle phase, so I can manage working cycle with an index.

Before starting a working cycle, parameters arel loaded in these array and then passed to the device layer which manage the cycle. I would like to check the stored values before passing them.

The load code is something like:

var int8 Index = 0;

if (PreHeatTime != 0)
{
  Application::Device.CyclePhaseArray[Index] = Application::CyclePreHeatCode;
  Application::Device.CycleTimeArray[Index] = PreHeatTime;
  Application::Device.CycleMaxPowerArray[Index] = PreHeatPower;
  Application::Device.CycleTargetTempArray[Index] = 0;
  Application::Device.CycleSlideOutArray[Index] = true;
  Index++;
}

if (HeatTime != 0)        
{
  Application::Device.CyclePhaseArray[Index] = Application::CycleHeatCode;
  Application::Device.CycleTimeArray[Index] = HeatTime;
  Application::Device.CycleMaxPowerArray[Index] = HeatPower;
  Application::Device.CycleTargetTempArray[Index] = 0;
  Application::Device.CycleSlideOutArray[Index] = true;     //Slitta OUT
  Index++;
}

if (PostHeatTime != 0)
{
  Application::Device.CyclePhaseArray[Index] = Application::CyclePostHeatCode;
  Application::Device.CycleTimeArray[Index] = PostHeatTime;
  Application::Device.CycleMaxPowerArray[Index] = PostHeatPower;
  Application::Device.CycleTargetTempArray[Index] = 0;
  Application::Device.CycleSlideOutArray[Index] = false;
  Index++;
}

Application::Device.CyclePhasesNumber = Index;

I added a breakpoint at the last instruction, but can't see in the debug window any Application::Device property or any CyclePhaseArray or other.

Function that stores data in arrays is executed from StartPage window. This is the debug window:

PS: I'm using EW studio 12.

1 Answer

0 votes
by

Hello Nicola,

the expression Application::Device does not appear in the Variables window because it is not a variable. If you modify the code as shown below, the variables are listed. In this example Application::Device is assigned to a local variable, then the content of the local variable is listed:

var Application::DeviceClass device = Application::Device;

device.Variable1 = 10;
device.Variable2 = 20;
device.Variable3 = 30;

This approach has an additional positive side effect: since the access to the global autoobject is performed only once (the object is stored then in a local variable), the code is faster.

If you prefer your original approach, then you can see the variables of the autoobject in the window Chora objects. Note that autoobjects are discarded if not used. The autoobject appears in the Chora objects window only when it is existing actually. An example:

Best regards

Paul Banach

by

Hello Paul,

thank you for the answer. I have understood, so I have assigned a variable to the Application::Device class so code is faster and can debug. 

I also figured out how to use the chora object menu which I didn't know existed, so thanks again for the support!

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...