SIMulation      Workbench
  • Main Links
    • Concurrent Real-Time
    • Catalog
    • License Center
  • SIMulation Workbench
    • About
    • Real-Time Introduction
    • Architecture
    • Demos & Videos
    • White Papers
    • FAQ
    • Install
    • Download
    • Installation
    • Release Highlights
    • Overview
    • Control Center GUI
    • MLToolkit
    • PYToolkit
    • Supported I/O
    • Supported Third-Party Tools
    • Fault Insertion
  • Success Stories
  • Search
Jump to: navigation, search

FAQ

For questions not answered in this FAQ or if you require additional support using SimWB, 
please contact us at support@concurrent-rt.com.

Contents

  • 1 General Questions
    • 1.1 What are the system requirements for SimWB?
    • 1.2 Is there a 64 bit version of SimWB?
    • 1.3 Does SimWB support 32 and 64 bit MATLAB on Windows and Linux?
    • 1.4 What is a Hexadecimal Floating Point Literal
  • 2 Using SimWB
    • 2.1 SimWB login
      • 2.1.1 How do I login for the first time?
    • 2.2 SimWB test and sessions
      • 2.2.1 What is a SimWB test?
      • 2.2.2 What is a SimWB test session?
      • 2.2.3 How do I create test in SimWB?
      • 2.2.4 How do I create a test session in SimWB?
      • 2.2.5 How do I log data during a test/session run?
      • 2.2.6 How do I playback a test in SimWB?
      • 2.2.7 How do I extract data generated from tests from command line
        • 2.2.7.1 Commands
        • 2.2.7.2 Example
    • 2.3 SimWB MLToolkit
      • 2.3.1 How does SimWB fit into Model Based Design
      • 2.3.2 What is the SimWB Toolkit for MATLAB?
      • 2.3.3 How do I create an RTDB from a Simulink model?
      • 2.3.4 How are subsystem inports and outports handled during SimWB compliant code generation from the MLToolkit?
      • 2.3.5 What is the difference between the configuration RTDB and the shared memory RTDB?
      • 2.3.6 How do I connect one model's RTDB variable to another model's RTDB variable?
      • 2.3.7 How do I execute models that have IP protected S-functions in SimWB?
      • 2.3.8 How do I resolve a missing library error?
    • 2.4 SimWB Models
      • 2.4.1 How do I run models faster or slower than the main frame rate?
    • 2.5 SimWB I/O
      • 2.5.1 Is there a list of I/O boards supported by SimWB ?
      • 2.5.2 Synchronous versus Asynchronous I/O in SimWB ?
      • 2.5.3 How do I add support for my own hardware board in SimWB ?
      • 2.5.4 How does the CAN DBC import parse CAN messages with Little-Endian format
      • 2.5.5 Can I change the value of an AIO/DIO RTDB variable while a test is running?
    • 2.6 SimWB Real-Time Host Files
      • 2.6.1 RTDB
      • 2.6.2 RTW
      • 2.6.3 RTW.Sources
      • 2.6.4 UserExecs
      • 2.6.5 UserSources
      • 2.6.6 Tests
        • 2.6.6.1 Test Sessions
      • 2.6.7 Script
      • 2.6.8 Calibration
    • 2.7 SimWB HMI
      • 2.7.1 How to run HMI through command line?
      • 2.7.2 How can I build custom HMI's in SimWB?
      • 2.7.3 Can I add unicode characters, especially Japanese and Chinese characters to the Text Label in an HMI Display?
      • 2.7.4 How do I modify the CVT value of a model parameter array element using an HMI Display?
    • 2.8 SimWB Scheduler
      • 2.8.1 How SimWB Scheduler resolves execution order of non-base-rate task dependencies?
        • 2.8.1.1 Example 1
        • 2.8.1.2 Example 2
    • 2.9 Using SimWB with Third Party Products
      • 2.9.1 How do I use a Dymola generated FMU file in SimWB
      • 2.9.2 I/My vendor do not have access to RedHawk. How do I compile the FMU for use in SimWB?
      • 2.9.3 How do I use rFpro with SimWB
      • 2.9.4 Why do I see a GLIBC error when I try to run an FMU in SimWB
      • 2.9.5 Configuring Senso Wheels and Pedals
      • 2.9.6 Installing Simpack 2021 in RedHawk 7.x
  • 3 Troubleshooting
    • 3.1 Why am I unable to view the debugger(kdbg) display when debugging a User or I/O task in SimWB?
      • 3.1.1 In RedHawk 7.0+
      • 3.1.2 In RedHawk 6.0-6.4
      • 3.1.3 Before RedHawk 6.0
    • 3.2 How do I debug my source code in SimWB using the GUI?
    • 3.3 Why do I receive license not available error even when I do have license?
    • 3.4 How do I use the license file for SimWB 7.0-0 and after?

General Questions

What are the system requirements for SimWB?

Please see Installation Prerequisites.

Is there a 64 bit version of SimWB?

Yes, there is a 64 bit version of SimWB which can be installed on the 64 bit RedHawk Operating System.

Does SimWB support 32 and 64 bit MATLAB on Windows and Linux?

Yes, SimWB Toolkit for MATLAB supports both 32 and 64 bit MATLAB (R2008b and later) on Windows as well as Linux. SimWB has a small MATLAB/Simulink footprint so SimWB is easily made compatible with the latest version of MATLAB/Simulink offered by the MathWorks. For MATLAB (R2008a and earlier), please use the Legacy SimWB - MATLAB interface.

