use_library.vpl

Top  Previous  Next

//-----------------------------------------------------------------------------
// use_library.vpl
// 
// This example shows how to use a user library.
// The path to the library is configured in the project settings.
// 
//-----------------------------------------------------------------------------
INCLUDE rtcu.inc
// Uncomment math.inc to add math library support.
//INCLUDE math.inc
INCLUDE example_lib/simple_lib.inc
INCLUDE example_lib/enc_lib.inc
 
 
//  Input variables that can be configured via the configuration dialog (These are global)
VAR_INPUT
 
END_VAR;
 
//  Output variables that can be configured via the configuration dialog (These are global)
VAR_OUTPUT
 
END_VAR;
 
//  These are the global variables of the program
VAR
 
END_VAR;
 
PROGRAM use_library;
// These are the local variables of the program block
VAR
   
END_VAR;
   // The next code will only be executed once after the program starts
 
   SimpleLibInit();
 
   SimpleLibBoardInfo();
 
   DebugMsg(message:="Main password   : "+MAIN_PASSWORD);
   DebugMsg(message:="Device password : "+generated_password);
   
   DebugFmt(message := "enc_func(2,3) = \1", v1:=enc_func(v1:=2, v2:=3));
   
   BEGIN
      // Code from this point until END will be executed repeatedly
 
 
   END;
 
END_PROGRAM;