slQuery

easy-as-pie API to Simulink

46 Downloads

Updated 10 Aug 2021

From GitHub

View License on GitHub

Editor's Note: This file was selected as MATLAB Central Pick of the Week

easy-as-pie API for Simulink models
slQuery is a "slickness-layer" ontop of the `find_system` and `get/set_param` API-functions and various related features of Simulink. It resulted from several inconveniences i had to deal with, while writing scripts that interact with and modify model structures.
Scripted manipulation of Simulink models had always required tons and tons of API-calls, awkward management of block handles vs. pathes, loops and subroutines for dealing with ports/lines or mux-/bus-signals. Dealing with Subsystem levels. In all this code, the main idea of what is being done cannot stand out clearly.
slQuery brings you two major tools that make scripted interaction with models a lot easier and cleaner.
1) slQuery is a query-language inspired by CSS/jQuery, XPath and regex that allows searching a loaded Simulink model for groups of blocks (called "situational patterns") that satisfy certain conditions and have certain relations to each other.
2) slQuery wraps arrays of Simulink block handles into lightweight "objects" that can be used to access block parameters and structural features in a syntactically pleasing way.

Cite As

Robert Rasche (2023). slQuery (https://github.com/arinar/slQuery), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Component-Based Modeling in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.9.0

* fix/add combinator "=" support for phyiscal signal routing
* fix `sel`: now excludes current system (only selected blocks inside
gcs)
* support Two Way Conn blocks in "~>" and "=>" combinators
* better indexing subsasgn by reusing subsref code

1.8.0

* explicit text for hyperlink
* more special port chars in combinator portspecs
* `.sel`-method for instantly wrapping selected blocks in current system
* numeric subsref works for any shape result (X.LineHandles.Outport(1) gives all 1st lines)

1.7.0

add colon-operator for retrieving port- and line-handles of blocks
add basic support for Simscape physical connection modelling
add support for TargetLink properties in query-syntax

1.5.0

ability to reference block parameters of previous selectors
more flexible port/line retrieval with colon-operator

1.4.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.