To some extent, X2C is open source, distributed under the BSD 3‑Clause License. See the available editions for a detailed overview.
FAQ
Didn’t find the answer to your question? Please check the documentation included in the download package or contact us.
Please see the different available versions in the download section and feel free to contact us for licensing questions.
No. The free version of X2C runs with Scilab. If you want to use X2C with Matlab®, you need to get a X2C Professional license.
You can download Scilab here.
Yes, since nightly build v639, X2C code generation works under Linux. However, some things have to be considered:
-
Prior to executing X2C setup, the environment variable has to be set manually.
This can be done by adding the line:export X2C_Root=/home//X2C in:
/home//.profile - Pre-compiled libraries for simulation in Xcos are not available.
-
Some USB-to-serial converters are not recognized automatically by X2C Communicator.
To work properly, the name has to be either/dev/ttySxor/dev/ttyUSBx.
The following example shows how to get the Microstick Plus demo board recognized:ls -l /dev/ttyACM0gives the output:
crw-rw---- 1 root dialout 166, 0 Feb 11 08:56 /dev/ttyACM0With this information, a new device can be created:
sudo mknod /dev/ttyUSB0 c 166 0 sudo chown root:dialout /dev/ttyUSB0 sudo chmod 660 /dev/ttyUSB0This device will be recognized by the Communicator.
-
The Communicator can only be started within Scilab/Xcos.
StartingCommunicator.jaras standalone application will not work.
The control scheme is set up in Scilab’s Xcos by dragging the control blocks into the current diagram.
You can create the compilation ready C-code representing your control scheme by clicking the create code button in the Communicator GUI.
Yes. Since X2C v6.4 Scilab version 6.1.1 is supported.
The easiest and fastest way is to use the Communicator GUI. It provides a convenient way to set the communication parameters and connect to the target.
To get a connection with the Communicator, an X2C application has to be running on the target. So the target has to be programmed prior to any connection attempts. Also interface and port in the “Setup”-tab have to be selected according to the setup of the target.
The new application has to be downloaded using the built-in programming feature of the target’s IDE. With X2C Professional and its bootloader support, a new application can be downloaded via the Communicator GUI.
Please check the list of supported targets. If your device is not among the listed targets but is a member of either the C28xx, ARMv6, ARMv7, dsPIC, or PIC32 series, you can use a generic processor type.
Unfortunately, simulation out of the box does not work in Linux yet. However, simulation is possible if the following steps are followed:
- Install
gcc. - Download and install the latest X2C nightly build.
-
Re-create the libraries in Scilab:
createLibrary("General")createLibrary("Math")createLibrary("Control")
-
Compile the libraries in Scilab:
compileLibs()
-
After every start of Scilab, load the libraries by running:
loadLibs()or- execute
initProject.scebefore opening an X2C Xcos model.
A JRE only is required if X2C is intended to be used in Standalone mode, e.g. using the Communicator outside Scilab or Matlab or using the Block Generator.
Above use case requires a JRE installation and – dependend of the underlying operating system and used JRE type – additional steps during the JRE setup.
If X2C is used in Scilab or Matlab environment only, no dedicated JRE is required.
X2C has been tested to work with
- Oracle Java SE 1.8
- ojdkbuild 13
The latter uses OpenJDK sources and is free for use.
If ojdkbuild is to be used on a Microsoft Windows platform, additional steps may be necessary during installation. For more information please have a look at the X2C documentation.
Peter Dirnberger
Teamlead E-Drives