External lib (non native)

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

Test case ID: R0900
Language: ST

Code:
tests2/t0900.st
(* requires function LIBFUNC1 defined inside func1.zip and NNF1 defined in lib/nonnative *)

PROGRAM X01LIB
VAR
    C1,C2,C3,C4,C7,C0: INT;
    fb1,fb2: LIBFB1;
    M8 AT %MW63.8 : INT ; 
    AT %MW63.7 : INT ;
    T : INT; // Loop count
END_VAR
VAR_EXTERNAL 
    _T_PARAMS : TEST_PARAMS;
END_VAR 
VAR_EXTERNAL
(* from the library - this is not recommended practice *)
globlib : INT; 
END_VAR 
  T := T +1;
  IF T = 1 THEN (* initialization *)
    %MW63.7 := 80 ;
    M8 := 115; 
    globlib := 100; // globlib = 100
  END_IF;
  
   C0 := LIBFUNC1(3,7) ; // 22  
   C1 := LIBFUNC2(3,17) + 7;       // 27
   C4 := NNF1(3,C0) + 5; // 30  
                         //         1st                        2nd
   fb2(i:=10,j:=3000);   // o=3010 cont=1 %8=120 %7=75 | o=3011 cont=2 %8=136 %7=61
   fb1(i:=1,j:=100);     // o=101  cont=1 %8=125 %7=70 | o=103  cont=3 %8=141 %7=56
   fb1(i:=20,j:=1000);   // o=1021 cont=2 %8=130 %7=65 | o=1023 cont=4 %8=146 %7=51
                         // globlib=130                | globlib=1160
   C2 := fb1.o;   //                                       1023
   C3 := fb2.o;   //                                       3011
   globlib := globlib + 1000; // globlib=1130          | globlib=2160
   M8 := M8 + 1 ;           //   131                   |    147
   %MW63.7 := %MW63.7 +1;  //    66                    |    52  
   C7 := %MW63.7; 

IF _T_PARAMS.cycle = _T_PARAMS.timestorun THEN  // last iteration
     _GEB_ASSERT_(C0 = 22);
     _GEB_ASSERT_(C1 = 27);
     _GEB_ASSERT_(C2 = 1023);
     _GEB_ASSERT_(C3 = 3011);
//     _GEB_MSG_(INT_TO_STRING(C7));
     _GEB_ASSERT_(C7= 52);
     _GEB_ASSERT_(C4= 30);
     _GEB_ASSERT_(M8= 147);

     _GEB_ASSERT_(globlib = 2160);
END_IF;

END_PROGRAM