07-02-2018 08:21 AM
Hello,
I have made a module and compiled it to an .exe file with its main VI as starting VI.
I run the .exe file(main.vi of the module) and test the .exe with tester VI. I am getting no instance running error .
How do I Trigger DQMH event(Request) built into Exe file for a module Is it possible?
Regards,
Bharath
Solved! Go to Solution.
07-02-2018 10:36 AM - edited 07-02-2018 10:39 AM
Generally, the LabVIEW development environment and the LabVIEW Run-Time Engine execute in different application instances(*). This means that they do not share their resources. To the best of my knowledge, there's no easy/quick way to make the Tester (executed in the development environment) talk to the module (executed in the run-time engine).
You can, however, embed your Tester VI into your executable and launch it from the module. Then both VIs are running in the same application instance, thus being able to talk to each other.
Proof of concept: I added a button that launches the Test Instrument API.vi dynamically, and rebuilt the executable:
(*): If you want to read up on application instances, go to
- http://zone.ni.com/reference/en-XX/help/371361P-01/lvconcepts/application_instances/
- https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KuGSAU
- http://zone.ni.com/reference/en-XX/help/371361P-01/lvconcepts/building_vi_server_applications/
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )
07-02-2018 11:37 AM
Hi Bharath,
Another option is to create a launcher based on your API Tester and use it to debug your application and make it part of your application.
Take a look at "Tip 7: Use API Testers as Application Launcher" on this blog post http://delacor.com/tips-and-tricks-for-a-successful-dqmh-based-project/
There, we describe how to create an application launcher based on the API Tester.
Regards,
Fab
07-03-2018 05:32 AM
07-03-2018 07:06 AM
@பரத்_குமார்(bharathkumar) wrote:
Is it possible without compiling the test vi into the exe rather from development instance?
trigger events in the development instance(tester api) and update values in the executable instance ( module main)?
As I wrote, I don't know any simple or quick way.
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )
07-03-2018 12:48 PM
@joerg.hampel wrote:
@பரத்_குமார்(bharathkumar) wrote:
Is it possible without compiling the test vi into the exe rather from development instance?
trigger events in the development instance(tester api) and update values in the executable instance ( module main)?
As I wrote, I don't know any simple or quick way.
Agreed, there is no direct way to do this. The EXE runs in one application instance and the development environment runs o a different instance.
The fastest way to have the API tester available in your EXE is to include it in your build specification. You can follow the post I pointed to so you do it in a more permanent way.
Another option is to include your top-level VI and the API tester as your Startup VIs. This will launch both your Main.vi and your API Tester.
07-04-2018 08:48 AM
Hello joerg,
I tried the way you have implemented.
After implementation
1. my tester throws error 5004 if run as cloneable.Whereas it works as singleton in Executable instance(I have made the module as Cloneable)
It throws error from the Development environment as well
07-05-2018 02:45 AM
1.) Regarding error 5004: The error message already describes pretty well what's happening:
The "Instrument" module is currently running as singleton, but the Start Module VI was called with 'Run as Singleton' specified as FALSE.
If you start your main.vi manually (i.e. click the run arrow) the module runs as a singleton. If you then launch the Tester, and try to launch the module again as a cloneable, that won't work. You can either run it as singleton OR as cloneable(s).
2.) Regarding error 1003: In my example, I put a strictly typed static VI reference (indicated by the red star on the icon) to the Test Instrument API.vi into the main.vi with the intention of launching the tester from the module, not the other way around. If you want to work it both ways, you can use a non-strictly typed reference:
Read up on static VI references (and how they affect and are affected by the execution state of subVIs) here: http://zone.ni.com/reference/en-XX/help/371361P-01/glang/static_vi_ref/
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )
11-20-2018 05:29 AM
Hello Jörg,
quick follow-up:
I implemented your approach and it works as expected in DEV and EXE.
I then compiled a PPL with the Lib of the Module as the Top-Level-Lib and the Test VI as always included.
When I start the module from TestStand (in this case since it resemble a physical device used in tests), the module starts and I can use other VIs from the public API to call to it.
But when I click the button to launch the tester VI async., nothing happens.
Searched for a while, but didn't find anything...
Not sure if this intended for PPLs or if there is some setting, I'm not getting correct...
Any help or pointers greatly appreciated..
Cheers
Niels Göran
11-20-2018 01:16 PM - edited 11-20-2018 01:16 PM
Hey Niels,
I fear I'm out of my depth with this one. We don't work with PPLs a lot.
Sorry!
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )