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.
Tip
By default, the Stop Execution on Handled Exceptions command is not available in any menu, but it can be configured in as follows.
Click Tools → Customize.
The Menu tab opens. First you need to define a menu position for the command. In this case, it makes sense to select an item under the Online menu.
Select the desired position and click the Add Command button.
All commands are listed in the Add Command dialog.
Select the Online category on the left and then the desired command on the right. Click OK to close the dialog. Then click OK again to close the Customize dialog.
The Stop Execution on Handled Exceptions command is now available in the Online menu.
For a detailed description of the procedure to add the command, see the chapter "???".
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
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.
In the visualization, a frame element with an interface variable (in the example:
fbTest
) with scopeVAR_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.
Division by
0
: In an expression with division, the divisor (in the example:PLC_PRG.rVal2)
must not be0
.
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 theVAR_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
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)