NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Error while updating variables of a teststand through LabVIEW API

Solved!
Go to solution

Hello,

I am using TestStand 2014 UserInterfaces Full-Featured Labview code for running teststand sequence from labview interface. In teststand I have used variables inside Locals and Fileglobals.Now I am running the Labview vi i.e Full-featured user interface and selected the teststand seq. file . While running I wanted to update the variable data possibly string data through property call. I tried several property node and methods but it always give me errors. I am attaching screenshot of what I have done. Please help me out of passing data from labview to teststand. I tried to lookup some documentation but none of them helped me out.
 
2016-08-24_1746.png
 
2016-08-24_1750.png2016-08-24_1753.png
 
 
 
I have also tried the example "Accessing Properties" Using API which is present in this location . "C:\Users\Public\Documents\National Instruments\TestStand 2014 (32-bit)\Examples\TestStand API\Accessing Properties Using API\LabVIEW" , but this example is for updating varibles data through running teststand and calling labview vi to update the variable value.  
 
My goal is to update variable data through running Labview interface and loading a sequence file getting its sequence context and using it change varibles data and then while running the sequence file it will take the updated variable dataa.

 

0 Kudos
Message 1 of 15
(9,520 Views)

Post your code instead of image, So that it will be easy to debug and test and modify.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 15
(9,505 Views)

I believe the error is happening because accessing a local requires that the API know what Sequence to be using (MainSequence, etc.)  I believe changing the Local to a FileGlobal will fix the problem as the FileGlobal should be accessible after opening the sequence file.

 

Pulido Technologies LLC

0 Kudos
Message 3 of 15
(9,499 Views)

I have tried putting FileGlobals , still same error.

 

2016-08-29_1720.png

 

2016-08-29_1720_001.png

0 Kudos
Message 4 of 15
(9,496 Views)

Local variable itself should work!

its always better to share code than sharing picture.to understand better.

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 15
(9,493 Views)

I am sharing the base code I have used to build my project .It contains the LV project and TS seq. file. Extract it in the same folder. Inside the project expand TS Full LabVIEW UI.lvlib and open Top-Level VI.vi. 

 

After running the code just press the Value Update button from front pannelIt should load the seq. file and should update the variable data where I am getting error.

 

Please note Labview version is 2015 and Teststand version is 2014.

0 Kudos
Message 6 of 15
(9,490 Views)

One problem with your code is that SetValString requires the "SequenceContext.AsPropertyObject".  Your code passes the SequenceFile reference.  One solution would be to use StationGlobals.  Those can be accessed via Engine.Globals. 

 

Alternatively, you can get the SequenceContext, but this requires a running execution.  Your pictured code only opens the sequence and the user hasn't clicked on "TestUUTs".  Assuming that an execution has started (via TestUUTs or whatever strategy you like), you can call ApplicationMgr.Execution.Item(0).GetThread(0).GetSequenceContext(0).AsPropertyObject.SetValString

 

I wouldn't recommend doing things this way.  It is much easier to have TestStand pass the SequenceContext to LabVIEW code via a UIMessage or just through any TestStand Step.

 

Also, in general, I wouldn't programming your UI to set values such as Serial Number.  I would recommend having your TestStand Sequence or Model get the serial number.  This prevents the problem of only being able to run your TestStand code on the specified UI.

 

Pulido Technologies LLC

0 Kudos
Message 7 of 15
(9,482 Views)

My motive is to insert the serial number to the UUT serial number, i.e. I will scan a barcode in the LV UI . It has to pass the barcode serial number to the teststand. I wanted to insert the serial number in the PreUUT so that when the sequence starts running the UUT information popup box should not appear and it could take the UUT serial number as barcode data from LV. So to get this maybe we have to pass or update the varible which I will use for serial number in PreUUT sequence as soon as the seq. file is loaded in the LV interface. After that it will be runned.

0 Kudos
Message 8 of 15
(9,466 Views)

You can Modify The DoPreUUT Sequence to Scan for Barcode, instead of POP UP asking for Serial Number. barcode scanning can be done using LabVIEW and the OutPut of LV can be Passed directly to Serial Number Local variable

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 15
(9,463 Views)

I would definitely recommend changing the callback for PreUUT or DoPreUUT instead of doing things through the operator interface.  It would be easy to add a message popup (using the TestStand popup or in any language) and having the user scan in the barcode and then your TestStand code saves it to a local variable.  Then, you can do whatever you like with this information and create Parameters.UUT.SerialNumber.

 

Pulido Technologies LLC

0 Kudos
Message 10 of 15
(9,453 Views)