The Benefits and Features of Plecs Blockset: How to Get Started with a License.dat.epub File
Introduction
If you are looking for a fast and easy way to design and simulate power electronic circuits within the Simulink environment, you might want to check out Plecs Blockset. Plecs Blockset is a unique tool that allows you to combine electrical circuits modeled in Plecs with controls modeled in Simulink. You can take advantage of the entire Simulink library and the various extensions to model special controls or other physical domains. You can also use Plecs Coder and Plecs PIL to generate code for your controller and test it on real hardware.
Plecs Blockset License.dat.epub
Plecs Blockset has many benefits, such as:
Intuitive schematic editor: You can create and edit your circuit using a graphical interface that is similar to Simulink. You can drag and drop components from the component library, connect them with wires, and parameterize them easily.
Use of Simulink solver: At the start of a simulation, the Plecs circuit is converted on the fly into a set of equivalent equations. The Simulink engine itself solves the equations alongside the control system designed in Simulink. This ensures full compatibility with simulation settings, supporting both variable- and fixed time-step solvers.
High performance: Plecs Blockset uses optimized algorithms and data structures to handle large and complex circuits efficiently. You can also use parallel computing features to speed up your simulations.
Code generation and hardware-in-the-loop testing: You can use Plecs Coder to generate C code for your controller that can be compiled and executed on various target platforms. You can also use Plecs PIL to connect your Simulink model with an imperix controller running on real hardware, enabling hardware-in-the-loop testing.
To use Plecs Blockset, you need MATLAB and Simulink on your system. The table below shows the platforms and MATLAB versions currently supported by Plecs Blockset:
PlatformMATLAB VersionOperating System
Windows9.2 ... 9.14Windows 10 64-bit
Mac / Intel9.2 ... 9.14macOS 10.13 or newer
Linux / Intel9.2 ... 9.14Kernel 2.6 64-bit/glibc 2.15/libX11 (aka Xlib) 6.2.1 or newer, libncurses5.x
You also need a license file (*.lic) for Plecs, which you can obtain from Plexim or request a trial or student license.
How to install Plecs Blockset
In this section, we will show you how to install Plecs Blockset on your computer step by step. The installation process is different depending on your operating system. Please follow the instructions for your platform carefully.
Windows
To install Plecs Blockset on Windows, you need to download the installer file (*.exe) from the Plexim website. You can choose between a 32-bit and a 64-bit version, depending on your MATLAB installation. The installer file contains both Plecs Blockset and Plecs Standalone, so you can install both products at once or separately.
After downloading the installer file, double-click on it to start the installation process. You will see a welcome screen that asks you to accept the license agreement. Read the agreement carefully and click "I Agree" if you agree with the terms. Then, you will see a screen that lets you choose which components to install. You can select Plecs Blockset, Plecs Standalone, or both. You can also change the installation directory if you want.
Next, you will see a screen that asks you to select the MATLAB versions that you want to use with Plecs Blockset. The installer will automatically detect the MATLAB versions installed on your system and show them in a list. You can select one or more versions by checking the boxes next to them. You can also add a MATLAB version manually if it is not detected by the installer.
After selecting the MATLAB versions, click "Next" to proceed with the installation. The installer will copy the files to your system and register Plecs Blockset with MATLAB. This may take a few minutes, depending on your system speed and configuration. When the installation is complete, you will see a confirmation screen that shows the installation summary and some useful links. Click "Finish" to exit the installer.
To activate your license file for Plecs Blockset, you need to copy it to the following location:
C:\Program Files (x86)\Plexim\Plecs Blockset\license.dat
If you have installed Plecs Blockset in a different directory, adjust the path accordingly. You can also use an environment variable called PLECS_LICENSE_FILE to point to your license file location.
After copying your license file, you can start MATLAB and use Plecs Blockset. To verify that Plecs Blockset is installed correctly, type plecs in the MATLAB command window. This should open a new Simulink model with a PLECS Circuit block in it.
Mac OS X
To install Plecs Blockset on Mac OS X, you need to download the disk image file (*.dmg) from the Plexim website. The disk image file contains both Plecs Blockset and Plecs Standalone, so you can install both products at once or separately.
After downloading the disk image file, double-click on it to mount it on your system. You will see a window that shows two icons: one for Plecs Blockset and one for Plecs Standalone. To install Plecs Blockset, drag and drop the icon onto the Applications folder shortcut in the same window. This will copy the files to your system and register Plecs Blockset with MATLAB.
To activate your license file for Plecs Blockset, you need to copy it to the following location:
/Applications/Plexim/Plecs Blockset/license.dat
If you have installed Plecs Blockset in a different directory, adjust the path accordingly. You can also use an environment variable called PLECS_LICENSE_FILE to point to your license file location.
After copying your license file, you can start MATLAB and use Plecs Blockset. To verify that Plecs Blockset is installed correctly, type plecs in the MATLAB command window. This should open a new Simulink model with a PLECS Circuit block in it.
Linux / Intel
To install Plecs Blockset on Linux / Intel, you need to download the archive file (*.tar.gz) from the Plexim website. The archive file contains both Plecs Blockset and Plecs Standalone, so you can install both products at once or separately.
After downloading the archive file, extract it to a directory of your choice using a command like this:
tar xzf plecs-4_5_7-linux64.tar.gz
This will create a subdirectory called plecs-4_5_7-linux64 that contains all the files for Plecs Blockset and Plecs Standalone. To install Plecs Blockset, run the installer script inside this subdirectory using a command like this:
./plecslinuxinstaller.sh
This will launch a graphical user interface that guides you through the installation process. You will see a welcome screen that asks you to accept the license agreement. Read the agreement carefully and click "I Agree" if you agree with the terms. Then, you will see a screen that lets you choose which components to install. You can select Plecs Blockset, Plecs Standalone, or both. You can also change the installation directory if you want.
Next, you will see a screen that asks you to select the MATLAB versions that you want to use with Plecs Blockset. The installer will try to find the MATLAB versions installed on your system and show them in a list. You can select one or more versions by checking the boxes next to them. You can also add a MATLAB version manually if it is not found by the installer.
After selecting the MATLAB versions, click "Next" to proceed with the installation. The installer will copy the files to your system and register Plecs Blockset with MATLAB. This may take a few minutes, depending on your system speed and configuration. When the installation is complete, you will see a confirmation screen that shows the installation summary and some useful links. Click "Finish" to exit the installer.
To activate your license file for Plecs Blockset, you need to copy it to the following location:
/opt/plexim/plecsblockset/license.dat
If you have installed Plecs Blockset in a different directory, adjust the path accordingly. You can also use an environment variable called PLECS_LICENSE_FILE to point to your license file location.
After copying your license file, you can start MATLAB and use Plecs Blockset. To verify that Plecs Blockset is installed correctly, type plecs in the MATLAB command window. This should open a new Simulink model with a PLECS Circuit block in it.
How to use Plecs Blockset
In this section, we will show you how to use Plecs Blockset to create and simulate power electronic circuits within Simulink. We will cover some basic features and functions of Plecs Blockset, such as:
How to create and edit a PLECS Circuit block in Simulink
How to run simulations and view results
How to use PLECS Coder and PLECS PIL for code generation and hardware-in-the-loop testing
For more advanced topics and tutorials, please refer to the Plecs user manual and the online documentation.
How to create and edit a PLECS Circuit block in Simulink
A PLECS Circuit block is a special Simulink block that contains an electrical circuit modeled in Plecs. You can create a PLECS Circuit block by typing plecs in the MATLAB command window or by selecting it from the Simulink library browser under Plexim/Plecs Blockset.
To edit a PLECS Circuit block, double-click on it or right-click on it and select "Edit". This will open the schematic editor window, where you can draw and modify your circuit using graphical tools. The schematic editor window has four main areas:
The toolbar: It contains buttons for common actions, such as adding components, connecting wires, zooming, undoing, etc.
The component library: It contains various categories of components that you can drag and drop onto your schematic. You can also search for components by name or keyword using the search box.
The schematic area: It is where you draw your circuit using components and wires. You can select, move, rotate, copy, paste, delete, and parameterize components using the mouse and keyboard shortcuts.
The status bar: It shows information about your circuit, such as the number of components, nodes, states, etc. It also shows messages and warnings from Plecs.
To save your circuit, click on the "Save" button on the toolbar or press Ctrl+S. This will save your circuit as part of your Simulink model file (*.slx). You can also export your circuit as a separate file (*.plecs) by clicking on the "Export" button on the toolbar or selecting "File/Export" from the menu bar.
How to run simulations and view results
To run simulations with Plecs Blockset, you need to configure your Simulink model settings and start the simulation from Simulink. Plecs Blockset will automatically convert your circuit into a set of equations that are solved by the Simulink solver alongside your control system.
To configure your Simulink model settings, open the model configuration dialog by clicking on the "Model Configuration Parameters" button on the toolbar or selecting "Simulation/Model Configuration Parameters" from the menu bar. In the dialog, you can adjust various parameters, such as the solver type, the simulation time, the output options, etc. For more details on how to choose the best settings for your simulation, please refer to the Plecs user manual and the Simulink documentation.
To start the simulation, click on the "Run" button on the toolbar or press Ctrl+T. This will launch the simulation and show the progress in the status bar. You can also pause, stop, or restart the simulation using the buttons on the toolbar or the keyboard shortcuts.
To view the simulation results, you can use Simulink scopes or Plecs scopes. Simulink scopes are standard Simulink blocks that display signals from your model in a graphical window. You can add Simulink scopes to your model by dragging and dropping them from the Simulink library browser under Sinks. You can also configure their properties by double-clicking on them or right-clicking on them and selecting "Block Parameters".
Plecs scopes are special Plecs blocks that display signals from your circuit in a graphical window. You can add Plecs scopes to your circuit by dragging and dropping them from the component library under Measurements/Scopes. You can also configure their properties by double-clicking on them or right-clicking on them and selecting "Edit". Plecs scopes have some advantages over Simulink scopes, such as:
They can display multiple signals in different domains (voltage, current, power, etc.) in one window.
They can display signals in different units (V, A, W, etc.) and scales (linear, logarithmic, etc.) in one window.
They can display signals in different formats (time-domain, frequency-domain, etc.) in one window.
They can display signals with different colors, styles, markers, labels, etc. in one window.
They can export data to various formats (CSV, MAT, PNG, etc.) for further analysis.
To view the simulation results using Plecs scopes, you need to connect them to your circuit using measurement probes. Measurement probes are special Plecs components that measure signals from your circuit and send them to Plecs scopes. You can add measurement probes to your circuit by dragging and dropping them from the component library under Measurements/Probes. You can also configure their properties by double-clicking on them or right-clicking on them and selecting "Edit".
How to use PLECS Coder and PLECS PIL for code generation and hardware-in-the-loop testing
If you want to generate code for your controller or test it on real hardware, you can use PLECS Coder and PLECS PIL. PLECS Coder is a tool that generates C code for your controller that can be compiled and executed on various target platforms. PLECS PIL is a tool that connects your Simulink model with an imperix controller running on real hardware, enabling hardware-in-the-loop testing.
To use PLECS Coder and PLECS PIL, you need to install them separately from Plecs Blockset. You can download them from the Plexim website and follow the installation instructions for your platform. You also need an imperix controller and a license file for PLECS Coder and PLECS PIL.
To generate code for your controller using PLECS Coder, you need to create a subsystem in Simulink that contains your controller logic. You can use any Simulink blocks that are supported by PLECS Coder, such as arithmetic operations, logic operations, trigonometric functions, etc. You also need to specify the inputs and outputs of your subsystem using Inport and Outport blocks.
After creating your subsystem, right-click on it and select "PLECS Coder/Generate Code". This will open a dialog where you can configure various options for code generation, such as the target platform, the compiler settings, the optimization level, the header files, etc. You can also select the option to generate a Simulink S-Function that allows you to test your code in Simulink before deploying it to the target platform. After configuring the options, click "Generate" to start the code generation process. This may take a few minutes, depending on the complexity of your subsystem and the target platform. When the code generation is complete, you will see a confirmation message and a link to the generated code folder.
To test your code on real hardware using PLECS PIL, you need to connect your imperix controller to your computer using a USB cable. You also need to configure your imperix controller using the imperix IDE software. You can download the imperix IDE software from the imperix website and follow the installation instructions for your platform. You also need a license file for the imperix IDE software.
After connecting and configuring your imperix controller, right-click on your subsystem and select "PLECS PIL/Connect". This will open a dialog where you can configure various options for hardware-in-the-loop testing, such as the communication settings, the sampling time, the input and output signals, etc. You can also select the option to enable real-time monitoring and logging of your signals using PLECS Scope. After configuring the options, click "Connect" to start the hardware-in-the-loop testing process. This will upload your code to the imperix controller and run it in parallel with your Simulink model. You can also pause, stop, or restart the hardware-in-the-loop testing using the buttons on the toolbar or the keyboard shortcuts.
Common errors and solutions for Plecs Blockset
In this section, we will show you some common errors that you might encounter when using Plecs Blockset and how to solve them. We will cover some typical scenarios and solutions, such as:
How to troubleshoot connection problems with a license server
How to fix a bug in MATLAB R2013b that causes it to freeze after installing Plecs Blockset
How to contact support for further assistance
For more detailed information and troubleshooting tips, please refer to the Plecs user manual and the online documentation.
How to troubleshoot connection problems with a license server
If you are using a network license for Plecs Blockset, you need to connect to a license server that hosts your license file. Sometimes, you might experience connection problems with the license server that prevent you from using Plecs Blockset. Some common causes and solutions for connection problems are:
The license server is down or unreachable: Check if the license server is running and accessible from your network. You can use tools like ping or telnet to test the connectivity. If the license server is down or unreachable, contact your network administrator or Plexim support for help.
The license file is invalid or expired: Check if your license file is valid and not expired. You can open your license file with a text editor and look for the expiration date and other information. If your license file is invalid or expired, contact Plexim support for help.
The license file is in use by another user: Check if your license file has enough seats available for your usage. You can use tools like lmstat or lmutil to check the status of your license file and see how many users are currently using it. If your license file is in use by another user, wait until a seat becomes available or contact Plexim support for help.
The environment variable PLECS_LICENSE_FILE is not set correctly: Check if your environment variable PLECS_LICENSE_FILE is pointing to the correct location of your license file. You can use tools like echo or set to check the value of your environment variable. If your environment variable PLECS_LICENSE_FILE is not set correctly, change it accordingly or contact Plexim support for help.
How to fix a bug in MATLAB R2013b that causes it to freeze after installing Plecs Blockset
If you are using MATLAB R2013b on Windows, you might encounter a bug that causes MATLAB to freeze after installing Plecs Blockset. This bug is related to a conflict between MATLAB and Microsoft Visual C++ 2010 Redistributable Package that is installed by Plecs Blockset. To fix this bug, you need to uninstall Microsof