Integrating Ansys SCADE Model in NI Linux RT Using NI VeriStand

Updated Oct 5, 2023

Environment

Hardware

  • PXIe-8881
  • PXIe-1092

Software

  • VeriStand 2023 Q3
  • VeriStand Model Framework

Driver

  • NI Linux Device Drivers 2023 Q3
  • PXI Platform Services

Operating System

  • Linux

System

  • HIL Simulator

Other

This article focuses on steps to integrate Ansys SCADE models in NI Linux Real-Time targets using NI VeriStand for model-based testing applications. For the early stages of control loop model-based testing, the Flight Control example of Ansys SCADE is configured & complied for NI Linux Real-Time to be deployed in HIL systems to verify the feasibility of the design. The outcome of this article is to demonstrate the enhanced workflow of deploying Ansys SCADE models in NI Linux Real-Time targets using NI VeriStand. The intended audiences are users who work closely with model-based testing, model-in-loop, and hardware-in-loop validation testing.

Pre Requisite Knowledge Required:

  1. NI VeriStand Model Integration
  2. Ansys SCADE Suite Model Development
  3. GNU C & C++ Compile Tools x64 download page: Before using the below extension, install this package.
  4. Ansys SCADE NI Linux RT Model Generator Extension: This extension depends on Windows environment variables that are set up by the batch file included in the NI GNU C&C++ Compiler package.

Installation of SCADE NI Linux RT Model Generator Extension

  1. Extract the SCADE NI Linux RT Model Generator Extension.7z package from the attachment section in a temporary folder and double-click “installer.js” to install the extension in the windows development PC where Ansys SCADE software is installed.
1.JPG​​​
  1. When the installation is completed successfully, the following message is displayed.
12.JPG

Generate .so File from SCADE Models

  1. Open Ansys SCADE 2023 R2 software installed in the host PC & click on Learn More under the SCADE Suite block.step1
  2. Click Direct Access to SCADE Suite Examples under the Examples.step2
  3. Click Open Flight Control Project under the Flight Control example to open the Flight Control project.step3
  4. Select the root operator in the tree and specify periodicity in the Code Integration properties.step4
  5. Create a dedicated configuration named VeriStand if switching configurations back and forth is required during development (Recommended).step5
  6. Click on Setting and open the KCG configuration and select the NI VeriStand as the target in the Code Integration tab & check the box NI Linux RT under Other extensions. Note this option will only appear once the NI Linux RT Model Generator Extension is installed in the host PC.
step6
  1. Switch to the NI Linux RT tab and browse for the batch file "environment-setup-core2-64-nilrt-linux.bat" in the NI GNU C&C++ Compiler package downloaded.
step7step7_1
  1. Click OK.
  2. Click the Build button to build the .so binary file.
step9
  1. In the Ansys SCADE Output window, under NI Linux RT Generator Generated files, verify the model's .so file is created.step10

Deploy Generated .so file in NI VeriStand

  1. In the SCADE Output window, right-click on the generated .so file and select show in folder. This will open the file path where the binaries are located.1
  2. Copy the generated .so file to the VeriStand Project folder.
  3. Open NI VeriStand 2023 Q3 and create a new project.
  4. Open the System Explorer & configure the System Definition File to connect to PXI Linux RT OS.
  5. Add the generated SCADE Model by clicking Simulation Model>> Add Simulation Model.2
  6. Save the System Definition File.
  7. Deploy the VeriStand Project.

After following the steps mentioned in the article, the user is able to compile the Ansys SCADE model for NI Linux RT using NI VeriStand. The results in the VeriStand Screen are similar to the simulation results thus verifying the model logic is working as expected in a real-time scenario.
Result