Creating Real-Time Stimulus Profiles in NI VeriStand

概要

NI VeriStand provides an advanced stimulus profile tool for creating real-time test sequences. In addition to step-based profiles, you can create complex real-time stimulus profiles that include decision making, subsequences, and a variety of programming constructs. These elements combine to offer a flexible environment for conducting real-time tests. This paper introduces both the NI VeriStand Stimulus Profile Editor environment and some of the functionality that is commonly used when creating real-time stimulus profiles.

Contents

Introduction to the NI VeriStand Stimulus Profile Editor

NI VeriStand刺激プロファイルエディタの概要

NI VeriStand刺激プロファイルエディタは、NI VeriStandの外部で開いて設定できるソフトウェアです。そのため、NI VeriStandのシステム定義とユーザインタフェースを使用しながら、同時にテストプロファイルを作成することができます。NI VeriStand刺激プロファイルエディタは、リアルタイムシーケンスと刺激プロファイルという2つのメインコンポーネントで構成されています。コンポーネントが分かれているため、再利用が非常に容易なテストシーケンスを実現しながら、個別のテスト用のNI VeriStandシステム定義と強固に統合することができます。

リアルタイムシーケンス

リアルタイム刺激プロファイルのメインコンポーネントの1つが、リアルタイムシーケンスです。テストシーケンスはNI VeriStandリアルタイムエンジンにデプロイされ、さまざまなプログラミング構造を適用することができます。Whileループ、Forループ、変数、条件付き宣言などの機能に対応します。さらに、テストシーケンス内にサブシーケンスを作成してマルチタスクを導入することもできます。 

Primitives.PNG

図1.NI VeriStand刺激プロファイルエディタのプログラミング構造の概要

リアルタイムシーケンスでは、ループや条件付き宣言などのプログラミング構造に加えて、正弦波やノコギリ波などの一般的な波形を生成することができます。 さらに、数学関数や数式を使用して、さらに複雑な波形や信号も生成できます。 

 図2.使用可能なシーケンスと数式

リアルタイムテストシーケンスは、セットアップ、メイン、クリーンアップの3つのセクションで構成されます。セットアップは、シーケンス内の初期状態の設定に使用されます。 多くの場合、変数を目的の初期状態に設定したり、いくつかの予備的なシステム計測を実施したりすることがあります。 メインセクションは、大部分の刺激が生成されるセクションであり、固有のテストはここで実行されます。 メインテストが実行された後でクリーンアップが実行され、今後のテストに備えてテストシステムが既知の状態に設定されます。

図3.リアルタイムシーケンスの例

 

刺激プロファイル

2番目のコンポーネントは、刺激プロファイル自体です。刺激プロファイルは、リアルタイムテストシーケンスの呼び出し、NI VeriStandプロジェクトのオープン/クローズ、データロギング、合格/不合格の判定を実行できるテストエグゼクティブとして機能します。また、リアルタイムテストシーケンスをシステム定義に関連付けて、システム定義に含まれるチャンネルデータをリアルタイムテストシーケンス内の変数にバインドすることも可能です。刺激プロファイルエディタを使用したNI VeriStandプロジェクトの制御方法の詳細については、VeriStandリアルタイム刺激プロファイルの作成に関するビデオをご覧ください

リアルタイムテストシーケンスと同様に、刺激プロファイルにもセットアップ、メイン、クリーンアップの各セクションが含まれます。刺激プロファイルでは一般的に、セットアップとクリーンアップのセクションを使用してデータロギングやNI VeriStandプロジェクトを開いたり閉じたりするなどのタスクを実行します。これによりテストが自動化され、NI VeriStandワークスペースを手動で操作することなく、別の種類のテストに移行することが可能になります。 

刺激プロファイルのメインセクションを使用して、リアルタイムテストシーケンスを呼び出すことがよくあります。複数のリアルタイムシーケンスを呼び出せるため、シーケンスを手動で切り替えなくても複数のテストを実行できます。リアルタイムシーケンスが刺激プロファイルから分離されるため、シーケンスのライブラリを作成して、それを複数のプロファイルで使用し、複数のテストステーションで共有することができます。図4では、データロギングと一連のリアルタイムテストシーケンスの呼び出しを含む刺激プロファイルの例を示しています。

