NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Executions, Threads, and Scopes

Hi, 

 

[I also stated: If you've built your User Interface into an executable, you must ensure that you configure the LabVIEW Adapter to call VIs using the LabVIEW Run-Time Engine AND it must call the VIs using the same Run-Time Engine that the User Interface executable was built in.

 

It is a little bit trickier to get this working. First and foremost you must ensure that your User Interface VIs AND code module VIs are all mass-compiled to the same version of LabVIEW. The tricky part here is that in order to be able to reference the same Functional Global Variable in both the User Interface executable and the sequence execution, you have to call the Functional Global Variable as a subVI of a code module that your sequence calls. This is the only way to achieve the functionality you want when you've built the User Interface into an executable.

 

I hope my explanations have been clear and complete. Please let me know if any questions remain regarding this topic. ]

 

 

I think this is even tricky as you are going to run into the problem of trying to load the same VI from two different locations, one from inside a exe and the other from where ever you store your code modules. The only way you are going to get this to work is if both exe and code modules use the same VI from the same location. That means the exe is going to have to load the VI dynamically.

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 11 of 23
(2,156 Views)

Ray,

 

Your method will indeed work, however, so will the method I mentioned above. As long as your code module top-level VI and the EXE call the same VI (as a subVI) from the same location, you will not run into any problems. LabVIEW treats subVI paths different from top-level VI paths. Please try the following:

 

  1. Create a Functional Global Variable and save it to a central location on disk.
  2. Call the FGV as a subVI in your User Interface, initializing it to some value.
  3. Create a new VI that will be called from TestStand. In this VI, call the FGV as a subVI, and get the value of the FGV.
  4. Call this VI from your sequence.
  5. Mass Compile the User Interface Directory, the VI called from TestStand, and the FGV VI with the same version of LabVIEW.
  6. Build the User Interface into an executable.
  7. In the TestStand sequence editor, configure the LabVIEW Adapter to execute VIs using the Run-Time Engine, making sure that you select to use the same RTE version as the version that you mass compiled and built the executable with.
  8. Launch the user interface executable, then open your sequence file and execute the sequence. You should see that the FGV called from your sequence will return the value that your User Interface initialized it to. 
Let me know if you are not able to get this working and I will put an example together.
Manooch H.
National Instruments
Message 12 of 23
(2,149 Views)
Hi Manooch,

Maybe I am missing something here but as soon as you build an exe the path to the subVI will no longer be the same because the subVI path will be ..\MyUI.exe\Data\subVI.VI and your code module top level vi will not able to use that but ..\TopLevelCodeModule.vi\Data\subVI.VI. (assuming TopLevelCodeModule.vi and MyUI.exe are in the same directory)


Regards
Ray
Regards
Ray Farmer
0 Kudos
Message 13 of 23
(2,140 Views)

Ray,

 

I've modified Richard's example which uses the Simple OI and attached it below. Please take a look at it. I agree with you that once you build an executable the subVI that is called within it has a path relative to the executable but I'm not sure what the Data directory you mentioned is (myApplication.exe\Data\subVI.vi). What I expect to see is myApplication.exe\subVI.vi. Then when you call it as a subVI from the code module it should be codeModule.vi\subVI.vi.

 

In this case, LabVIEW will reference the same subVI in memory for both the UI and the code module. Try it out with the example attached notice that you can change the value of the functional global variable from both the UI and the sequence file.

 

Let me know if you have any questions.

Manooch H.
National Instruments
0 Kudos
Message 14 of 23
(2,136 Views)

Hi Manooch,

 

Tried your example, loaded the Simple OI - Top Level VI project but it was having a problem finding some of the components. A quick check of the example sequence file and realised that it was using Teststand 4.2.

So downloaded the evaluation version (only had TS3.5 ). Built the TestExec.exe. Loaded the sequence file and opened the code module. saved this in the LabVIEW I am using which is 8.6f1. Shut down the SeqEditor and launched TestExec.exe.

 

Loaded the sequence file and run MainSequence. The value 555 was displayed. finished the sequence execution. Select Get on the UI and performed the action, value was still 0.

 

Shutdown testexec.exe and opened the sequence file in the SeqEditor. Selected the VI and made sure the VI was using the RTE. Saved the Sequence File, closed and exit the SeqEditor.

 

Run TestExec.exe and opened the test.seq and ran the MainSequence and received the following attached error.

 

 

 

Regards

Ray

Message Edited by Ray Farmer on 08-27-2009 08:11 PM
Regards
Ray Farmer
Download All
0 Kudos
Message 15 of 23
(2,120 Views)

Hi,

 

I changed the Global setting for the LabVIEW adaptor to use the RTE via the Configuration menu.

When I ran test.seq in the UI (testexec.exe), I didn't get the error and also I was able to get the value 555 when I pressed the Get Action.

 

When I set the LabVIEW adaptor back to development system with just the step set to use the RTE I did get the error. Also, if I didn't close the error dialog box and continued with the sequence execution, I was still able to get the value 555. Also, it didn't matter whether I used Run MainSequence or Test UUT's, I still got the error, its just with Test UUT's I got an extra error dialog.

 

Is this a problem with TestStand 4.2 !!!

 

Regards

Ray 

Regards
Ray Farmer
0 Kudos
Message 16 of 23
(2,116 Views)
I am not sure Ray, but thank you for bringing that to my attention. I will investigate this and let you know what I find.
Manooch H.
National Instruments
0 Kudos
Message 17 of 23
(2,113 Views)

Hey Ray,

 

I tested the example with the LabVIEW Step specifically set to Always Use the Run-Time Engine but was unable to reproduce the error you received.

 

I'm using TestStand 4.2 and LabVIEW 8.6.1

Manooch H.
National Instruments
0 Kudos
Message 18 of 23
(2,092 Views)

Hi Manooch,

 

I haven't got access to 8.6.1 but my 2009 beta is still active so I decided to try that. All appear to work when I ran the testexec.exe from the project but when I shutdown LabVIEW I received the following error.(see attached)

testexec error - FGV-2009.PNG

 

So I tried running the testexec.exe without labview running. Unfortunately, I get the same error regarding AppWebSetWebPort as before when I try to run the test.seq.

 

Any idea what this AppWebSetWebPort error is.

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 19 of 23
(2,085 Views)

Hi Manooch,

 

I seem to have hijacked Mike's original post but looking at the example in this post I seemed to be getting this "Webserver.cpp" error and I not sure why I am getting this because I didn't think the testexec.exe has anything to do with the Webserver services.

 

Thinking that maybe there is an issue with my LabVIEW 2009 beta installation (although it is a later beta release rather than a early one) I when back to using 8.6f1 and bulit the default Simple IO  supplied with TestStand 4.2 (evaluation).

 

This also, generates the WebServer.cpp error.

 

I have searched the NI website for this cpp error but nothing was found.

 

Why is the testexec.exe using a WebServer and why am I getting this error?

Also why do I only seem to get the error when a Step is set to use the RTE but I dont when the global setting for the LabVIEW adaptor is set to use the RTE? This would seem to suggest that its the LabVIEW developement system that has the problem.

 

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 20 of 23
(2,057 Views)