Quantcast
Channel: All NI TestStand posts
Viewing all 24424 articles
Browse latest View live

Re: Abort sequence and jump back to calling sequence


Re: command line options / API Support to launch the sequence file

$
0
0

Hi Yash/Jack/VJ,

 

Is there any way to transfer Pass/Fail status of sequence execution that we get on console by using \OutputToStdIO command into a txt file ?

 

I tried the general way of storing any command result into text file that is > C:\Desktop\result.txt. the text file is updating every time but it is completely empty.

 

Could you please let me know if there is any way to do it ?

 

Thanks,

PV

Re: Abort sequence and jump back to calling sequence

$
0
0

The steps in Cleanup run always despite sequence execution was terminated or not. However I remember a way of configuring it from station settings to skip cleanup upon abort. I'm curious why you want to have such option in subsequences? 

Guidance on running Sequential Model from custom UI

$
0
0

Hi,

 

TestStand 2019 64 bit running with a C# UI.

 

I have a custom Sequential Model and Test Sequence. I am running from a C# UI built into an executable.

 

On start the loads the Test Sequence file ( which loads it wanted Model file) and automatically starts using the TestUUT entry point, the Model does test station hardware initialisation in the DoPreUUT stage and shall tear down the hardware configuration as needed in the DoPostUUT stage. This is working as expected and at the start of the TestUUT for loop pops up my C# code to serial number and other info, and at the end pops up a box to say nextUUT or terminate.

 

However what I would really like to happen is that after hardware initialisation at the start of the For Loop, I want to pause / halt the sequence flow and control the For Loop from a UI front panel button.

 

if Somebody could point me in the correct direction to control the sequence in this way I would be grateful. I had thought about using Breakpoints but that seems just wrong, I had looked at different entry point but I think try that would just start new instances of the same sequence from a different place.

 

cheers

 

Danny

Building a Test Stand UI with Native Controls using .Net - Example not working

$
0
0

Hi team,

 

I am very very new to NI and C#. Please advice what should I do to make the

 

C:\Users\Public\Documents\National Instruments\TestStand 2019 (64-bit)\Examples\Modifying User Interfaces\Building a TestStand UI with Native Controls\DotNet

 

work in Visual Studio Code

 