Platform.png

Image: SimWB supported architectures

What is a Hexadecimal Floating Point Literal

A string literal of the form 0x1.8p1 in SimWB is a Hexadecimal floating point literal of a double. This notation is used in the Test->InitialCondition files so that the "exact" binary representation of the floating point number can be transmitted over the network in ASCII format.

Hexadecimal floating point literals are of the form 0x1.8p1 which is used to represent the value 3.

The following extract from [1] which describes the lexical structure of the the Hexadecimal Floating Point Literal.

Hexadecimal Floating Point Literal:

       HexSignificand BinaryExponent FloatTypeSuffixopt

HexSignificand:

       HexNumeral
       HexNumeral .
       0x HexDigitsopt . HexDigits
       0X HexDigitsopt . HexDigits

BinaryExponent:

       BinaryExponentIndicator SignedInteger

BinaryExponentIndicator:one of

       p P

Use the C function strtod to convert a Hexadecimal Floating Point Literal to a floating point number. Please see the strtod man page for additional information.

Using SimWB

SimWB login

How do I login for the first time?

You can use the following default user credentials to log-in to SimWB:

  • Username : admin
  • Password : nimda

After installation, it is a good idea to change this default password.

SimWB test and sessions

What is a SimWB test?

A SimWB test is a collection of SimWB resources pulled together to make a runnable configuration.
It is defined with the following resources:

  • A RTDB
    • The RTDB will define which I/O tasks are run as part of the test run. The set of I/O tasks to run is determined from the RTDB I/O mappings. I.e if a input RTDB item is mapped to a AI64SS channel, an instance of a ai64ss I/O task will be started.
  • A test script (optional)
  • One or more user models, Simulink models, Third Party (SIMPACK, FMU) models (optional)

What is a SimWB test session?

A test session is a specific runnable instance of a SimWB test. SimWB sessions always belong to a specific test. A test session can be pre created by the user and then run repeatedly. Run time configuration parameters can be specified independently for each session.
Those parameters are:

  • The scheduling method to use to dispatch the simulation loop:
    • Default FBS (RCIM) scheduler.
    • Software O/S timer.
    • Red line scheduler.
  • The set of RTDB and Simulink model parameters initial condition.
  • The maximum number of overruns to tolerate during the session run.
  • The maximum amount of time alloted to process asynchronous RTDB updates from asynchronous I/O tasks.
  • Whether the data logger will be run during the session.

The session will also retain the data logging files corresponding to the RTDB items values that were logged during the run. Be aware that running the session multiple times will overwrite the data that was recorded during a previous run of the session.

A session can also be auto created at startup with default session parameters specified in the GUI interface.

How do I create test in SimWB?

You create a test via the SimWB control center. In order to create a test, you just specify the RTDB, the optional test scripts and model(s) that are part of the test.

How do I create a test session in SimWB?

Under the SimWB control Center, select the test for which you want to create a test session. Define all the session specific parameters such as scheduler, initial conditions set, data logging,etc, the session name.

A session can also be automatically be created at test startup by selecting auto-create in the session run/playback tab.

How do I log data during a test/session run?

Simply enable data logging when creating the SimWB test session or when starting the test if you use the session auto create mode. The items defined in the RTDB can be marked individually for data logging. The period at which the specific data item is logged can also be specified. The period is specified in milliseconds up to a minimum value corresponding to the frame rate at which the test is run. Additinally, data logging can also be specified in the initial conditions panel in the SimConfig GUI. Data logging of Simlink parameters can be enabled in this panels.

How do I playback a test in SimWB?

A session that was run with data logging enabled can always be played back.
Select the session you want to playback, select the playback mode and run the session.

How do I extract data generated from tests from command line

Commands

You can take advantage of the SimWB supplied command utilities named 'dlxtract' and 'dl2mat'. These utilities are automatically added to system PATH. So, you can execute these commands from anywhere in the RedHawk system to extract data. See here for the documentation.

Example

Let's assume the following:

  • Project name  : 'Simulink'
  • Test name  : 'autotrans'
  • Test session  : 'NewSession'

Then the following command extracts all the data in a MAT file format supported by MATLAB(c)

dl2mat -P Simulink autotrans/NewSession

The following command produces the text data:

dlxtract -p /usr/local/ccursim/projects/__project.Simulink/Tests/autotrans/NewSession/rtdata/ -v autotrans_demo.SWgear

Please note that if you need output from a test in a project other than 'default', you need to provide the complete path like above. Also, you need to specify individual variable names that need to be extracted.

Note: For optimization purposes, we log zeros for the whole set if the data does not change. This means, you may have to do some post processing to get the correct time stamp and data.

SimWB MLToolkit

How does SimWB fit into Model Based Design

Model-Based Design is a process that enables faster, more cost-effective development of dynamic systems, including control systems, signal processing, and communications systems. In Model-Based Design, a system model is at the center of the development process, from requirements development, through design, implementation, and testing. The model is an executable specification that is continually refined throughout the development process. After model development, simulation shows whether the model works correctly.

When software and hardware implementation requirements are included, such as fixed-point and timing behavior, you can automatically generate code for embedded deployment and create test benches for system verification, saving time and avoiding the introduction of manually coded errors.

