Code covered by the BSD License  

Highlights from
MPC555 Motor Control Function Blockset

MPC555 Motor Control Function Blockset

by

 

20 Mar 2006 (Updated )

Additional I/O blocks for MPC555 target - specifically targetting TPU functionality

mpc555_mtrctrl_calc_mask_actual(block, ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function mpc555_mtrctrl_calc_mask_actual(block, ...
%        param_name, actual_name, ...
%        clock, clockvalid)
%
%   Calculate the value of a time in seconds given the mask name of a
%   parameter containing the value in clock ticks ticks.
%
%   Parameters are:
%       'param_name':           String containing the name of the mask
%                               parameter containing the parameter value 
%                               in clock ticks
%       'actual_name':          String containing the name of the mask
%                               parameter into which the actual time in
%                               seconds is to be written
%       'clock':                The clock frequency
%       'clockvalid':           Logical true/false value specifying if the
%                               clock frequency is relevant in this
%                               situation
function mpc555_mtrctrl_calc_mask_actual(block, ...
    param_name, actual_name, ...
    clock, clockvalid)

% Get parameter value from the mask
param_value = str2num(get_param(block, param_name));

% Calculate the actual time value
[actual_value] = mpc555_mtrctrl_calc_actual(param_value, clock, clockvalid);

% Set the actual time value in the mask
set_param(block, actual_name, num2str(actual_value));

end

Contact us