Simulink - Quarc Library

The QUARC library for Simulink is not just a collection of I/O blocks—it is a complete real-time ecosystem. By enabling engineers to stay within the familiar Simulink environment while interacting with physical hardware, QUARC reduces development time from days to minutes. Its robust handling of real-time synchronization, versatile hardware support, and deep integration with Quanser’s world-class plants make it the go-to choice for control system education and research.

Whether you are a professor designing an undergraduate mechatronics lab, a graduate student validating a nonlinear controller, or an industry professional prototyping a novel actuator, mastering the QUARC blockset will empower you to turn theoretical models into real-world results.

Next Steps for the Reader:

The gap between simulation and reality is narrow, but QUARC provides the bridge. Happy real-time modeling.


Mark Thompson is a control systems engineer with over a decade of experience in real-time simulation and hardware-in-the-loop testing. This article was reviewed by Quanser Inc. for technical accuracy as of 2025.

QUARC is widely considered the "gold standard" for real-time control prototyping within the MATLAB/Simulink environment, particularly in academic and high-end research settings.

The general consensus from users and researchers is that it is a powerful, reliable tool that bridges the gap between theoretical modeling and physical hardware, though its high performance comes with specific hardware requirements and potential performance trade-offs in certain modes. Core Strengths

Quanser Real-Time Control (Software) アルテックス | IPROS

Here’s a professional LinkedIn-style post and a shorter social media post for the QUARC Library for Simulink.


The Quarc library for Simulink streamlines converting Simulink control designs into real-time hardware implementations by providing hardware-specific I/O blocks, real-time orchestration, and deployment tools. Following fixed-step design, hardware abstraction, and incremental testing ensures reliable, deterministic control on supported targets.

QUARC is a powerful real-time control software developed by that integrates directly with

. It allows engineers and researchers to transform Simulink models into real-time applications that can interface with physical hardware without writing a single line of C/C++ code. 🛠️ The QUARC Targets Library The heart of QUARC within Simulink is the QUARC Targets Library

. This library provides specialized blocks that extend standard Simulink functionality for real-time environments. HIL (Hardware-In-the-Loop):

Blocks for reading and writing to data acquisition (DAQ) cards, such as the Quanser Q8-USB Communications:

Support for protocols like TCP/IP, UDP, Shared Memory, Serial, SPI, and I2C. Multithreading: Asynchronous Thread

block allows for non-periodic tasks (like communications or event-driven code) to run separately from the main control loop. Multimedia:

Blocks for interacting with cameras (e.g., FLIR), video files, and audio. ⚡ Core Features

QUARC bridges the gap between digital simulation and physical implementation through several key mechanisms: 1. External Mode Support Using Simulink's External Mode , QUARC allows you to Monitor & Tune

your model while it runs on the hardware. You can change controller gains or parameters in the Simulink diagram and see the results instantly on physical hardware. 2. Rapid Control Prototyping (RCP)

QUARC automates the generation, compilation, and deployment of code. With one click, your model is converted into real-time code and downloaded to the QUARC Target Manager 3. Cross-Platform Deployment

While development often happens on Windows, QUARC can target various environments, including: Windows (Hard Real-Time) Linux (on Raspberry Pi or other boards) Embedded platforms like NI myRIO or ELVIS III 🚀 Getting Started

To use the QUARC library in your Simulink projects, follow these standard steps: QUARC Real-Time Control Software - Quanser quarc library simulink

Understanding the QUARC Targets Library for Simulink QUARC Real-Time Control Software is a powerful tool by that transforms

models into real-time applications without requiring manual code writing. While Simulink is typically used for simulation, the QUARC Targets Library

adds specialized blocksets that allow these models to interact directly with hardware in real-time. Core Components of the QUARC Library

The QUARC library introduces several unique blocksets designed for high-performance control and communication: Hardware-in-the-Loop (HIL) Blocks

: These allow you to interface with data acquisition (DAQ) cards. A key feature is the ability to swap out the physical hardware for a model by changing a single parameter in the block. Communications Blockset

: This set enables models to talk to each other or external devices using protocols like TCP/IP, UDP, Serial, or Shared Memory. It uses Universal Resource Identifiers (URIs)

to define protocols, making it easy to switch communication methods by simply updating a string. Asynchronous Thread Blocks

: Unlike standard Simulink models that are strictly periodic, QUARC allows you to create non-periodic threads