Model-Based Design allows you to improve efficiency by:

  • Using a common design environment across project teams
  • Linking designs directly to requirements
  • Integrating testing with design to continuously identify and correct errors
  • Refining algorithms through multidomain simulation
  • Automatically generating embedded software code
  • Developing and reusing test suites
  • Automatically generating documentation
  • Reusing designs to deploy systems across multiple processors and hardware targets

The MathWorks is a huge proponent of Model-Based Design and MATLAB and Simulink based tools facilitate in Model-Based Design process. The MLToolkit enables Simulink users to generate code from the models and execute and test the model execution in real-time. SIMulation Workbench is typically used in rapid prototyping, hardware-in-loop testing, and integration testing phases of Model-Based Design.

Simwbmbd.png

Image: SimWB in model based design

For additional details please see SIMulation Workbench Toolkit.

What is the SimWB Toolkit for MATLAB?

Please see SIMulation Workbench Toolkit.

How do I create an RTDB from a Simulink model?

Please see SIMulation_Workbench_Toolkit#RTDB_Creator_Tab

How are subsystem inports and outports handled during SimWB compliant code generation from the MLToolkit?

Inports and Outports are different from other Sources and Sinks in Simulink because they behave differently inside and outside of Simulink subsystems. Subsystem inports and inports have to be connected to other blocks in the subsystem one level higher until we reach the root level (bdroot) of the model. At the root level, inports and outports are indicative of signals external to the Simulink model (i.e they come from the outside world). During SimWB compliant code generation the user can choose the following options:

  • Map using block names
  • Map "SW" prefixed blocks

If the user chooses the first option i.e. Map using block names, inports and outports are picked up only from the root level(bdroot) to be replaced by RTDB variables in the SimWB compliant generated code. All inports and outports within subsystems are ignored and will not be mapped to RTDB variables. If the user chooses the second option i.e. Map "SW" prefixed blocks, inports and outports with the SW prefix are picked up irrespective of which subsystem they are in within the model. For example, lets consider the model shown here.

600px

The SW prefixed inport "SWin1" is picked and replaced by a RTDB variable during SimWB compliant code generation since we are telling RTW that the "SWin1" port data is essentially going to come from an external source. The RTW engine sees this during code generation and infers that the Sine Wave source block is no longer connected to the "SWin1" port for code generation purposes and so the Sine Wave block is optimized out of the generated code. During code generation, you will see a warning which is expected.

Warning: Unconnected output line found on 'testinports/Sine Wave' (output port: 1) 

The following is a snippet of the generated code and we can see that the inport "SWin1" is now mapped to a RTDB variable "in1" which is a part of the the cvtTable structure. There is no mention of the "Sine Wave" block as it has been optimized out during the code generation process.

 /* Model output function */
static void testinports_output(int_T tid)
{
  /* local block i/o variables */
  real_T rtb_SWin1;

  /* M-S-Function: '<S1>/SWin1' */

  /* M-S-Function Block: <S1>/SWin1 */
  rtb_SWin1 = cvtTable.in1 ;

  /* Gain: '<S1>/Gain' */
  testinports_B.Gain = testinports_P.Gain_Gain * rtb_SWin1;

  /* M-S-Function: '<Root>/SWScope' */

  /* M-S-Function Block: <Root>/SWScope */
  cvtTable.Scope = testinports_B.Gain;

  /* tid is required for a uniform function interface.
   * Argument tid is not used in the function. */
  UNUSED_PARAMETER(tid);
}

What is the difference between the configuration RTDB and the shared memory RTDB?

The shared memory RTDB is the RTDB which is loaded by a test loaded in memory on the real-time host. When a test is started, the test loads a configuration RTDB into the shared memory RTDB space and then works on the RTDB in shared memory. If I just re-start the real-time host and perform a rtobj.getSharedMemRTDBName, it returns empty since no test is loaded into memory. If I run a test (which will load the test into memory), the same query returns the RTDB name. Even if I stop the test (it is still loaded into memory), the query will return the same RTDB name. If the test is stopped, I can still get the list of variables using the rtobj.getSharedMemRTDBVarList call but getting and setting the item values makes sense only when a test is running.

The configuration RTDB is loaded into a different memory section of the real-time host and this will be unique for each socket connection to the real-time host. For example, say I create the rtobj object to my real-time host ‘redhawk1’ from MATLAB 9a and I create another rtobj object to the same real-time host ‘redhawk1’ from MATLAB 10a, now I have two unique connections to the same real-time host and I can load and work on two different configuration RTDB’s via the two different sockets. Though both the sockets will be accessing the same shared memory RTDB the configuration RTDB’s may be different. Even in the same version of MATLAB, the SimWB Toolkit GUI and the rtobj API use different sockets to connect to the real-time host. Add to this the SIMulation Workbench Control Center (Java GUI) which has its own socket there may be 3 different configuration RTDBs or 3 different copies of the same RTDB.

How do I connect one model's RTDB variable to another model's RTDB variable?

