{*******************************************************************************
 STEP           : IP_CAMTEC_LOOBPBACKTEST.IPS
 PROJECT        : Function test for CAMTEC USB 2.0 Interface
 DESCRIPTION    : Test of output and input channels via loopback
 PROGRAMMER     : MCD / CS
 UPDATE         : V1.0 / 2012-09-07
                  V1.1 / 2012-10-12  Added DataLogging, changed testvalues
********************************************************************************}

PARAMETER

  psTestType       : ( 1, string, 'Measure type [current/voltage]','current/voltage'); // Device name
  prOutputVoltage  : ( 2, real,   'Output voltage / V',            '0..180'  );        // Power Supply output voltage
  prOutputCurrent  : ( 3, real,   'Output current / A',            '0..50'   );        // Power Supply output current

var
  rResult : real;   // used to buffer testresult

step
//debug.debug;   // start debugging

   // Switch on DataLogging
   Toolmanager.SetEvent('CAMTEC','DataLoggingOn');

      // Set output of CAMTEC Power Supply
   Toolmanager.SetValue('CAMTEC','Ureg',prOutputVoltage);
   Toolmanager.SetValue('CAMTEC','Ireg',prOutputCurrent);

   // Switch on PowerSupply
   Toolmanager.SetEvent('CAMTEC','PowerOn');

   DateTime.Delay(800);

   // Read input from CAMTEC Power Supply
   if(psTestType = 'current') then begin
     rResult := Toolmanager.GetValue('CAMTEC','Imon');
   end;
   if(psTestType = 'voltage') then begin
     rResult := Toolmanager.GetValue('CAMTEC','Umon');
   end;

   // Set the result of this step
   SetValue(rResult);
end.
