Diagnosis on Visualization Crash

A visualization crash can have different causes. In the following section, you will learn how you can detect the causes of a visualization crash and which actions make sense to prevent a crash.

The Stop Execution on Handled Exceptions command helps you when error checking. Run the command before the application is started. By default, the Stop Execution on Handled Exceptions command is not available in any menu, but it can be configured in Tools → Customize. For the procedure to add the command, see the chapter "Customizing Menus".

As an alternative to the Stop Execution on Handled Exceptions command, you could set the compiler definition VISU_NO_EXCEPTION_HANDLING for the application. As a result, the exception is not caught by the visualization and the programming system shows the location where the system has crashed.

Possible causes for the crash of a running visualization

Possible causes for the crash of a running visualization

  • In the visualization, a frame element with an interface variable with scope VAR_INPUT is used, and this interface variable (in the example: PLC_PRG._itfTest1, _itfTest1 : ITF_TEST;) has not been assigned in the application yet.

_visu_img_crash_var_input.png
_visu_img_crash_frame_itf.png
  • In the visualization, a frame element with an interface variable (in the example: fbTest) with scope VAR_IN_OUT is used, and this interface variable has a function block as data type. However, the transferred variable does not point to this function block.

_visu_img_crash_var_inout.png
_visu_img_crash_frame_fb.png
  • Division by 0: In an expression with division, the divisor (in the example: PLC_PRG.rVal2) must not be 0.

_visu_img_crash_div_zero.png
  • Use of VAR_IN_OUT variables of a function block in the visualization:

    If variables with scope VAR_IN_OUT are declared in a function block, then a visualization may access these variables only after the program has called the function block and the VAR_IN_OUT variables have been assigned in a function block.

  • Use of zero pointers and zero references: A pointer variable must not be zero (example: PLC_PRG.pValue^).

  • Error in the internal code; this is visible in the call stack only.

Course of action to prevent these errors

Course of action to prevent these errors

  • Use interfaces that initially point to dummy objects.

  • Call Visu_Prg in the project only when all initializations have been performed.

  • Use the operator SEL like in the following example: SEL(ptr<>0,0,ptr^.<>value)