To connect one models RTDB variable to another models RTDB variable i.e to share RTDB variables between two models the variables must have the same name.

  • For the variables to have the same we must first turn off (uncheck) the Hierarchical RTDB Variable Names checkbox in the SimWB -> Preferences -> RTDB tab. Also, in the same tab turn on (check) the option Append RTDB variables as AIO or DIO. Please refer to the preferences tab documentation for additional information.
  • Create and upload the RTDB from model1. Say variable A is the output of model1 and is also the input for model2. Variable A will be created in the RTDB with point type AO.
  • Create and append the RTDB from model2. Since variable A already exists in the RTDB with type AO and its append with another variable A with type AI, the new point type with be AIO which indicates that the RTDB variable is treated as both input and output.
  • Once we have created and appended the RTDBs from all the models we can start the code generation process for the models.
  • Generate code for model1.
  • Generate code for mode2.
  • Create a test with both models. Make sure you understand the data dependencies between the models. Ideally since the same variable is shared between the 2 models create the test such that model2 runs only after model1 is completed and the variable A is written to by model1.

How do I execute models that have IP protected S-functions in SimWB?

There are two ways to achieve this.

  • Using CoSimulation with Simulink
  • Using Pre-Compiled Library

How do I resolve a missing library error?

If you receive an error regarding a library file not being opened, use one of the following approaches to resolve the issue:

1. Traverse to the model executable folder.

cd /usr/local/ccursim/projects/RTW/model_name

List the libraries used by the model executable.

ldd model_name 

The missing library will be flagged as "not found". Ensure that the executable can access the relevant library and that a subsequent "ldd model_name" shows all libraries are resolved correctly.

2. In the Control Center, create an Environment Variables file, with the following variable/value pair: LD_DEBUG=all cat. Create a new test session that uses this Environment Variables file and run the test session. The "cfgsrv log" pane will contain a verbose output detailing how all the various links are being resolved (or not). Identify the missing library and ensure that it is found in one of the expected locations.

SimWB Models

How do I run models faster or slower than the main frame rate?

In this context , we use frame rate and fixed step (Simulink™ semantics) in the same sense.

Models included as part of a SimWB test are run by default - during the model sub-cycle- at the same rate as the main simulation. This means that the fixed step used for computations in the time domain - Integrator, etc. - is by default the same as the main simulation rate.

  • Model Frequency Multiplier
Remember that during the SimWB simulation loop the synchronous input I/O tasks are run before the model sub cycle and the synchronous I/O tasks are run after the model sub-cycle at the end of the simulation loop. If your model requires a step size that is too small to run the full SimWB simulation loop, we can use the concept of frequency multiplier when adding a model to a test.The multiplier defines how many time the model will be run by SimWB during a single model sub-cycle. By default, this number is 1.
Using a frequency multiplier for a model is thus equivalent to reducing the fixed step size used by the model. So a model that needs a smaller step size than the main simulation loop can be run as part of a slower simulation loop. Obviously, running the model multiple times during a single SimWB model sub-cycle will increase the time required by the model to complete its computation. On the other hand, the results produced by the model may be totaly inaccurate when the fixed step is too large.
  • Example
In this example we created a test that runs 5 instances of the same model. Each model run with a different step size. The simulation loop for the test runs at a basic rate of 0.001 sec. This is a simple example of a bouncing ball dropped from a height of 10 m. The model includes a dampening factor on rebound.
Model instances
1 : step size = 20 us     == 0.001/50
2 : step size = 2 us      == 0.001/500
3 : step size = 1 us      == 0.001/1000
4 : step size = 0.5 us   == 0.001/2000
5 : step size = 0.333 us == 0.001/3000  
Test definition
Simwb-test-multiplier.png
Here we display the ball height over time calculated by the model. You can see that after the first bounce, the calculations start to differ significantly showing the effect of the fixed step used by the model.

Evolution over time of ball height for the 5 running instances.


You can also see that model execution time varies widely, Instance 5 which run 60 times more than instance 1 will obviously require more time for its execution.

Model execution time.

SimWB I/O

Is there a list of I/O boards supported by SimWB ?

Please see Wide selection of COTS I/O boards.

Synchronous versus Asynchronous I/O in SimWB ?

  • Synchronous I/O
Describes the I/O that takes place inside the simulation loop. The board must generate inputs or accepts outputs at the speed of the simulation. In synchronous I/O the simulation loop drives the I/O and the associated hardware devices and O/S drivers must run deterministically so as not to cause overrun in the simulation loop and leave enough idle time for the user model to run inside the loop.
In synchronous I/O, inputs are generated at the beginning of the cycle providing for the user models which run next. The models then generate outputs that are processes by the output I/O tasks during the output sub-cycle at the end of the simulation loop.
Examples of synchronous I/O devices are:
Analog/digital input/outputs
Synchro/Resolver
Relay boards
  • Asynchronous I/O
When a device cannot run at the speed of the simulation loop. It must be processed asynchronously outside of the loop. Asynchronous I/O tasks can receive inputs at any time during the simulation loop on a schedule determined by the device itself. The asynchronous I/O tasks never write to the RTDB directly but update it during the input sub-cycle via a dedicated FIFO and SimWB scheduler sub-process.
Examples of asynchronous I/O devices are:
ARINC 429
AFDX
Serial ports
1553
NETIO

How do I add support for my own hardware board in SimWB ?

Each individual I/O board supported in SimWB is associated with its own I/O task. An I/O task is a process that handles the inputs / outputs from / to the board and writes / reads them to the Real-time DataBase (RTDB).

SimWB provides a mechanism for the user to write their own I/O tasks and still have them run synchronously as part of the simulation loop or asynchronously when the device / I/O board is asynchronous.

