Retrieving data using Matlab

The EPICS Archiver Appliance support multiple MIME-types when retrieving data and one of the supported MIME-types is the Matlab file format. The process of getting archive data into Matlab consists of
  1. Constructing a URL to the server. See this section on for the URL format for data retrieval.
  2. Using urlwrite to download data from this URL into a file.
  3. Loading this file into Matlab.
Here's some sample code that is used to get the data for PV VPIO:IN20:111:VRAW

urlwrite('http://test-arch.slac.stanford.edu:17668/retrieval/data/getData.mat', ...
	'temp.mat', 'get', ...
	{'pv', 'VPIO:IN20:111:VRAW', 'from', '2012-09-27T08:00:00.000Z', 'to', '2012-09-28T08:00:00.000Z'})

dat = load('temp.mat')
delete('temp.mat')

try
    header = dat.header;
    data = dat.data;
catch
    fprintf('Could not get data from file\n');
    return
end

header
data

Here's a screenshot of this sample code being executed in a Matlab environment.
The .mat response contains two objects, a header and a data object.