that run asynchronously for tasks like event-driven code or background communications. Advanced Plotting : Includes the XY Figure block

, which outperforms standard Simulink graphs and can be used to drive axes within a custom MATLAB GUI. Key Features and Workflow QUARC Real-Time Control Software - Quanser

QUARCTM is the most efficient way to design, develop, deploy and validate real-time applications on hardware using Simulink®. QUARC Targets Library - Unleashing the Power of QUARC

The QUARC library for Simulink is a set of blocks provided by Quanser that integrates real-time control with Simulink. It allows you to:

This is the most utilized section of the library. Quarc provides pre-written drivers for a vast array of hardware data acquisition (DAQ) cards and sensors. This includes:


If you already own Quanser hardware: Buy QUARC without hesitation. It’s the fastest, most reliable real-time interface for Simulink you’ll find.

If you don’t use Quanser hardware: Skip it. Use Simulink Desktop Real-Time for prototyping or invest in Speedgoat for mission-critical systems.

For educators: QUARC is a superb teaching tool—students learn control theory in Simulink and see immediate physical results.


Bridging the Gap Between Simulation and Real-Time Hardware

In the world of control systems and robotics, the transition from a Simulink simulation to a working physical prototype is often fraught with complexity. This is where the Quarc Library (by Quanser) becomes an indispensable tool.

Quarc is a high-performance add-on for Simulink that transforms it from a design tool into a rapid control prototyping environment. It allows engineers to run Simulink models directly on real-time hardware without writing low-level C code.

Below is a breakdown of the key features that make the Quarc Library a standard in academic and industrial research.


If you need help with a specific QUARC block (e.g., HIL Read Analog, HIL Write Encoder) or setup, just let me know. The QUARC library for Simulink is not just

The QUARC Basic Communications library for Simulink provides a high-level abstraction for data streaming and hardware interfacing. Whether you are building an autonomous drone, a haptic interface, or a complex industrial controller, QUARC simplifies the process of getting Simulink models to talk to the real world. What is the QUARC Library in Simulink?

QUARC, developed by Quanser, is a powerful real-time control software that integrates seamlessly with Simulink. It transforms MATLAB and Simulink into a real-time development environment. The library itself contains a vast collection of blocks designed to handle everything from low-level I/O to complex network protocols. Core Features of the QUARC Library 🟢 Real-Time Execution

QUARC allows Simulink models to run at deterministic rates on various target operating systems, such as Windows or Linux (RT-Preempt). This ensures that your control loops are never interrupted by background OS tasks. 🟢 Hardware-in-the-Loop (HIL)

The HIL blocks allow you to interface with data acquisition boards (DAQ) instantly. You can read encoders, write to PWM outputs, and sample analog sensors by simply dragging and dropping blocks. 🟢 Universal Communications

One of the standout features is the "Stream" API. It allows you to switch between TCP/IP, UDP, Serial, Shared Memory, or Bluetooth by changing a single URI string, without redesigning your model logic. 🟢 Multi-Agent Support

QUARC makes it easy to coordinate multiple controllers. You can run separate models on different machines and have them exchange data with minimal latency. Essential Blocksets to Know 1. HIL (Hardware-In-the-Loop)

HIL Initialize: The "brain" block that configures your hardware board.

HIL Read/Write: Used for physical interaction with motors and sensors. 2. Communications Stream Call/Answer: Establishes connections between models.

Stream Send/Receive: Handles the actual data packet transmission. 3. Multimedia Video Display: Real-time visualization of camera feeds.

Host Keyboard/Mouse: Uses your PC peripherals as inputs for your control model. Why Use QUARC Instead of Standard Simulink? Standard Simulink Simulink + QUARC Speed Best for simulation Optimized for real-time I/O Support Limited / Manual C-code Plug-and-play for 100+ boards External Interfacing Complex setup Simple URI-based comms Deployment Requires C-code knowledge One-click "Build" and "Connect" Best Practices for Using QUARC

Use the HIL Initialize Block: Always place this at the top level of your model to define your hardware parameters globally.

Match Sampling Rates: Ensure your QUARC system timebase matches your Simulink solver step size to avoid "overruns."

Optimize URIs: When using communications blocks, use shmem:// (shared memory) for processes on the same PC to get the lowest possible latency.