Concurrent will provide you with a complete set of synchronous / asynchronous examples upon request. Please, email support@concurrent-rt.com to request the sample code.

At this point there is no provision in the SimConfig GUI to map user defined I/O boards resources to RTDB items.

How does the CAN DBC import parse CAN messages with Little-Endian format

The format of a Little-Endian message definition in CAN DBC file is as follows

BO_ MsgID MsgName  : MsgSize Transmitter
SG_ SigName MuxInd : StartBit|SigSize@ByteOrder ValType (Factor,Offset) [Min|Max] Unit Receiver

Where

  • BO_ - Start of Message definition
  • MsgID - Message ID
  • MsgName - Message Name
  • MsgSize - Message Size
  • Transmitter - Message Transmitter
  • SG_ - Start of Signal definition
  • SigName - Signal Name
  • MuxInd - Multiplexer Indicator
  • StartBit - Signal Starting Bit
  • SigSize - Signal Size
  • ByteOrder - Byte Order (Can be Little-Endian or Big-Endian)
  • ValType - Value Type (Can be + or - indicating signed or unsigned)
  • Factor - Factor
  • Offset - Offset
  • Min - Minimum Value
  • Max - Maximum Value
  • Unit - Signal Unit
  • Receiver - Signal Receiver

Let's take an example

BO_ 0 MessageName: 8 Receiver
 SG_ sig1  : 10|10@1- (0.5,0) [-1|1] "unit1"   Receiver1
 SG_ sig2  : 52|10@1- (1,0)   [-1|1] "unit2"  Receiver1

The signal named 'sig1' is defined to start at bit # 10 and has a length of 10 bits. In CAN DBC file, the convention is to use the Saw Tooth bit pattern. Please take a look at the figure below. In Figure 1, the bits highlighted in blue represent this data. The swapping of bytes is due to the fact that this is Little-Endian format. While Saw Tooth pattern is used DBC file, we use monotone bit pattern in SimWB. Please note that in monotone representation, MSB is always used first. Hence in SimWB CAN I/O mapping, this will show up as 20|10. Similarly, the signal named 'sig2' will be represented in SimWB as 58:10. It means we will be using bits up to 58 in monotone.

CANDBCLittelEndian.png

Figure 1:CAN DBC Little Endian Example

Can I change the value of an AIO/DIO RTDB variable while a test is running?

If an AIO/DIO point is shared between two models, you can only probe/measure the current signal value. The rationale relates to the fact that each model reads from and writes to the CVT table. The upstream model will overwrite any change you make to the shared CVT variable to influence a downstream model.

On the other hand, suppose a point is of the type AIO/DIO, but it is really used as either an AI/DI and is not shared between two models. Here, you can change the value of this variable to influence downstream behaviour.

To better understand the CVT/ALT concept, see this video.

For changing the value of AIO/DIO RTDB variables that are shared between two models, use one of the following workarounds:

  • Insert logic into the upstream model to modify the outputs based on your criteria
  • Use AI/AO or DI/DO pairs between models, with an RTDB-Item Copy pseudo-device connecting the two. That is, create SW_Out_upstream (AO) in the upstream model, and SW_Out_downstream (AI) in the downstream model. In the Control Center, add an RTDB-Item Copy device using the IO Devices tab. Then, map SW_OUT_upstream to SW_OUT_downstream. You can modify the AO/AI signal as needed. For information about the RTDB Item Copy, see this documentation.

SimWB Real-Time Host Files

The default installation directory on the real-time host is /usr/local/ccursim/. SimWB user resources are created/installed under the /usr/local/ccursim/projects/ folder. New SimWB "projects" are also stored under the /usr/local/ccursim/projects/ in their own sub-folder named __project.PROJECT_NAME. The folder hierarchy described below is reproduces as is under the __project.PROJECT_NAME folder when you create a new project.

RTDB

  • One separate folder per RTDB. The folder contains all the files that make up the specific RTDB.

RTW

  • Real Time Workshop™ executables models. One folder per executable. The folder name is the name of the executable.

RTW.Sources

  • Contains the sources of the Simulink™ models. One folder per model. The sources are created via the SimWB MLToolkit under MATLAB/Simulink™

UserExecs

  • Executables for the user models. One folder per executable.

UserSources

  • Sources for the user models. Each model is stored in its own sub-folder under the UserSources folder. The name of the folder is the name of the model. All the source files pertaining to the model should reside in this directory. A default Makefile is provided when creating the user model with the SimConfig GUI. The user can modify the Makefile to suit the hierarchy of the source files. Nevertheless, the result of a make all command should always be to create the executable under the UserExecs/UserModelName/ folder.

Tests

  • One sub folder per test. The sub folder name is the test name. It holds reference to the resources needed to run the test as well as one sub folder for each session run for the test.
Test Sessions

A sub folder under the test folder is created for each test run. This sub folder contains the results of the test run (logging data, log file) as well as the test results.

Script

  • Contains the user test scripts (C,SWM,etc). One sub folder per test script. The sources and executable for the script reside in the sub folder specific to the test script.

Calibration

  • Contains calibration files for the I/O boards used by SimWB. One calibration file per board instance. The file name is the BoardName.x where x is the board instance and BoardName is the name of the board as known under SimWB. I.e. AI64SS.1

SimWB HMI

How to run HMI through command line?

