CarMaker™ Models

This panel allows you to configure an existing CarMaker™ models so that it will run n a SimWB test.

This will only run under the 64 bit version of RedHawk/SIMulation Workbench.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Configuration Work flow

The typical work flow is as explained below:

Several things need to be configured before end before you can integrate an existing CarMaker model into SimWB.

  1. Create a SimWB instance of the CarMaker model by entering its name in the field in the tool bar and click on the button with the folder + icon.
    If you want to edit an existing SimWB instance just click on the model name in left most panel containing the list of CarMaker models.

     

  2. Specify the folder where your CarMaker model resides on the SimWB system. This is the folder where you have saved your project under the CarMaker GUI front-end.
    This folder typically contains the following sub folders :
     Data            
     Movie           
     Plugins         
     SimInput        
     SimOutput       
     bin             
     doc             
     include         
     lib             
     src             
     src_cm4sl       
     
    Click on the Browse button the right to navigate to the location of your CarMaker project on the SimWB system.

     

  3. Now, you need to configure the data exchange between the CarMaker environment and the SimWB RTDB. To do this we associate variables known in the CarMaker model to SimWB variables that will be created in the RTDB associated with this model.
    In SimWB a RTDB item always has a direction associated with it. I.e. it is either an input or an output.
    In this instance an input item will provide for data values to be set into the CarMaker model; an output item will be computed by the CarMaker model and set into the SimWB RTDB.
    The list of available CarMaker variables is shown in the corresponding list box.
    Drag and drop the variable or tree branch from the CarMaker list to either the inputs/outputs list to the right.
    Dropping in the inputs list means the value of that CarMaker variable will be SET in CarMaker from the value of the corresponding SimWB variable.
    Conversely, dropping in the outputs list means the associated SimWB item's value will be SET from the value of the corresponding CarMaker calculated value.
    Note that the same CarMaker variable cannot be dropped in both the inputs and outputs list. This is a contradiction and is not allowed.

     

  4. Once the list of items in the RTDB has been defined, we can create the SimWB RTDB that contains those variables.
    You can either append/modify an existing RTDB by selecting it from the combo box or create a new one by checking the new RTDB checkbox.
    When clicking on the Generate RTDB button , you will be presented with a dialog to enter the name of the new RTDB.
    Warning : Entering the name of an existing RTDB when hew new RTDB checkbox is checked will overwrite the RTDB.

     

  5. Optionally, you can also pass parameters to the SimWB CarMaker executable.
    1. Use the parameter 'display' to set the DISPLAY variable. This display will be used to open the CarMaker GUI. For Example display=:0.1
    2. Use the parameter 'cpus' to set the cpus that CarMaker GUI will need to use. This can be comma separated or separated by '-'. For Example cpus=0,2-4,6
    3. Use the parameter 'home' to set the HOME variable. This will be passed to CarMaker GUI. For Example home=/home/praveen
    4. Use the parameter 'user' to set the user that will run the CarMaker GUI. This is useful if the CarMaker is licensed to a particular user. Also, make sure to set the correct HOME variable. For Example user=praveen

     

  6. After creating a SimWB instance for the CarMaker model, the Create CarMaker Model button should be enabled. Click on the button to create the SimWB model.
    This will copy the src folder from the selected CarMaker project directory to the projects/CarMaker/<model_name>/ folder. The CM_Main.c file will be edited to comment out the main() function in the file so that it can be replaced by the specific SimWB CarMaker main() function.
    The source code will be compiled to produce the model executable. The model executable is always called CarMaker.linux64 and resides in the projects/CarMaker/<model_name>/ folder.
    The Create CarMaker Model button will remain selected until the rebuild process is done. Once the rebuild is done, click on the Model build output link to view the output of the build process as shown in the image to the right.
    You can always recreate the CarMaker model by clicking on the button independent of other modification you have made to the configuration for the selected model.

Folder Structure

The CarMaker SimWB model instances are stored on the SimWB host under the CarMaker/<model_name> folder in the corresponding project folder.
If you are working under SimWB project CM, the CarMaker models will be stored in the
/usr/local/ccursim/projects/__projects.CM/CarMaker folder.
All the configuration pertaining to this model instance - such as the association between CarMaker variables and SimWB inputs and outputs variables - is saved in that folder.

SimWB Test Creation

Now that you have create a CarMaker model instance for SimWB, you can create a test. Go to the test panel and create a test as usual.
When you right click in the model pane, the list of available models will pop-up. As shown on the image to the right, there will now be an entry corresponding to the CarModel instance you just created.

 

 

 

 

 

 

 

 

 

 

Running a CarMaker Scenario

1. When you run CarMaker model under SimWB, SimWB scheduler starts the CarMaker.linux64 executable (CarMaker Model) and the this running executable will need to talk to CarMaker GUI to exchange data. This means the CarMaker GUI needs to be started by SimWB as well.
2. Before running the CarMaker model under SimWB, please start CarMaker GUI as the correct user (root if you don't specify anyone or the user specified via 'user' parameter) After opening CarMaker GUI, select the project that you want to run under SimWB. Once the project is loaded, run the test run you want to run in simulation mode as well. This step is needed because there is no way of remotely changing the project folder in CarMaker.
3. Now you can switch back to SimWB Control Center. The test run scenario should be under the CarMaker project folder you selected in this panel and under the Data/TestRun/ folder. The same CarMaker model can be used to run many different scenarios, therefore the scenario to use under SimWB is specified not at the test level but within a specific session for the selected test. When you create a new session for a test that include a CarMaker model, you must specify the scenario in the Session User Parameter in the session panel. This is a combo box that remembers previous entries specified and should also list the available scenarios for the associated model used in the test.

CarMaker GUI and SimWB Test Run

Because of the peculiarities of the CarMaker front-end, it is not possible to load a specific project and scenario in the CarMaker GUI and at the same time have the front-end connect to a user specified CarMaker.linux64 (the SimWB instance in this case) executable.
Hence, when running a SimWB test that includes a CarMaker model, SimWB will start an instance of the HIL.exe executable on the specific TCP port that the SimWB model can connect to. This instance is restarted every time the test is run.
In order to launch the CarMaker HIL.exe, SimWB needs to know the location for the CarMaker installation. The default location is the /opt/ipg/hil/linux folder. If your CarMaker is installed in a non-standard folder you can specify that folder by editing the /etc/ccursim.conf main configuration file and add the following line where PATH_TO_CARMAKER_INSTALLATION is the location where the GUI folder resides:

  carmakerinsdir=<PATH_TO_CARMAKER_INSTALLATION>
 

Corner Controls

Help help00028.png

Opens this section of the manual.