NI VeriStand Add-Ons Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Example: Python Scripts for ASAM XIL API

Overview

These Python examples use the ASAM XIL API to read and write to channels, capture and save channel value data to an MDF4 file, and configure stimulus signals with a running NI VeriStand system. These scripts reference the Engine Demo example project. 

 

These examples are based on the ASAM XIL C# Examples that are included in the NI VeriStand Help and have similar functionality to those examples. 

 

Hardware and Software Requirements

NI VeriStand 2015 SP1 or compatible

Python 3.6 (32-bit)

Python for .NET 2.3

 

Note: You must use 32-bit Python to interact with VeriStand.

 

Steps to Implement or Execute Code

  1. Install NI VeriStand 
  2. Install Python 3.6 (32-bit)
  3. Install Python for .NET
    1. Download a Win32 whl file (pythonnet-2.3.0-cp36-cp36m-win32.whl)
    2. Run: pip install pythonnet-2.3.0-cp36-cp36m-win32.whl
    3. Invoke python
    4. Test. "import clr" should execute.
  4. Run an example script.

To run in versions earlier than NI VeriStand 2018 update the NI VeriStand ASAM XIL Interface in each script for your version of the software. For example, in NI VeriStand 2016 you would want to set the interface to "NI VeriStand 2016 ASAM XIL Interface" and the version to "16.0.0". For NI VeriStand 2017, you would want to set the interface to "NI VeriStand 2017 ASAM XIL Interface" and the version to "17.0.0".

 

For NI VeriStand 2018, only the version number needs to be changed. The interface should be set to "NI VeriStand ASAM XIL Interface" and the version to "2018.0.0".

 

Additional Information or References

 

 Accessing the NI VeriStand ASAM XIL Interface

C# Walkthrough: Using the Model Access Port to Read and Write Channel Values

C# Walkthrough: Configuring and Executing Stimulus Signals

C# Walkthrough: Capturing and Logging Channel Values

Python for .NET Hompage

 

Support

 

This is provided as open-source software. If it does not meet your exact specification, you are encouraged to modify the source code  to meet your needs. It is not officially supported by National  Instruments.

 

National  Instruments does not support this code or guarantee its quality in any  way. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH  IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

Comments
Echomo
Member
Member
on

It seems there is no available packages of ASAM.XIL and System in package  and error as following . Could you so nice to tell me where I could download these packages as following?

 

What is your means Import necessary .NET constructs ?

 

# Import necessary .NET constructs
from System.Collections.Generic import Dictionary
from System.Collections.Generic import List

# Import functions from the reference assemblies in the directory above
import ASAM.XIL.Interfaces.Testbench
import ASAM.XIL.Implementation.TestbenchFactory.Testbench
from ASAM.XIL.Implementation.TestbenchFactory.Testbench import TestbenchFactory

 

Contributors