You can use the following command to invoke HMI display directly on Linux

/usr/bin/hmidisplay -user admin -password nimda -host localhost -display audi_dash

In Windows:

cd C:\Concurrent\SimGUI
"jre/bin/java.exe" -jar dist/HmiDisplay.jar -user admin -password nimda -host simwb_host_ip_address -display audi_dash

How can I build custom HMI's in SimWB?

The display builder tool is used to build custom display. It is part of the SimConfig GUI. It can be invoked from the SimConfig toolbar. right

Can I add unicode characters, especially Japanese and Chinese characters to the Text Label in an HMI Display?

Yes, it is possible to embed Unicode characters in any HMI Display text label.

How do I modify the CVT value of a model parameter array element using an HMI Display?

To modify the CVT value of a model parameter array element, use the following steps:

  • Create the following remote function call and save it as /usr/local/ccursim/GUIHooks/lib/guiex.c.
#include <stdio.h>
#include "simrtdb.h"
#include "rtdbutils.h"
#include "simerrors.h"


unsigned char *pCVTTable;
int librarysetup() {
    //fprintf(stderr,"librarysetup\n");
    pCVTTable = (unsigned char*)ccurRTDB_getCVTTableAddress();
    return 0;
}

int myprint(int val) {
    fprintf(stderr,"my val:%d\n",val);
    return 0;
}
int setArrayIndexValue(const char *ptName,double value,int index) {
    RTDBItem *pItem;
    int ret;
    ret = ccurRTDB_getItemAddress(ptName,&pItem);
    if (ret < 0) {
        Log_Error("setArrayIndexValue: Can't find item %s\n",ptName);
        return ret;
    }
    double *arr = (double *)&pCVTTable[pItem->meta.cvtOffset];
    if (index >= 0 && index < pItem->meta.numElements) {
        arr[index] = value;
    } else {
        Log_Error("Array index out of range max == %d\n",pItem->meta.numElements);
        return -1;
    }
    return 0;
}

Also save the following make file as /usr/local/ccursim/GUIHooks/lib/Makefile.

CFLAGS=-I/usr/local/ccursim/include
guiex.so:guiex.o
	    ld -g -shared -o guiex.so guiex.o -L/usr/local/ccursim/lib/  
guiex.o:guiex.c		
	$(CC) $(CFLAGS) -g -fPIC -c guiex.c -o guiex.o
  • Build the function. In /usr/local/ccursim/GUIHooks/lib, call make.
  • Modify the /usr/local/ccursim/GUIHooks/guifunctionlist.txt file to include the following entry:
library=guiex.so,function=setArrayIndexValue(char *,double ,int ) 
  • Restart the SIMulation Workbench configuration server by executing service simwb restart.
  • In the HMI Builder, associate this remote function call with a "User Input"-capable widget, such as a Slider.

SetArrayIndexValue HMI.png

  • In the Function Arguments section:
    • $variablename indicates the parameter associated with the widget.
    • $value indicates the slider numeric value.
    • 0 indicates the index of the parameter array element that is to be modified. Specify this as a value between [0 array_length-1].
  • Map this Slider widget to the relevant parameter in Model Variables pane.

Now, when you run the HMI and change the slider value, the CVT value of the relevant array element will be updated.
For more information, see the following:

  • Remote Function Calls section of HMI Builder Overview
  • /usr/local/ccursim/GUIHooks/lib/README

SimWB Scheduler

How SimWB Scheduler resolves execution order of non-base-rate task dependencies?

When a test contains models/tasks that depend on other tasks and they all run at the base rate, it is easy to schedule. SimWB runs the task that has no dependencies first and then the next one and so on. However, SimWB provides a way to run tasks at multiple of base rate using Frequency Division setting in test configuration. What happens when a test has tasks that do not run on the base rate and has dependencies? What if the tasks that depend on each other has different frequency division settings? Even though one task may depend on another, it is possible that the task it is waiting on may not execute in the current frame. There are multiple ways of solving this issue. What we do is to make the dependency valid on the frame where a given task finishes. not, when the tasks start. This may cause confusion if user assumes a different way of how things should be than how it actually is. Following examples will shed light on the inner workings of SimWB scheduler:

Example 1

See Figure 1 below for the setup of the test for this example. In this test, a fast rate task (ModelC_1 Freq.Div=1) depends on slower task (ModelB_1 Freq.Div=3). In this scenario, both ‘ModelC_1’ and ‘ModelB_1’ will start at the same time at frame 1. However, the task ‘ModelB_1’ started at frame 1 is expected to finish at frame 3. And at the same frame, the task ‘ModelC_1’ is supposed to start. So at frame 3, ‘ModelC_1’ will wait for ‘ModelB_1’ to finish before starting. See Figure 2. This is the way SimWB scheduler is designed.


Sched Execution Order Example1 test setup.png

Figure 1: Example 1 test setup

Sched Execution Order Example1 task execution.png

Figure 2: Task execution for Example 1
Example 2

