From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand and LabVIEW Application Instances

I am having an interesting problem with my LabVIEW/TestStand application. It seems that the LabVIEW (8.5) modules invoked by a TestStand (4.1) sequence may in some cases be running in a different application space from my LabVIEW OI. Is this possible?

 

The problem I am having is that some functions that I try to invoke in my LabVIEW test steps (like semaphores and Generate User Event).

 

I see an error like this:

Generate User Event in ...
LabVIEW:  If you obtain a user event reference in one application instance, you cannot use that user event reference in another application instance. You cannot use user events for communication between LabVIEW application instances.

 

If this is truly what is happening, how can I change it such that the test step modules and the OI are in the same application space?

 

Weird thing is that it seems global variables are read fine. I don't see how that's possible if they are in different application spaces. I may have some other problem and the error is misleading me or something.

 

P.S. I know that I can use UIMessages to pass data to my LabVIEW OI, please don't try to suggest that as a work-around, I can figure that part out. I am just trying to understand the problem and whether it can be solved directly.

 

Thanks!

Message Edited by 10Things on 10-03-2008 06:10 AM
Message 1 of 6
(3,577 Views)

10Things

Question

Are you running your OI in LabVIEW Development system?

If so are opening the OI from the "Build script" project browser window on or are you opening "Load Top-Level VI.vi" from the LabVIEW OI folder?

Opening an VI from the project window will open the VI in the context (application instance) of that project.   So the fix to the problem is to open the OI using

"Load Top-Level VI.vi" rather than opening it in the context of the project. 

 

 

 

Regards

Anand Jain

National Instruments

0 Kudos
Message 2 of 6
(3,567 Views)

Anand,

 

What happens if you run a LabVIEW executable as the OI? Back in TestStand 3 I was sharing data between a LabVIEW OI and code modules using a LabVIEW global and that broke when I went to a LabVIEW exe OI. The OI was in one process and the code modules in another. Is that still the case?

 

I've been under the impression that it is not a good programming practice to pass data directly between an OI and code modules. The recommended way has been to use UI Messages from LabVIEW to the OI, and the TestStand api to write from the OI into the execution. Is this still the case?

 

You should be able to use the SynchManager to share a TestStand semaphore with LabVIEW, but recently an AE told me that calling the SynchManager outside TestStand is not supported and not a good idea. What do you think about that?

0 Kudos
Message 3 of 6
(3,562 Views)

You know, I haven't tried that yet but it does kidof ring a bell. Can anyone confirm this?

 

I think in the past I did some workaround like creating a VI that launched the engine, which called a callback which launched my OI or something like that.

0 Kudos
Message 4 of 6
(3,556 Views)

Thanks, that's good to know. Turns out the problem was mine - the way I was passing the refnums was no good and it was changing the values.

 

Now ALL of my steps are passing LV refnum -> TestStand Num -> LV DBL -> Coerce to U32 -> Cast to refnum type and that seems to work.

0 Kudos
Message 5 of 6
(3,554 Views)

dowNow wrote:

Anand,

 

What happens if you run a LabVIEW executable as the OI? Back in TestStand 3 I was sharing data between a LabVIEW OI and code modules using a LabVIEW global and that broke when I went to a LabVIEW exe OI. The OI was in one process and the code modules in another. Is that still the case?

 

I've been under the impression that it is not a good programming practice to pass data directly between an OI and code modules. The recommended way has been to use UI Messages from LabVIEW to the OI, and the TestStand api to write from the OI into the execution. Is this still the case?

 

You should be able to use the SynchManager to share a TestStand semaphore with LabVIEW, but recently an AE told me that calling the SynchManager outside TestStand is not supported and not a good idea. What do you think about that?


DowNow,

Your code modules will run either in the LabVIEW development environment, or in the LabVIEW runtime engine depending on the option you set in the Configure»Adapters dialog.  The problem you are describing is that when you use a LabVIEW executable, the runtime engine is loaded in the executable's process and does not share information with any other loaded runtime or the LabVIEW development environment. 

 

So in this case, if you use the runtime to load your code modules, it will work, because they will be loaded in the same process, but if you access them using the development environment, then it will not work.  Conversely, if you launch the UI from the VI in the development environment, but then use the runtime engine for your code modules, it will not work.

 

Using UIMessages and the TestStand API is still the best (and only) recommended way to pass information from your sequence to your UI and back.

 

I don't know why you were told that the SyncManager API is not supported. The SyncManager API is documented in the TestStand help and can be used from LabVIEW.  Link to online help

Message Edited by Josh W. on 10-07-2008 06:13 PM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 6 of 6
(3,516 Views)