function [err,errmsg] = OsiSetTrendVar(vardesc,ConNo)
%
% OsiSetTrendVar.m		Subscribe for pipeline trend results.
%
% The calling syntax is:
%
%   err = OsiSetTrendVar(vardesc);
%
% Input:
%   VARDESC: String identifying the variables to be reported from OLGA. 
%
% Copyright (c) 1998 by ABB Corporate Research.
% All Rights Reserved.
%
% $Revision: 1.0, 6/10-1998 by Kjetil Havre$ 
% $Revision: 1.1, 20/7-2005 by Espen Storkaas, ABB-EOP, included user-defined connection number$ 

  global OsiIBODYsetTrendVar
  if nargin==1
      ConNo=1;
  end
  
  if (nargin>2)|(nargin==0)  
     errmsg = 'OsiSetTrendVar usage: [err, errmsg] = OsiSetTrendVar(vardesc,ConNo)';
     disp(errmsg);
     err = -1;
     return
  end

  [err, msg, ibody, rbody, errmsg] = osmi(ConNo, 'OLGA_OUTTR_NAMES', [], [], vardesc);
  ID=sprintf('Con%s',num2str(ConNo));
  OsiIBODYsetTrendVar=setfield(OsiIBODYsetTrendVar,ID,ibody);




































































































































