Skip to main content
1-Visitor
Apr 22, 2022 3:37 AM UTC
Solved

Automatically stop auxiliary application after run in Java Free

Currently I run my code by clicking auxiliary application -> start, and after running I have to click stop.

Although this does not affect the functionality of my code even if I do not click stop, is there a way to stop the aux app somehow in the stop method? Just to save a click

 

public static void start () {
 do_something();
}
public static void stop () {
}

 

 

sjurajAnswer
15-Moonstone
Apr 26, 2022 9:34 AM UTC

try to run this via session.RunMacro()

 

~ Command `ProCmdUtilAux` ;
~ Select `aux_apps` `AppList` 1 `<name_of_your_app>`;
~ Activate `aux_apps` `StopBtn`;
~ Activate `aux_apps` `CloseBtn`;

 

from your application

5 replies

15-Moonstone
Apr 22, 2022 6:33 PM UTC

try to create macro and run it from your app to stop itself

Translate
17-Peridot
Apr 25, 2022 11:58 AM UTC

Take a look at pfcJLink.JLinkApplication.Stop

Translate
1-Visitor
Apr 26, 2022 5:55 AM UTC

This looks like what I'm looking for, although going through the API documentation I don't see how to call the currently running JLinkApplication object upon which to apply the stop method? Any chance that you have a code snippet for reference?

Translate
sjuraj15-MoonstoneAnswer
15-Moonstone
Apr 26, 2022 9:34 AM UTC

try to run this via session.RunMacro()

 

~ Command `ProCmdUtilAux` ;
~ Select `aux_apps` `AppList` 1 `<name_of_your_app>`;
~ Activate `aux_apps` `StopBtn`;
~ Activate `aux_apps` `CloseBtn`;

 

from your application

Translate
1-Visitor
Apr 27, 2022 2:42 AM UTC

works perfectly, thanks!

Translate