How do I set the signal logging parameters for a line in my Simulink model from the MATLAB command line?
19 views (last 30 days)
Show older comments
MathWorks Support Team
on 30 Sep 2013
Answered: MathWorks Support Team
on 30 Sep 2013
I would like to access all of the Signal Properties dialog box parameters from the command line. Starting from the line handle I was able to access some of them such as Test Point, Signal Name etc. However, I cannot find the properties for the following parameters:
1. "Log Signal Data"
2. "Limit Max Data Points To"
3. "Decimation"
The rest of the parameters can be accessed as follows:
% if lineHandle is the handle to a signal (connecting line) in a model then
set_param(lineHandle, 'testPoint', true);
set_param(lineHandle, 'Name', 'x1');
I would like to know how the above listed parameters ("Log Signal Data", "Limit Max Data Points To" and "Decimation") can be set from the command line.
Accepted Answer
MathWorks Support Team
on 30 Sep 2013
The ability to set these signal logging parameters for a line from the MATLAB command line starting from the line handle is not available in Simulink 6.4 (R2006a) or any previous release.
However, these properties can be set from the command line by starting from the block handle instead of the line handle. Thus, if it is required to set the signal logging properties for a particular line, then one can start from the block whose outport is connected to that line and obtain the 'PortHandles' property from this block handle.
h = get_param(gcbh, 'porthandles');
op = h.Outport;
set_param(op, 'DataLogging', 'on')
set_param(op, 'DataLoggingDecimateData', 'on')
set_param(op, 'DataLoggingDecimation', '2')
set_param(op, 'DataLoggingLimitDataPoints', 'on')
set_param(op, 'DataLoggingMaxPoints', '5000')
The ability to access these properties starting from the line handle is being considered for incorporation into a future release of Simulink.
0 Comments
More Answers (0)
See Also
Categories
Find more on Prepare Model Inputs and Outputs in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!