Test RETAIN

This test case it part of the test suite proposed for new devices.

Test case ID: R0195
Language: ST

Code:
tests2/t0195.st
PROGRAM R0195

VAR_GLOBAL 
    GAR0195,GZR0195: INT := 500;
END_VAR
VAR_GLOBAL RETAIN
    GSR0195: INT :=200;
END_VAR
VAR 
    a,b : INT;
    x,z :INT :=5;
END_VAR
VAR RETAIN
    i : INT;
    j : INT := 10;
END_VAR
VAR_EXTERNAL 
        _T_PARAMS : TEST_PARAMS;
END_VAR

    i := i+1;
    j := j+1;
    a := a+1;
    b := b+1;
    x := x+1;
    z := z+1;
    GSR0195 := GSR0195+1;
    GAR0195 := GAR0195+1;
    GZR0195 := GZR0195+1;

 IF _T_PARAMS.cycle = _T_PARAMS.timestorun THEN  // last iteration 
_GEB_ASSERT_(GAR0195 = 503);
_GEB_ASSERT_(GSR0195 = 203);
_GEB_ASSERT_(a = 3);
_GEB_ASSERT_(i = 3);
_GEB_ASSERT_(j = 13);
_GEB_ASSERT_(z = 8);
END_IF;
        
END_PROGRAM