Creating a Test Project
A test project which is suitable for a system test contains a compilable application with the system settings of the test system. The test system should be as similar as possible to the later production environment.
For an application test, there is usually already a project with the application which you want to test. For the example, you create a simple test project: Testprojekt SystemTest_A.project. The First_Script test script reads and checks the variables of this project. See: Creating a test script for a system test.
Click the File → New Project command.
Select the Standard Project template and specify the name
SystemTest_A.projectand the locationD:\Projects.The Standard Project dialog will open.
Select the device, and in PLC_PRG in, select the Structured Text (ST) language.
Select the device in the Devices view. Then click the Simulation command in the context menu.
In the Devices view, double-click
PLC_PRG.Declare the variables which the test script checks:
PROGRAM PLC_PRG VAR iValue1 : INT := 100; iValue2 : INT := 200; xDone : BOOL; END_VARImplement the following code:
IF NOT xDone THEN iValue1 := iValue1 + 1; iValue2 := iValue2 + 1; xDone := TRUE; END_IFWhen the application starts, the code increments both variables once:
iValue1to101andiValue2to201. After a reset, the variables have their initial values again.Save the project.