NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

API to set SequenceFile password

Solved!
Go to solution

Hello,

 

I am trying to set password for sequence files during deployment in automated way.

Engine engine = new Engine();
SequenceFile seq = engine.GetSequenceFileEx(seqPath);
seq.??

 

pawhan11_0-1593167128804.png

 

I ve tried to find some documentation but no success so far.

 

0 Kudos
Message 1 of 5
(2,009 Views)
Solution
Accepted by topic author pawhan11

seq.AsPropertyObject.SetTypeDefinitionProtection(0x2, <password>)

 

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

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 5
(1,986 Views)

Thanks, exactly what I was looking for.

0 Kudos
Message 3 of 5
(1,969 Views)

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

0 Kudos
Message 4 of 5
(1,945 Views)

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

0 Kudos
Message 5 of 5
(1,938 Views)