NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing LabVIEW Objects from LabVIEW to TestStand

Goal: to pass LabVIEW Objects from LabVIEW to TestStand.
 
Background: I have a TestStand Operator Interface (LabVIEW) application that instantiates several LV objects, places them in a set, converts to DVR, converts the DVR to double, then passes the double as a parameter to a TestStand sequence. The application is run in the development environment; however, I switch the instance to Main App Instance to be in the same instance as the TestStand LabVIEW development adapter. A sequence code module step (LabVIEW) pulls out the objects from the set. This all works just fine. I then want to write the objects variables in StationGlobals (object references) for use in other sequences while the LabVIEW app is running.
 
LV 2021, TS 2021
 
I tried two seemingly similar steps that I suspected would behave exactly the same.
  1. Setting an LV Object to a TestStand Variable using the TestStand API method SetValVariant within a TestStand Code Module (VI). This results in error 1.
  2. Setting an LV Object to a TestStand Variable using a TestStand expression step (also using TS API SetValVariant) works perfectly.
I suspect there is something I don't appreciate about either the TS API or memory boundaries between TS and LV. Can someone help me understand the memory relationship or is there another root cause? 
Andy Corbato
DMC Inc.
CLD, CTA
Download All
0 Kudos
Message 1 of 9
(1,672 Views)

Hi QuickDrop

 

I’m actually working on an identical mechanism to this right now. Currently I can’t pull the object out of the DVR successfully in built EXE or Main App instance. How are you getting flattened DVR red (DBL) into TS ? I’m using SetValNumber for a StationGlobal directly from my LabVIEW code using Engine ref then accessing station global from TS but not working just yet.

 

Perhaps we can share notes to solve both our issues as sounds similar?

 

BR.

Chris 

Don't forget to give Kudo's for a good answer !

LabVIEW Champion
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 9
(1,591 Views)

You can not set a LabVIEW Object using the "SetValVariant" from within LabVIEW. You can from within TestStand, just not LabVIEW. The reason you can use it from TestStand, is the class is already an object reference at that point.

 

See here: https://lavag.org/topic/18106-storing-labview-class-objects-in-teststand-object-reference-variables/

 

You can use "SetValVariant" if you put a variant on the front panel of the VI, and pass in the object reference to the class from TestStand to the vi. So you'd have to just do a translation layer if you want things that way, that way to LabVIEW it's an object reference when it calls SetValVariant.

0 Kudos
Message 3 of 9
(1,581 Views)

Hi Chris,

 

I'm writing the DVR as a double to a TestStand variable. Then using a LabVIEW code module called in the TestStand sequence which accesses the DVR via an IPE then returns the LV Object as an indicator. I then linked this indicator to a TS variable (object reference).

 

SetValVariant was working for me within an expression step; however, SetValVariant from within the LV code module via the engine reference returned error 1.

 

Andy Corbato
DMC Inc.
CLD, CTA
0 Kudos
Message 4 of 9
(1,572 Views)

Andrew,

 

I'm doing something very similar except my OI is writing the flattened (to DBL) DVR to the Globals File, I then have a code module reading this and retrieving the DVR (hence object).

 

Works fine when running the OI in the Main App instance but not EXE. 

 

The info contained here https://www.ni.com/en-gb/support/documentation/supplemental/13/how-teststand-interacts-with-labview-... suggests that this should work.

 

Did you try your method using an EXE and LabVIEW RTE?

 

Chris

Don't forget to give Kudo's for a good answer !

LabVIEW Champion
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 5 of 9
(1,558 Views)

Chris,

 

Have you verified the RTE versions that TestStand loads, and that your exe loads are the same? I'm not sure if you are using the same versions of Andrew with 2021 TestStand/LabVIEW. But if you are using an earlier version, it can make things trickier.

 

In the LabVIEW EXE build properties, depending on what you set "Allow future versions to run this executable" you'll want to change what TestStand version of RTE TestStand uses. As a LabVIEW EXE by default will open in the latest version of LabVIEW RTE you have installed. But TestStand by default will open use the LabVIEW RTE of the compiled/lose VI's. So if you build a LabVIEW EXE in 2020, but have RTE 2021 installed. TestStand will use 2020, while your exe will use 2021.

 

Another way around this is to use "Enable version independent runtime" feature of the LabVIEW adapter. This makes TestStand use the latest version of the LabVIEW RTE as well. Using this method, with allow future versions to run this executable, always forces things to match and share a memory space.

 

 

0 Kudos
Message 6 of 9
(1,533 Views)

Hello,

 

Glad to see I'm not the only one having the same issue (in executable mode).

 

I also came across the same documentation that says it should work...

 

Did you find a solution to this problem?

 

0 Kudos
Message 7 of 9
(1,437 Views)

@TeamJP66 wrote:

Hello,

 

Glad to see I'm not the only one having the same issue (in executable mode).

 

I also came across the same documentation that says it should work...

 

Did you find a solution to this problem?

 


Hi,

 

I indeed did find a solution for the issue I was having and that was because TS and LV RTE were using different versions of the Run-Time Engine. I resolved this by ensuring that both use the latest version installed.

In TS this is achieved by ensuring TS uses the 'Version Independent Runtime',  Got to the Advanced Tab of the LabVIEW Adapter settings to enable this.

 

Give this a try, good luck

 

Best,

Chris R

 

 

Don't forget to give Kudo's for a good answer !

LabVIEW Champion
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 8 of 9
(1,422 Views)

Hello Chris,

 

Thanks for your reply, I will try that.

 

JP

0 Kudos
Message 9 of 9
(1,406 Views)