08-26-2009 12:48 AM
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
08-26-2009 08:27 AM
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:
08-26-2009 03:22 PM
08-26-2009 04:01 PM
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.
08-27-2009 02:10 PM - edited 08-27-2009 02:11 PM
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
08-27-2009 03:22 PM
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
08-27-2009 03:35 PM
08-28-2009 10:15 AM
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
08-28-2009 03:05 PM
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)
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
09-02-2009 02:26 AM
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