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

Re: API to set SequenceFile password

$
0
0

Script in c# works fine, next step is to create powershell script to do the same but I ca not instantiate Engine class:

 

$assembly = [System.Reflection.Assembly]::Load("NationalInstruments.TestStand.Interop.API, Version=19.0.0.172, Culture=neutral, PublicKeyToken=ad9244eb3b825cd8")
$engine = New-Object NationalInstruments.TestStand.Interop.API.Engine

 

The output is:

New-Object : A constructor was not found. Cannot find an appropriate constructor for type NationalInstruments.TestStand.Interop.API.Engine.
At line:2 char:11

 

 

I am not expert in powershell scripts so there might be something simple that I do not understand clearly.

Thanks


Re: API to set SequenceFile password

$
0
0

nevermind, it was related to 32 and 64 bit of powershell.

Re: How to configure the StationGlobals.ini, How to bind the each definitions in the StationGlobals.ini to Teststand. What is the meaning of the each

$
0
0

I'm not sure I understand exactly what you are looking for here but I'll throw out some information hoping it helps.

 

Basically StationGlobals.ini is just a property object file that contains station global variables.  Whenever you add a variable to StationGlobals.ini it also copies the type definition into the file (this is normal in TestStand so that files can exist independently).   

 

StationGlobals.ini resides in the TestStand configuration directory.  If you are using Environments then it will be in the configuration directory for the environment.  When TestStand loads it pulls loads StationGlobals.ini from the config directory.

 

You can add variables to StationGlobals.ini by going to View>>Station Globals inside of the sequence editor.  

 

Hope this helps,

Re: Does specifying default module for a custom step tightly binds the VI path in Steps.TS.SData?

$
0
0

What selections are checked under Configure/Search Directories? Do you have "Search SubDirectories" checked box enabled?

 

Each PC running identical TS version may have different Search Directories enabled.

CTD Exam Material Question

$
0
0

Hi,

 

I am trying to teach myself how to use TestStand and downloaded the CTD exam prep material.  I tried to open up the example exam solution but it is missing all the associated files.  I thought what I needed to do was install the NI Package files and then all the files that I would need would be installed but that didn't work? See below.  Can someone please walk me through how to get the sample exam program (sequence file) running?  Thank you

 

teststandpic.PNG

 

 

 

TestStand Exception with Labview .net interop assemblies

$
0
0

Hello everyone,

 

we are developing a test procedure using .net interop assemblies (as the customer prohibits direct use of LabVIEW VIs in his production area for some reason).

 

We have different hardware driver libraries based on the common low level drivers (AI/AO/DI - daqmx, PXI power supply - dcPower). All of those libraries are working just fine at the LabVIEW side.

The .net interop assembly creation out of the application builder works fine (but may be done on two different PCs). We have Teststand sandboxes for all of the libraries (separately!), which are working fine.

 

Now when we put the calls to libraries together, TestStand throws an exception, either at runtime or even when you create a new step (seems to relate to the modules already in memory) 

 

Environment: LabVIEW 2017.0f2, TestStand 2016 SP1

 

The Exception is something like that:

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

An exception occurred inside the call to .NET member 'Autocalibration':
System.TypeInitializationException: The type initializer for 'NI_PXI_4112.LvClient' threw an exception. ---> System.IO.FileNotFoundException: Missing Dependency in: Autocalibration.vi ---> NationalInstruments.LabVIEW.Interop.VIAssemblyException: Missing Dependency in: Autocalibration.vi
   --- End of inner exception stack trace ---
   at NationalInstruments.LabVIEW.Interop.LVRuntime.throwMissingDependencyException()
   at NationalInstruments.LabVIEW.Interop.LVRuntime.LVClientInit(ClientKind clientKind, IntPtr initRec)
   at NationalInstruments.LabVIEW.Interop.LVRuntime..ctor(String[] entryPointNames, String lvClientAssemblyPath, String lvRuntimeVersion)
   at NI_PXI_4112.LvClient..cctor()
   --- End of inner exception stack trace ---
   at NI_PXI_4112.NI_PXI_4112.Autocalibration(String resourceName, String channels, Int32& errCode, String& errSource)

 

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

 

Does anyone have a hint how to debug that exception or what may be the root cause?

(we currenly suspect something like reentrancy?)

 

Thanks in advance!

Michael

Re: Does specifying default module for a custom step tightly binds the VI path in Steps.TS.SData?

$
0
0

Search directory includes the public components and it's sub-directory where the same packed library and VI is located.  

 

Ajayvignesh_MV_1-1593524121825.png

 

Now, I'm in a conclusion that default module is tightly binding the steps with VIpath.  Later even though if I change the path of default module, the existing steps will not change the old paths.

 

--

Thanks

AJ