Error Message:

Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
C:\Program Files\dotnet\sdk\5.0.101\Microsoft.Common.CurrentVersion.targets(1180,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [C:\Users\ngupta\DotNet\TestStand UI with Native Controls.csproj]

 

Version:

.NET SDK

.NET SDK (reflecting any global.json):
Version: 5.0.101
Commit: d05174dc5a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.101\

Host (useful for support):
Version: 5.0.1
Commit: b02e13abab

.NET SDKs installed:
5.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

 

 

Visual Studio Code

Version: 1.52.1 (system setup)
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:34:46.910Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.18363

TestStand does not import Python libraries and functions every time the script is called

$
0
0

Hello all,

 

I am quite new to NI TestStand and I would appreciate it if someone could help me out with this issue I'm facing.

I am currently using NI TestStand 2020 for my project which requires me to load a Python script. My Python script has a few modules and functions that I am importing from other Python scripts (used in the format "from abcd import xyz"). However, I notice that TestStand loads all these modules only once when I first load the Python script, or, upon restart of TestStand. It does not import all the modules and functions separately every time the Python script is called from TestStand. To throw more context, I have different steps in a TestStand sequence where I am calling the same Python script. I would like TestStand to import all the Python modules and functions in each step and in every loop (if the same test is performed repeatedly).

Since I am using a newer version of TestStand, I am calling the Python script using the inbuilt Python Adapter.

 

Thanks.

How to remove "Interactive Execution #: " line from report ?

$
0
0

000.png111.png

 

Don't want to show this line

 

Thanks.

Re: Access Locals.x from offline processing


Add elements of variable containers with Teststand API

$
0
0

hello everyone

I use TestStand to call veristad for data acquisition, and use LabVIEW to call TestStand API function to generate test sequence. In the circle drawing step, I click the plus sign variable container to automatically add a group of variables.like VariableName,VariableUnit......;I want to know how to add elements of variable containers with TestStand API functions.

If you have any way for me how to do this, i will be grateful to you.

 

Best regards,2.png3.png

Dynamic dispatch Namespace error

Re: Building a Test Stand UI with Native Controls using .Net - Example not working

$
0
0

These examples were written for Visual Studio - not Visual Studio Code. Try it with Visual Studio Pro, Enterprise, or Community.

 

Hope this helps!

Trent

Get Code Module Adapter Parameters

$
0
0

I've noticed something similar to this has been asked before in the forum over the years, but I can't seem to find the answer I'm looking for.

 

When you add a CVI code module and select the DLL for the module, TestStand will display a list of function names.  When you select one of the functions, the arguments of the function will be displayed in the parameter list.

 

I'm trying to understand what TestStand API call is made to find this information.  I want to call this from .NET, so I'm assuming there is a specific TestStand API call (from Engine, Sequence, etc.) to get this info on demand.

 

Thanks in advance.

Re: Get Code Module Adapter Parameters

$
0
0

Module.LoadPrototype is what I needed. Appears the method will only add with number of parameters or data types do not match.

 

Not sure if there is another way, but this helper clears and load before comparing.

 

public static void Compare(string ruleId, AnalysisContext analysisContext, CVIModule cviModule) { Step clonedStep = cviModule.AsCommonCModule().AsModule().Step.AsPropertyObject().Clone("", 0) as Step; CVIModule clonedCviModule = clonedStep.Module as CVIModule; int parameterCount = cviModule.Parameters.Count; for (int count = 1; count < parameterCount; count++) { clonedCviModule.Parameters.Delete(1); } // Load the module's parameters based on DLL. clonedStep.Module.LoadPrototype(0); // First element is the returned value and not compared here. for (int count = 1; count < parameterCount; count++) { CommonCParameter clonedCviModuleParameter = clonedCviModule.Parameters[count].AsCommonCParameter(); CommonCParameter cviModuleParameter = cviModule.Parameters[count].AsCommonCParameter(); if (clonedCviModuleParameter.ParameterName != cviModuleParameter.ParameterName) { string messageText = $"Code Module Parameter Mismatch: Expected '{clonedCviModuleParameter.ParameterName }'; Actual '{cviModuleParameter.ParameterName}'"; AnalysisMessage analysisMessage = analysisContext.NewMessage(ruleId, messageText, cviModuleParameter.AsPropertyObject()); analysisContext.ReportMessage(analysisMessage); } } }

Automatically Close C# UI without getting incomplete executions popup

$
0
0

Hi,

 

I have been reading a number of posts and help articles on how to close a Custom UI automatically, but I am having real problems getting it to work as expected.

 

The Bottom line is I am trying to "simulate" what happens when I press the axAppExit button on the NI simple example but via the API, what is see is the axAppExit button always closes without the "incomplete executions popup" but my method always gets the popup. 

 

I am using the UI_EndExecution message to "I thought" ensure everything has finished before I fire of my -   this.axExecutionViewMgr.GetCommand(CommandKinds.CommandKind_Exit, 0).Execute(true);

 

 

Detailed description

----------------------------

UI in C#,  I started with the NI Basic example.

 

Running a custom sequential model. On starting the UI it automatically load and start my single SequenceFile in "Test UUTs" entry point.

 

this.sequenceFile = this.axApplicationMgr.OpenSequenceFile(SystemFunctions.PathsGlobal["MainTestSeq"]);


if (this.autoStart) // Execute the loaded sequence file currently configured as index 0 for Test UUTs
          axSequenceFileViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set, 0).Execute(true);

 

In the model I have added a new Callback that the SequenceFile overrides to check all the hardware is present and initialising correctly. If something goes wrong I display the information to the user and give them the choice of retrying or to Exit the Application. If they select to exit the application --

 

send a custom UI message 

 

    // UI code snippet

   // Set Hardware Initialise Fail Flag to allow Exit of Application
   case UIMessageCodes.UIMsg_UserMessageBase + 84:
   {
         hardwareInitFailTriggeredShutdown= true;
    }
    break;

 

Then in a Post Action  - sequence file

       On Condition True - Terminate execution.

              Locals.ExitConditions._Exited_k__BackingField    

 

The the UI wait for the EndExecution event to be sent by the TestStand engine and call the CommandKiind_Exit

 

 

// UI code snippet.

case UIMessageCodes.UIMsg_EndExecution:

     // check if it is the Test UUTs execution that has triggered message
     if (e.uiMsg.Execution.DisplayName.StartsWith("Test UUTs"))
        {
             if (alarmTriggeredShutdown || hardwareInitFailTriggeredShutdown)
             {
                // shut down software
                this.axExecutionViewMgr.GetCommand(CommandKinds.CommandKind_Exit, 0).Execute(true);
            }
}

 

I would be grateful for any suggestions 

 

regards 

 

Danny

Re: Building a Test Stand UI with Native Controls using .Net - Example not working

$
0
0

Hi Thanks for replying.

 

Just a quick conclusion. 

 

The setup requires Visual Studio.

 

Do I need any particular plugin or SDK with it?

 

Thanks,

Neha


Parallel model running queue and lock case

$
0
0

Hi all

  I want to build a testing demo parallel running queue structure and lock some case share device,but in debug got bugs

1)when both run two panel status can't show as snapshot 0.