図4:刺激プロファイルの例

プロファイルを作成した後、選択したシステム定義に基づいて、それをリアルタイムターゲットにデプロイできます。このプロファイルはそのリアルタイムターゲットで実行されます。Windowsホストコンピュータのプロファイルウィンドウに、プロファイルの現在の状態が表示されます。その後、選択したファイルパスにログが保存されます。 

刺激プロファイルエディタは、リアルタイムシーケンスのデプロイだけでなく、テストオートメーションを実行する場合にも使用できます。こうしたテストオートメーションは、CSVファイルに保存されたデータの再生、またはユーザがNI VeriStandのマクロ記録ツールで作成したマクロの再生によって実行されます。

関連情報

NI VeriStandチュートリアルビデオを見る

NI VeriStand刺激プロファイルエディタのチュートリアルを読む

NI VeriStandトレーニングコースでリアルタイム刺激プロファイルの作成方法を学習する

Real-Time Sequences

One of the main components of real-time stimulus profiles is the real-time sequence. Test sequences are deployed to the NI VeriStand Real-Time Engine and can feature a wide array of programming constructs. The functions include While Loops, For Loops, variables, and conditional statements. You can also create subsequences and establish multitasking within your test sequence. 

Primitives.PNG

Figure 1. An Outline of Programming Constructs of the NI VeriStand Stimulus Profile Editor

In addition to programming constructs such as looping and conditionals, real-time sequences can generate commonly used waveforms such as sine waves and sawtooth waves. You can also create more complex waveforms and signals by using mathematical functions and expressions. 

 Figure 2. Available Sequences and Mathematical Expressions

A real-time test sequence is broken into three sections: Setup, Main, and Cleanup. Setup is used for establishing initial conditions within a sequence. Most often this includes setting variables to desired initial states or taking some preliminary system measurements. The Main section is where the majority of the stimulus is generated and where specific tests are conducted. After the main tests have run, Cleanup runs to put the test system in a known state for future tests.

Figure 3. An Example of a Real-Time Sequence

 

Stimulus Profiles

The second component is the stimulus profile itself. The stimulus profile acts as a test executive that can call real-time test sequences, open and close NI VeriStand projects, and perform data-logging and pass/fail analysis. It also connects real-time test sequences to system definitions to bind channel data within the system definition to variables in the real-time test sequence. To learn more about using the Stimulus Profile Editor to control an NI VeriStand project, watch our video about creating VeriStand real-time stimulus profiles.

Much like real-time test sequences, stimulus profiles contain Setup, Main, and Cleanup sections. In the case of stimulus profiles, Setup and Cleanup are often used to perform tasks such as data logging and opening and closing NI VeriStand projects. This enables test automation and helps you transition from one type of test to another without having to manually interact with the NI VeriStand workspace. 

The Main section of the stimulus profile is often used to call real-time test sequences. It can call multiple real-time sequences, so you can run multiple tests without having to manually switch from sequence to sequence. With the division of real-time sequences from stimulus profiles, you can create libraries of sequences that can be used across multiple profiles and shared among multiple test stations. Figure 4 shows an example of a stimulus profile that includes logging data and calling a series of real-time test sequences.

Figure 4. An Example Stimulus Profile

Once you have created a profile, you can deploy it to a real-time target based on the system definition that you have chosen. This profile is then run on the real-time target, and the current state of the profile is displayed in the profile window on the Windows host computer. Logs are then stored in the selected file path. 

In addition to deploying real-time sequences, the Stimulus Profile Editor can be used to perform test automation by replaying data stored in CSV files or by playing back user-constructed macros that were built using the NI VeriStand Macro Recording Tool.

Demonstration of Adding Real-Time Hardware I/O Interfaces to NI VeriStand

Learn how to create and configure real-time testing applications using VeriStand for high-speed data acquisition, automotive networks, and FPGA-based reconfigurable I/O. This video includes a hardware overview as well as an introduction to creating a VeriStand project. You will learn how to use the System Configuration File to import devices, networks, custom plug-in code, and more. Additionally, the video teaches you how to add and customize DAQ channels for high-speed waveform or single-point input and how to create or import measurement scales.