Re: Does specifying default module for a custom step tightly binds the VI path in Steps.TS.SData?

$
0
0

So it sound like you have to go into the original or old TS code and touch every line where the old Type is used and replace it.

 

I remember doing similar for file path to execute Labview. I don't have a suggestion/solution but I went in and put back the root file path back to the original path. Just painful if the path is changed.


Re: CTD Exam Material Question

$
0
0

The exam contents get installed here: C:\Users\Public\Documents\CTD_Test

 

If you add that to your search directories you should be good.

Re: Does specifying default module for a custom step tightly binds the VI path in Steps.TS.SData?

$
0
0

Exactly that's what I'm doing.  Since this property is not visible in editor, I use a statement before each step to update the next step property as below.

 

RunState.NextStep.TS.SData.ViCall.VIPath = "myNewPath"

 

Ajayvignesh_MV_0-1593526444015.png

 

Re: CTD Exam Material Question

$
0
0

It looks like you will need to check the search subdirectories box as well.

Re: Is Teststand able to install and implement on Linux system

Re: Reading Network Variable value in Teststand sequence

$
0
0

If it were me I would call the VI that is able to read it.

How to iterate all Teststand File Global effectively

$
0
0

Recently, I'm working on a project where teststand is being used.  According to one of the user story, we need to iterate all file global. 

i just simply created one which is based on recursion. Not sure if there is any other better way to approach.   

Re: How to iterate all Teststand File Global effectively

$
0
0

That's how I recurse through property objects.  I used to flatten like you are doing then iterate.  Now I just put my operations in my recursion algorithm for speed sake.  In your case you are doing O(2n) where if you put the operation in the recursive algorithm you will get just O(n).  So if you have deep trees it will take twice as long.

 

If timing is an issue it might be quicker just to iterate on the top level and delete them and then recreate them from the type definition (which has the default values).  

 

Regards,

 

 


Accessing Object Reference from C#

$
0
0

Hi,

 

I am developing a script that shows FileGlobals variable inside a small C# interface, a sort of debugging view to keep track of a couple of variable while testing units.

 

I managed to display an Array of number that shows as is in TestStand:

ThomasPujolle_0-1593700818944.png

The corresponding C# script is as follow (ObjectList is in FileGlobals):

private NationalInstruments.TestStand.Interop.API.SequenceContext mSequenceContext; this.objList=this.mSequenceContext.FileGlobals.GetPropertyObject("ObjectList",0); double[] myArray = (double[])this.objList.GetValVariant("", 0); this.testLabel2.Text = myArray[0].ToString() + " " + myArray[1].ToString();

In the label I can read "1 5", great success ! 

 

Now I want to reproduce the same thing but with an Array of Object References, here seen in TestStand:

ThomasPujolle_2-1593701546573.png

 

 

 

Should I also start with this.mSequenceContext.FileGlobals.GetPropertyObject ? Does this work as a general approach to retrieve any object?

 

I'm a bit lost when it comes to what to do after that, any help much appreciated.

 

Thanks

 

Re: Accessing Object Reference from C#

$
0
0

If you look at the API for property objects there are a whole bunch of GetValXXX and SetValXXX methods.  https://zone.ni.com/reference/en-XX/help/370052AA-01/tsapiref/reftopics/propertyobject/

 

Some of them say GetValxxxByOffset.  These are used to index arrays.  In your case you could do:

 

this.obj = this.mSequenceContext.FileGlobals.GetValIDispatchByOffset()

https://zone.ni.com/reference/en-XX/help/370052AA-01/tsapiref/reftopics/propertyobject_getvalidispatchbyoffset_m/

 

Hope this helps,

Re: Accessing Object Reference from C#

$
0
0

Right ok, I think I got to that point some other way but this.obj is just a C # object and I could not find a way to retrieve the value of what it was pointing to.

Re: source code control in teststand

$
0
0

Maybe it's worth to mention that there is a difference in the way how SVN and Git works internally (there are plenty articles about it). The important thing to highlight is that Git is not very good for controling binary files or Photoshop, Word etc. because each change record will consume a lot of memory. So for such scenarios better to use SVN or Git LFS extension.

Re: source code control in teststand

$
0
0

Hello,

 

Some months ago I faced similar problem which SCC to use.

I tried  the PushOK plugin with TestStand and TortoiseSVN, it was working, but with limitations.

The functionality provided by the plugin was not enough for me, so I created my own TestStand version control library in a sequence file.

My idea was to automatically update/commit changes when sequence files are opened. I placed in each test sequence file a SequenceFileLoad/UnLoad callback, which calls my SVN library sequence in a new execution, and performs update/commit or locking of the sequence files by low level using the svn.exe.

Also possible to create SVN Tag with this method.

Viewing all 24425 articles
Browse latest View live


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