Consider another scenario. In this test, we have fastest task (ModelC_1 Freq.Div=1) depend on two slower tasks(ModelA_1 Freq.Div=2 and ModelB_1 Freq.Div=3). See Figure 3 for the setup of the test for this example. In this scenario, all the tasks ‘ModelA_1’, ‘ModelB_1’, and ‘ModelC_1’ will start at the same time at frame 1. However at frame 2, the task ‘ModelA_1’ started at frame 1 is expected to finish. In the same frame, ‘ModelC_1’ is supposed to start as well. So at frame 2, ‘ModelC_1’ will wait for ‘ModelA_1’ to finish before starting. Similarly the task ‘ModelB_1’ started at frame 1 is expected to finish at frame 3. And at the same frame 3, the task ‘ModelC_1’ is supposed to start. So at frame 3, ‘ModelC_1’ will wait for ‘ModelB_1’ to finish before starting. The frame 6 is the interesting case. The task ‘ModelA_1’ started at frame 5 and the task ‘ModelB_1’ started at frame 4 are expected to finish at this frame. At the same time ‘ModelC_1’ is also expected to start. According to the test setup, the task ‘ModelC_1’ should wait for both ‘‘ModelA_1’ and ‘ModelB_1’. So in this frame 6, ‘ModelC_1’ will wait for whichever task that finfishes last. See Figure 4.

Sched Execution Order Example2 test setup.png

Figure 3: Example 2 test setup

Sched Execution Order Example2 task execution.png

Figure 4: Task execution for Example 2

Using SimWB with Third Party Products

How do I use a Dymola generated FMU file in SimWB

It is possible to use any FMU files with SimWB. To do so, the FMU file needs to have a binary for Linux. If the SimWB server is 64-bit, we need Linux 64-bit binary and if the SimWB server is 32-bit, we need Linux 32-bit binary. But, Dymola currently works only Windows. So it cannot generate Linux binaries. However, we can recompile the FMU sources easily and use it in SimWB. Please see the section 'Importing FMU From Dymola' for detailed explanation of recommended workflow.

I/My vendor do not have access to RedHawk. How do I compile the FMU for use in SimWB?

It is possible that your vendor or yourself may not have access to a system that has RedHawk. In this case, you can download the Virtual Machine (VM) that Concurrent provides and send this to the customer. This VM comes with a script that will automatically build the FMU for SimWB if the sources are available. The following modeling tools are currently supported:

  • Dymola 2016 (FMI 1.0 & FMI 2.0 CoSimulation)
  • Dymola 2015 (FMI 1.0 CoSimulation)
  • MapleSim 2016 (FMI 1.0 & FMI 2.0 CoSimulation)

You will need Oracle VirtualBox to run this VM. Please use this link to download the VM.

How do I use rFpro with SimWB

Please refer to RFpro Configuration for detailed explanation of setting up rFpro to talk to SimWB.

Why do I see a GLIBC error when I try to run an FMU in SimWB

The GLIBC error is due to the fact that the binary in the FMU was created in a system with newer GLIBC than the SimWB system. And like sharing any other pre-compiled binaries between Linux systems, you need to make sure that GLIBC of the system where you compile the FMU is same or older than the system where it is consumed. I.e the SimWB system. If the FMU contains source, we automatically compile to create a binary if the FMU is generated from one of the supported tools like Dymola, MapleSim, or SimulationX. However if the source cannot be shared, they will have to regenerate the FMU from a system with GLIBC that is same or older than the SimWB system. This issue is not specific to SimWB and exists whenever you share binaries between Linux system. To ameliorate this situation, we also provide a Virtual Machine (VM) that runs a compatible RedHawk (without real-time capabilities). If you generate FMU from this VM, it will run on RedHawk systems 6.3 or later. This VM is free to download and free to share to your vendors. This can be downloaded from license.simwb.com. Please look for the ‘Download RedHawk VM’ link on the left when you login.

Configuring Senso Wheels and Pedals

Please see the section 'Configuring Senso Wheel and Pedals' for detailed explanation.

Installing Simpack 2021 in RedHawk 7.x

Simpack 2021 depends on certain packages that are not installed by default in RedHawk. To workaround this, please enable CentOS/RedHat Base & Extra repositories and install the following packages:

  • yum install freetype freetype-devel libxkbcommon libxkbcommon-x11

Troubleshooting

Why am I unable to view the debugger(kdbg) display when debugging a User or I/O task in SimWB?

The following discussion applies to all releases before SimWB 7.0-0.

In RedHawk 7.0+

  • Edit /etc/gdm/custom.conf. Directly below the [security] section, add the following lines:
  AllowRemoteRoot=true
  DisallowTCP=false
  • Reboot the system.
  • Run the command xhost + in a terminal window running under the X server to disable access control to X server.

In RedHawk 6.0-6.4

  • As part of IT security procedures, DisallowTCP is set to True in /etc/gdm/gdm.schemas which prevents kdbg from starting when the debug option is checked in SimWB. The option should be set to false as shown below. You will have to logout of X and log back in for the setting to take effect.
    <schema>
      <key>security/DisallowTCP</key>
      <signature>b</signature>
      <default>false</default>
    </schema>
  • Run the command xhost + in a terminal window running under the X server to disable access control to X server.

Performing the above steps should enable you to view the kdbg display when debugging a User or I/O task in SimWB.

Before RedHawk 6.0

  • As part of IT security procedures, DisallowTCP=true is set in /etc/gdm/custom.conf which prevents kdbg from starting when the debug option is checked in SimWB. The option should be set to false, DisallowTCP=false. You will have to logout of X and log back in for the setting to take effect.
  • Run the command xhost + in a terminal window running under the X server to disable access control to X server.

