Test case R0018
Full test suiteDevice test case
Nested struct/arrays
This test case it part of the test suite proposed for new devices.
Test case ID: R0018
Language: ST
tests2/t0018.stTYPE tDIP: STRUCT b : BOOL; r : REAL; END_STRUCT; END_TYPE TYPE tLAMP: STRUCT b : BOOL; w : WORD; END_STRUCT; END_TYPE TYPE tJOB: STRUCT r1 : REAL; aDip : ARRAY[0..1] OF tDIP; aLamp : ARRAY[1..2] OF tLAMP; END_STRUCT; END_TYPE PROGRAM P_R0018 VAR i : INT; tj : tJOB; END_VAR i:=1; tj.r1 := 0.1; tj.aDip[0].b := TRUE; tj.aLamp[1].w := 3; tj.aLamp[2] :=tj.aLamp[1]; tj.aLamp[1].w := 4; _GEB_ASSERT_(tj.r1 = 0.1); _GEB_ASSERT_(tj.aDip[0].b = 1); _GEB_ASSERT_(tj.aDip[0].r = 0.0); _GEB_ASSERT_(tj.aDip[1].b = 0); _GEB_ASSERT_(tj.aLamp[1].b = 0); _GEB_ASSERT_(tj.aLamp[1].w = 4); _GEB_ASSERT_(tj.aLamp[2].b = 0); _GEB_ASSERT_(tj.aLamp[2].w = 3); END_PROGRAM