Sample
(method)
This method causes active Monitor to take a sample.
Example
% Create DSS object
DSSObject = actxserver('OpenDSSEngine.DSS')
if ~DSSObject.Start(0),
disp('Unable to start openDSS');
return
end;
DSSText = DSSObject.Text;
DSSCircuit = DSSObject.ActiveCircuit;
% Compile a model
DSSText.Command = 'Compile C:\myPath\myModel.dss';
DSSMonitors = DSSCircuit.Monitors;
% samples the active monitor
DSSMonitors.Sample();
% saves the active monitor's registers
DSSMonitors.Save();
% select the first monitor on the list
DSSMonitors.First;
%Request the Bytestream
Freqs = DSSMonitors.ByteStream;
% To adjust the matrix
iMonitorDataSize = typecast(Freqs(9:12),'int32');
%Adjusts the content
VIMonitor = typecast(Freqs(273:end),'single');
VIMonitor_reg = reshape(VIMonitor, iMonitorDataSize+2, [])';
% reset the active monitor
DSSMonitors.Reset();