DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

DQMH events not working in exe

Solved!
Go to solution

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

Thanks & Regards,
Bharath Kumar
GCentral
0 Kudos
Message 1 of 14
(5,629 Views)
Solution
Accepted by JÞB

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.

 
inst-1.png

 

Proof of concept: I added a button that launches the Test Instrument API.vi dynamically, and rebuilt the executable:

 

ezgif-1-ec04c1ac7f.gif

 

(*): 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® (The Future of Team-Based LabVIEW Development)


Message 2 of 14
(5,612 Views)

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

 

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
Message 3 of 14
(5,606 Views)

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)?

 

Thanks & Regards,
Bharath Kumar
GCentral
0 Kudos
Message 4 of 14
(5,588 Views)

@பரத்_குமார்(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® (The Future of Team-Based LabVIEW Development)


Message 5 of 14
(5,580 Views)

@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. 

 Add API Tester and Main as Startup VIs.jpg

 

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
Message 6 of 14
(5,568 Views)

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)

 

image.png

 

It throws  error from the Development environment as well

 

image.png

Thanks & Regards,
Bharath Kumar
GCentral
0 Kudos
Message 7 of 14
(5,551 Views)

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).

 

singleton-cloneable.gif

 

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:

 

singleton-cloneables-2.gif

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® (The Future of Team-Based LabVIEW Development)


Message 8 of 14
(5,538 Views)

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

 

0 Kudos
Message 9 of 14
(5,152 Views)

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® (The Future of Team-Based LabVIEW Development)


0 Kudos
Message 10 of 14
(5,144 Views)