06-23-2022 10:05 AM - edited 06-23-2022 10:12 AM
06-27-2022 02:48 PM
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
06-27-2022 05:26 PM - edited 06-27-2022 05:50 PM
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.
06-27-2022 07:47 PM - edited 06-27-2022 07:50 PM
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.
06-28-2022 01:02 AM
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
06-28-2022 04:22 PM
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.
09-01-2022 09:33 AM
Hello,
Glad to see I'm not the only one having the same issue (in executable mode).
Did you find a solution to this problem?
09-01-2022 01:45 PM
@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
09-02-2022 01:05 AM
Hello Chris,
Thanks for your reply, I will try that.
JP