Performing the above steps should enable you to view the kdbg display when debugging a User or I/O task in SimWB.

How do I debug my source code in SimWB using the GUI?

Videoicon.jpgDebugging source code under SimWB

SimWB provides the ability to debug models using KDbg. The following steps are needed to start the debugger from SimWB.

  1. First re-make the code with the –g flag. This is done by modifying the make file in the source code folder on the real-time host. This should be the default when generating the code from the SimWB MLToolkit.For example:
    1. Go to "/usr/local/ccursim/projects/RTW.Sources/modelname_ccurt/modelname_ccurt" folder where "modelname" is the name of the model.
    2. Edit the "modelname.mk" file
    3. In the General User Options add the –g flag. Approximately line 153 in the model Makefile file should now read OPTS = -g
    4. Use the commands "make –f modelname.mk clean" and "make –f modelname.mk" to remake the model.
  2. In the SimConfig GUI, go the test/session tab and select the test/session you want to run.
  3. Go to the Debug Options tab and make sure the Debug Selected Tasks checkbox is checked, the list of models in your test should appear in the list. Select the model you want to debug.
  4. Go back to the Run/Playback tab and click the Run button.
  5. The KDbg GUI will open and stop in the ccurrt_mainC.c file for this model. If the debugger stops in the schedutils.c task it is an indication that you need to remake the source with the –g file.
  6. If the debugger window does not open, look in the cfgsrv.log - under the cfgsrv tab in the message window. There will be a system message that indicates why SimWB could not open the debugger window in your X server. Refer to the step above on how to allow remote connection to your X server.
  7. Now you can place break points in the source code to debug the model. The model is called by the rt_OneStep() function.

Why do I receive license not available error even when I do have license?

For SimWB release 7.0-0 and above, SimWB uses OLicense as the licensing engine. OLicense uses the unique system Machine ID to validate the licenses. You may get license errors when

  1. The OLicense Server daemon is not running. You can run ps ax | grep -i "olicenseserver.lin" to check if the daemon is running. To restart the OLicense Server, run service OLicenseServer restart as root.
  2. System Machine ID does not match in the imported license file. Run /usr/local/ccursim/bin/machineID as root to get the machine ID of your system. Open the browser and type localhost:port (OLicense Server listening port number is defined in /opt/Optimum/OLicenseServer/olicenseserver.ini. By default, SimWB set it 9012.) and click "View Licenses" on the page, compare the Machine ID in hosts field with what you get from command line to see if they match. If not, please contact Concurrent support at support@concurrent-rt.com.
  3. There is no entry for hostname in /etc/hosts. Suppose the IP address of the machine named 'ihawk' is 192.168.0.2, then /etc/hosts should contain '192.168.0.2 ihawk'.

For SimWB release before 7.0-0, SimWB uses the NightStar License Manager ('nslm') service to handle the licenses. The NSLM uses the unique system ID to validate the licenses. This system ID depends on MAC address among other things such as hard disk ID etc. When SimWB host (/usr/local/ccursim/bin/cfgsrv.sh) starts up it requests a license from the 'nslm' daemon and proceeds. You may get license errors when

  1. The nslm daemon is not running. You can restart it by running 'service nslm restart' as root.
  2. There is no license or the license does not correspond the host ID. This might happen if you have reinstalled the OS since the license was issued. In this case, you will need your license to be reissued by Concurrent. This could also happen if have removed network interfaces from your system of if you have activated a different one.
  3. There is no entry for localhost in /etc/hosts. It should always point to 127.0.0.1 and not the actual IP address of the machine (127.0.0.1 localhost).
  4. There is no entry for machine name in /etc/hosts. Suppose the IP address of the machine named 'ihawk' is 192.168.0.2, then /etc/hosts should contain '192.168.0.2 ihawk'.
  5. The machine is using another Ethernet card than it was configured. In other words, if the license id generated with say 'eth0' and if you are using 'eth1' with 'eth0' down, then licensing will fail. To workaround this, please assign a static IP address to 'eth0' and restart both network and nslm (service network restart; service nslm restart).

How do I use the license file for SimWB 7.0-0 and after?

If you are installing SimWB via DVD or ISO, please download the attached license file to your real-time host and browse to that location in the installer GUI to complete the installation. If you are renewing your SimWB licensed modules, please download the attached license file and import it using the SimWB license import tool or using the OLicense web front-end. From the command line enter:

/usr/local/ccursim/bin/ccursimwb_license -i path_to_license_file

Or enter "localhost:port" in your browser and import the license file from there. NOTE: You can find the port in /opt/Optimum/OLicenserServer/olicenseserver.ini. Look for the "server listening port" line. Once the license is loaded, you must restart SimWB. From the command line enter:

service simwb restart

To view or manage your SimWB licenses, including licensed modules, license expiration date, etc., from the command line enter:

/usr/local/ccursim/bin/ccursimwb_license -l 

Or go to "localhost:port" in your browser (see the NOTE above on finding the port) and click "View Licenses" to check your license information or click "Administer Licenses" to manage your licenses.

Retrieved from "https://wiki.simwb.com/swbwiki/index.php?title=FAQ&oldid=2113"
  • Privacy policy
  • About SIMulation Workbench
  • Disclaimers
  • Log in
  • Powered by MediaWiki Powered by BootStrapSkin

SIMulation Workbench © All Rights Reserved