LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different instance of same vi when loaded from Project file

HI All,
 
I am using Lv 8.2 and Test Stand 4.0  I created a Project file and linked my vi's to it. Then launched the Main vi from the Project file. i could see 2 instance of the same vi running. I am using LV2 globals. The LV2 globals used in Main vi seems to be loaded from the Project file and has "My computer" indication on the left bottom corner of the vi. Where in another User interface these are showing as loaded from the folder.  Had anyone faced this problem.
 
Thanks,
Sudha
0 Kudos
Message 1 of 9
(3,849 Views)

Hi Sudha,


SudhaBalayanan wrote:
I am using Lv 8.2 and Test Stand 4.0

Are you making calls to LabVIEW from Test Stand or is everything being done in LabVIEW? Could you elaborate a little bit about the structure and organization of your project? Where and how did you see "2 instance of the same vi running"? Could you provide a screenshot?


SudhaBalayanan wrote:
The LV2 globals used in Main vi seems to be loaded from the Project file and has "My computer" indication on the left bottom corner of the vi. Where in another User interface these are showing as loaded from the folder.
When a VI is opened from a project, it should show an indication of the target the VI "belongs" to in the bottom left corner. If you open the VI when the project is not open, it will not show this indication. If this is not what you are referring to, could you elaborate on what you mean by "loaded from the folder". Please feel free to provide any sample code or images of your code and problem. Thanks
0 Kudos
Message 2 of 9
(3,827 Views)

Hi Mike,

 

As there were many critical hardware elements to be solved for my project this became a low priority one.  So there is a delay in replying to your response.

 

There is a Main User Interface (UI) which has Booleans (Execution Entry points – of Test Stand). Upon user pressing these Booleans, test stand will launch the other UI. Test Stand is used only for this purpose. DAQ acquisition etc all is handled by Labview.

For test stand to load the corresponding UI (based on the Boolean press in Main interface,) we have provided the corresponding UI path in Test sequence. This UI path is from the folder where I have stored source code in harddisk.

 

Is this a problem, do I need to specify the UI path from the Project file…. If so, how should I do that?

The attached image has the an arrowmarked area.

 

Thanks,

Sudha

0 Kudos
Message 3 of 9
(3,778 Views)
Hi Sudha,

I don't see any problem calling the VI like you mentioned in your last post.  Do you receive any unexpected behavior or errors?  Thanks!
Matt S
National Instruments
Applications Engineer
0 Kudos
Message 4 of 9
(3,742 Views)
Hi Mike,
Please find attached a sample vi's.
 
In that Main.vi is the one which launches Userinterface-2.vi. This is launched using test stand. I am seeing the following behaviour.
 
1. I do not open project file. I launch Main vi from the path stored in hardisk. This will launch Test stand. then i click 'User Interface' boolean, to launch User Interface 2 (UI2).vi. then click Set/Reset and can see that getting updated in UI2 front panel.
 
2. the same thing when i do by launching the Main vi from Project file, i am seeing that UI 2 loaded is from hardisk. Ans when i press Set/reset in Main interface, it is not getting updated in UI2.
 
PLease replace the users.ini in your test stand folder for the priliviges to work.
 
Thanks,
Sudha
0 Kudos
Message 5 of 9
(3,717 Views)

Mike,

I think few subvi were missing in my yesterday's attachment. I have cleared those and attached a new version.

Please change the User interface2.vi 's file path in the test stand execution entry point path.

 

Thanks,

Sudha

0 Kudos
Message 6 of 9
(3,694 Views)
Hello Sudha,

I looked at the code that you provided and I was unable to reproduce your error.  I have listed what I did as well as what the results were below:
  1. The Project file is closed
    1. Launch Main.vi from the Windows Explorer.
    2. Run Main.vi which launches TestStand.
    3. Open and run User Interface-2.vi from the Windows Explorer.
    4. In Main.vi, click Set, the LED updates in User Interface-2.vi.
    5. In Main.vi, click Reset, the LED updates in User Interface-2.vi.
  2. Open Project file.lvproj.
    1. Double click Main.vi from the Project Explorer.
    2. Run Main.vi which launches TestStand.
    3. Double click User Interface-2.vi from the Project Explorer.
    4. In Main.vi, click Set, the LED updates in User Interface-2.vi.
    5. In Main.vi, click Reset, the LED updates in User Interface-2.vi.
I am receiving the exact same behavior both if I launch the files from the LabVIEW Project Explorer and if I launch the files from the Windows Explorer.

I looked through the VIs that you posted and the TestStand code all works exactly how I would expect it to.  If anything, I would venture to guess that something is happening on the LabVIEW side of things.  What version of LabVIEW are you using?  I tested everything using LabVIEW 8.5 and TestStand 4.0.1.

Would it be possible for you to test this without the TestStand integration?  Do you still see the same behavior if you remove TestStand from the picture completely?
0 Kudos
Message 7 of 9
(3,677 Views)
Hi Jonathan,
 
Both the procedures you had mentioned will work fine. Please try the below
 
1. Open Project file and launch Main .vi
2. Click 'User interface' boolean on the Main vi. Upon 'User Interface' boolean press, teststand will launch the Userinterface2.vi. You can see that Userinterface2.vi will not have the 'target name' in its front panel.
3. Now press Set on Main vi, it will not get updated on Userinterface2.vi. Same with Reset as well.
4. Similiarly, go to block diagram of Main vi and Userinterface2.vi and open the subvi used in those (namely LV2 Global Save Button Status.vi), you will see 2 different instance opening (one from project folder and other from the windows folder.).
 
So i am thininking the execution entry point (vi path ) mentioned in Test stand need to point to the project file target rather than windows path.
 
Thanks,
Sudha
0 Kudos
Message 8 of 9
(3,669 Views)
Hi Sudha,

I believe the problem is that the Main.vi is running in the LabVIEW Development Environment engine while UserInterface-2.vi, when launched from TestStand, is running in either a seperate copy of the LabVIEW Development Environment engine or in the LabVIEW Run-Time engine.  Either way, the global variables will not be shared between the various engines.  You can try compiling Main.vi into an executable, which will force it to run in the LabVIEW Run-Time engine.  If this does not resolve the issue, you will want to look into sending and handling TestStand UI Messages, which can be sent by Main.vi and then handled by UserInterface.vi.  This will essentially allow you to communicate between the two VIs using the TestStand engine.
0 Kudos
Message 9 of 9
(3,640 Views)