%% Connect to OPC server
% Written by: Henrik Hjelseth Hansen, 27.01.2012

function da = OLGA_connect () 

%hostInfo = opcserverinfo('localhost'); % Get Hostinfo for OPC server
%allServers = hostInfo.ServerID';       % Save ServerIDs
%id = allServers{2,1};                  % Choose the OLGA OPC Server
id ='SPT.OLGAOPCServer.7';              % Directly write in server id
da = opcda('localhost', id);            % Data Access Object
connect(da);                            % Connect object to Server
pause(5);                               % Pause to wait for connection
disp('Connected to OLGA')
end



