Code covered by the BSD License  

Highlights from
MATLAB Support Package for Velleman K8055/VM110 Experiment Board

MATLAB Support Package for Velleman K8055/VM110 Experiment Board

by

 

MATLAB library for communicating with a Velleman K8055/VM110 USB Experiment Interface Board

vellboard.Prefs
% Prefs: Class for accessing velleman package preferences
%
% prefobj = vellboard.Prefs()
%   Creates an instance of the Prefs class. This allows you to read and
%   write to preferences as if they were properties of Prefs.

%   Copyright 2011 The MathWorks, Inc.

classdef Prefs 

    properties (Dependent)
        % The location of the file K8055D.dll (not the containing
        % directory)
       K8055_DLL_Location
    end
        
    methods              
        function out = get.K8055_DLL_Location(obj) %#ok<MANU>
            if ~ispref('velleman','K8055_DLL_Location')
                addpref('velleman','K8055_DLL_Location','');
            end
            out = getpref('velleman','K8055_DLL_Location');
        end
        
        function obj = set.K8055_DLL_Location(obj,val)
            if ischar(val) && exist(val,'file')
                setpref('velleman','K8055_DLL_Location',val);
            else
                error('vellboard:BadDLLLocation','Invalid DLL location');
            end
        end
        
        
        function display(obj)
           fprintf('  <a href="matlab: help vellboard.Prefs.K8055_DLL_Location">K8055_DLL_Location</a>: ''%s''\n\n', obj.K8055_DLL_Location);
           
           fprintf('  -------------------- \n');
           fprintf('  To change settings: \n');
           fprintf('    p = vellboard.Prefs;\n');
           fprintf('    p.K8055_DLL_Location = ''c:\\MyNewLocation'';\n');
           fprintf('  -------------------- \n');
        end
        
    end
        
end

Contact us