  function [t0, err, errmsg] = OsiGetTime(ConNo)
%
% OsiGetTime.m				Get current simulation time in OLGA server.   
%
% The calling syntax is:
%
%   t0 = OsiGetTime(ConNo);
%
% Copyright (c) 1998 by ABB Corporate Research.
% All Rights Reserved.
%
% $Revision: 1.0, 5/10-1998 by Kjetil Havre$
% $Revision: 1.1, 20/7-2005 by Espen Storkaas, ABB-EOP, included user-defined connection number$ 

  if nargin==0
      ConNo=1;
  end
  if nargin > 1
     errmsg = 'OsiGetTime usage: [t0, err, errmsg] = OsiGetTime;';
     disp(errmsg);
     err = -1;
     return
  end

  [err, msg, ibody, t0, errmsg] = osmi(ConNo, 'OLGA_GET_TIME', [], [], []);

  