2)When click Start both run it and show different items as snapshot 1.

3)When click Stop button can close Vi and sequence no response.

4)when run case "Item4" need lock serial device and share it set priority as snapshot 2.

It's appreciated any point for the issue,thanks in advance!

 

Snapshot-0Snapshot-0Snapshot-1Snapshot-1Snapshot-2Snapshot-2

How can I open an external application using NI TestStand?

$
0
0

Hello All,

 

I have 2019-32 bit TestStand and 2019-32 bit LabVIEW. I want to open VI package manager application using NI TestStand sequence and want to check the current version of a particular(ex: Datalogging Library) labVIEW library installed. Manually it is easy to check the version of any library, but I would like to automate it in TestStand by creating a sequence. Your inputs are very much welcomed. 

 

 

Thanks in advance!

Preeti

Using TS Expressions or LabVIEW API to map VI Call controls and indicators to Test Stand variables and report

$
0
0

Hey all,

 

Short story: how to map inputs and outputs of a VI Call to TestStand variables using expressions or LabVIEW API?

 

Long story:

I wish to create sequences from XML, which are capable of calling VIs and doing stuff with their IOs.

My strategy is to expand the XML Sequence Translator Example to also call LabVIEW VIs and map their IOs to TS variables and/or to the TS report.

 

For example, this part of the XML creates an action step with a VI call:

<Step Name="Open VI" Type="Action" Adapter="G Flexible VI Adapter">
     <Expr>Module.AsLabVIEWModule.VIPath="test_popup_transl.vi"</Expr>
     <Prop LookupString="Module.LoadPrototype(0)"></Prop>
</Step>

 

With additional expressions, how can I map the VI controls and indicators to test stand variables and report?

 

Which expressions / properties to modify? I would be happy using expressions or equivalent LabVIEW API calls, but I'm currently lost as to which properties to setup or which methods to call.

 

Any ideas?

Property Loader does not load limits

$
0
0

I am trying to use a Property Loader to load my limits.  They do not load.

 

I have two property loader files, one for generic settings and another for test limits.  The generic settings are just simple variables which load fine.  The test limits are attempting to load the Low/High variables of a NumericLimitTest's Limits container.  Below is a modified snippet from my test limits file.

 

<PropertyGroup name='Group 1' id='f3216169-cf80-4f4e-bf91-108fc49259c5' description='Description for Group 1'><Sequence>,<Category>,<PropertyLookup>,<Value> Test Suite,My Test,Result {Container} Test Suite,My Test,Result.Units {String},Volt Test Suite,My Test,Limits {Container} Test Suite,My Test,Limits.Low {Number},1.234 Test Suite,My Test,Limits.High {Number},5.678 Test Suite,My Test,Comp {String},GELE<PropertyGroup>

 

I can add one of the lines from my settings file (e.g. MainSequence,{Locals},MyVariable {Number},123) and it loads fine.  It seems that TestStand doesn't like the the lines for my NumericLimitTest steps.

 

I have done nothing to the file produced by the Import/Export tool other than change the Low/High values.

 

 

Re: Property Loader does not load limits

$
0
0

I found my problem.  

 

I had the Import Value To property set to <Current Sequence> rather than <All Sequences>.

 

Once again I had to rummage through dozens of properties to find the one that caused a problem.  I understand that some folks think that many options are great, but frequently fewer are better.

 

 

Viewing all 24424 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>