Skip to content
MathWorks - Mobile View
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
MathWorks
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out

Videos and Webinars

  • MathWorks
  • Videos
  • Videos Home
  • Search
  • Videos Home
  • Search
  • Contact sales
  • Trial software
4:43 Video length is 4:43.
  • Description
  • Full Transcript
  • Related Resources

File Logging in Simulink Real-Time

Learn about the new File Log block to log signals with Simulink Real-Time™. Use this block to log signals on the Speedgoat target computer. With Simulation Data Inspector, you can visualize file log data while interacting with the Speedgoat target computer using Simulink®, MATLAB®, and deployment mode run on startup. See an example model and demonstration of the block and how to use it in your Simulink model.

File log block, introduced in 2020b, enhanced and simplified the mechanism for logging signals with Simulink real time. This addresses logging signals that are not required for immediate streaming while the real-time application is running, but more for signals that you want to log on the target computer and post process. This is crucial for many field deployment or DSL workflows. Really any time you want to run multiple tests and log large sets of signals.

Let's take a look at an example model where I've used two file log blocks. You can have multiple file log blocks in a model. In this particular example, I've interfaced bus signals to the file log blocks, but you can also use individual signals or signals coming in for months, as well. You can choose the decimation for the samples that are recorded. This is the second file log block that I have. Again, interface to a bus with two signals coming in. If you have other signals that you want to record for immediate viewing, you can always use the standard workflow for logging signals using simulation data inspector. You just need to right click and select enable data logging.

To use Simulink as the UI in external mode, you can use the one click run on target option which will build, deploy, and connect this model to the real time application download on the target computer. Once the real time application starts running on the target, the file logging service starts recording the data. You can add, enable, block to enable, and disable the file logging service or use MATLAB API to do the same.

Simulation data inspector can be used to view the signals that were badged for immediate visualization while the real-time application is running on the target computer. Once the old application stops running, the signals that were logged using the file log service are available in the same simulation data inspector UI. Here, you can see there are two runs for one real-time application run. One which records the data, which was badged for immediate visualization, another which was signals that were logged using the file log service.

In the configuration parameters, under Simulink real-time options, you can select the number of file log runs to retain on the target computer. What this allows you to do is store multiple file log runs for a real time application without them having been ordered. So this is especially useful in deployment workflows where you might be running the real time application a multiple number of times without connecting back to a MATLAB session to bring back the data stored on the target computer.

Now let's take a look at a test engineer persona who might be using MATLAB API to interact with the real time application. First, we'll create a target object to interact with the target computer. Then, we can use that target object to load a particular application. In this case, we've used the same example.

Now the default behavior, if the MATLAB session is connected to the computer, is to bring back the file log once the application stops running. But a test engineer might want to run the real time application a number of times and bring back all the file logs for the different ones at the end. For that, you can start the application and set the order import file log flag defaults, which will allow you to not auto-import file log after each run.

Simulink real-time explorer can be used to interactively import file logs. For deployment workflows, you could select one of the real-time applications to run at startup. That way, once the target computer powers on, that particular real-time application starts running. The import file log button can be used to import particular file logs. You can import particular file logs according to a real time application name and the date timestamp. The imported fault log is viewable on the simulation data inspector.

For more information on file logging please see the links below.

Related Products

  • Simulink Real-Time

Bridging Wireless Communications Design and Testing with MATLAB

Read white paper

Feedback

Featured Product

Simulink Real-Time

  • Request Trial
  • Get Pricing

Up Next:

3:04
Concurrent Execution Using a Multicore Speedgoat Target...

Related Videos:

33:03
Rapid Control Prototyping for Permanent Magnet Synchronous...
5:38
Automate Test Generation to Enhance Real-Time Testing
23:17
Test Automation - From Desktop Simulation to Real-Time
13:58
Real-Time Control Prototyping of Driver Assistance and...

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • Switzerland (English)
  • Switzerland (Deutsch)
  • Switzerland (Français)
  • 中国 (简体中文)
  • 中国 (English)

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contact sales
  • Trial software

MathWorks

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Discover…

Explore Products

  • MATLAB
  • Simulink
  • Student Software
  • Hardware Support
  • File Exchange

Try or Buy

  • Downloads
  • Trial Software
  • Contact Sales
  • Pricing and Licensing
  • How to Buy

Learn to Use

  • Documentation
  • Tutorials
  • Examples
  • Videos and Webinars
  • Training

Get Support

  • Installation Help
  • MATLAB Answers
  • Consulting
  • License Center
  • Contact Support

About MathWorks

  • Careers
  • Newsroom
  • Social Mission
  • Customer Stories
  • About MathWorks
  • Select a Web Site United States
  • Trust Center
  • Trademarks
  • Privacy Policy
  • Preventing Piracy
  • Application Status

© 1994-2022 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Join the conversation