Convert Targetlink blocks to Simulink

20 views (last 30 days)
Apurv Koregave
Apurv Koregave on 4 May 2017
Commented: Amana on 26 Nov 2024
Hello, I have been working with Targetlink blocks to build my models. However lately other departments who do not have Targetlink lisences want to convert these models in Simulink for Simulations. As the models are relatively big, it would take an enormous time to build these models again. I have been trying to find a solution where through an mfile we can convert the blocks. However due to lack of documentation, I haven't been able to come to a conclusion if it is possible. Is there a solution to convert these Targetlink blocks (most of which are simple math operations, ports, logic operators etc.) to their Simulink counterparts. Thank you in advance.

Answers (2)

Vishwanath Salokye
Vishwanath Salokye on 5 Sep 2017
Hello Apurv Koregave There are many ways to convert TL to SL block. select all blocks, right click go to TargetLink and de-enhance TargetLink property. Write a script to read TL block properties and replace with SL block with same properties.

Daniel
Daniel on 18 Oct 2018
Hi, is there a way to do this automatically for all TL blocks in a subsystem?
  2 Comments
Cuzuc Vlad-Andrei
Cuzuc Vlad-Andrei on 16 Feb 2021
Hi Daniel :)
You can automatically Enhance all blocks in a subsystem like this:
BlocksToEnhance = tl_check_system('system',YourSubsystem); -> this will return a structure with all blocks checked by TargetLink.
BlocksToEnhance = BlocksToEnhance.hUnEnhBlocks; -> this will select you only the blocks you need that are not enhance
x = tl_enhance_block(BlocksToEnhance); -> with this you enhance all your blocks. If you don't use an output 'x' a prompt will appear every time. To avoid this you must assign an output to the function call (in this case x). The function will return an empty array if no error has occurred.
I hope this information helped you :)

Sign in to comment.

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!