Leverage Scopes: Use QUARC’s external mode to tune parameters (like PID gains) while the code is running on the hardware without recompiling. To help you get the most out of QUARC, let me know:

What hardware are you trying to connect to (e.g., Q2-USB, Quanser AERO, or a custom board)?

Are you focusing on communications (sending data) or hardware control? What operating system is your target running on?

I can provide a step-by-step setup guide or a sample URI string for your specific project.

The QUARC library is a suite of tools developed by Quanser that integrates with MATLAB and Simulink to enable rapid control prototyping and real-time hardware-in-the-loop (HIL) simulations. It allows users to generate real-time C code directly from Simulink models and run it on various hardware targets without manual programming. Key Papers and Documentation

Hardware-in-the-Loop Architecture with MATLAB/Simulink and QuaRC: This research paper explores the use of QUARC for rapid prototyping of CMAC neural network controllers, specifically for a ball-and-beam system.

MATLAB Simulink QUARC Primer: An authoritative guide from Quanser that introduces the basic functions of MATLAB, Simulink, and QUARC for first-time users.

QBOT: An educational mobile robot controlled in MATLAB/Simulink environment: This paper discusses the Quanser Mobile Robot Control Framework (QMRCF), which utilizes QUARC to accelerate mobile robot development and HIL testing. Core Capabilities of the QUARC Library QUARC Real-Time Control Software - Quanser The gap between simulation and reality is narrow,

QUARC Targets Library is a specialized extension for Simulink that enables high-performance, real-time code generation and hardware-in-the-loop (HIL) testing. Unlike standard Simulink libraries, it provides unique blocks for hardware access, asynchronous communications, and advanced visualization. Core Capabilities Hardware Interfacing HIL (Hardware-in-the-Loop)

blocks allow for direct access to data acquisition cards. Users can switch hardware targets for an entire model by modifying a single parameter. Real-Time Performance : It supports hard real-time execution

on various targets, including Windows and Linux, and allows for online parameter tuning directly from the Simulink diagram. Asynchronous Execution : Blocks like the Asynchronous Thread

enable non-periodic tasks (e.g., event-driven code or idle worker threads) to run independently of the model's main sample rate. Advanced Sinks : QUARC includes specialized plotting blocks like Time Figure

that offer superior performance and can be integrated into custom MATLAB GUIs. Installation & Configuration

To use QUARC within Simulink, it must be properly initialized in the MATLAB environment: Automatic Setup

: If MATLAB is installed before QUARC, it is typically configured automatically. Manual Setup

: If needed, run the following command in the MATLAB Command Window to add QUARC to the path: quarc_setup Use code with caution. Copied to clipboard Opening the Library : You can access the blockset via the Simulink Library Browser or by entering qc_open_library('quarc_library') in the command window.

Creating Your First Visualization Part I - Loading Meshes and Textures

(Quanser Real-Time Control) is a rapid control prototyping platform that integrates with

to enable the design, development, and deployment of real-time applications directly onto hardware. It serves as a bridge between high-level graphical modeling and real-world execution, allowing users to run controllers on various targets—such as Windows or Linux—without writing manual code. The QUARC Targets Library The core of QUARC’s functionality within Simulink is the QUARC Targets Library

. This library provides specialized blocks that extend standard Simulink capabilities for hardware-in-the-loop (HIL) testing and real-time communication. Data Acquisition (DAQ):

Blocks that allow direct interaction with hardware sensors and actuators. The Immediate I/O

blocks, for instance, read or write to channels every time the block executes, which is critical for time-sensitive control loops. Communications:

A protocol-independent framework that uses Universal Resource Identifiers (URIs) to define connections. It supports various protocols like TCP/IP, UDP, serial, SPI, and I2C. Asynchronous Threads:

These blocks enable the creation of non-periodic threads for tasks like event-driven code or background communications, which run independently of the main model sample rate. Continuous Blocks:

Includes advanced tools for nonlinear state-space systems and extended Kalman filters. Key Features and Capabilities

QUARC transforms a standard Simulink environment into a powerful real-time workstation with several distinct advantages: QUARC Real-Time Control Software - Quanser


One of the critical distinctions between Simulink simulation and Quarc is how time is handled.

QUARC supports External Mode, which allows you to tune parameters (e.g., PID gains) and view scopes live while the model runs on a separate target computer. This is critical for hard real-time performance where the host OS may introduce jitter.