NXTRegulatedMotor program exit

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

NXTRegulatedMotor program exit

Postby luca.manzo » Tue Feb 14, 2012 9:55 am

Hi
Using NXTRegulatedMotor give me a strange problem when exiting the program... it doesn't exit normally, but hangs with the message 'program exit' on the LCD and I have to restart the brick removing the batteries

Someone had a similar issue?

thanks
luca.manzo
New User
 
Posts: 1
Joined: Tue Feb 14, 2012 9:29 am

Re: NXTRegulatedMotor program exit

Postby gloomyandy » Tue Feb 14, 2012 11:09 am

Do you have a small test program that demonstrates this problem? What version of leJOS are you using? When the "program exit" message is displayed can you restart the NXT by pressing enter+escape (you may need to do this multiple times)?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4181
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NXTRegulatedMotor program exit

Postby skoehler » Tue Feb 14, 2012 2:12 pm

Please update the Eclipse plug-in. For a short time, there was a version of the Eclipse plug-in on the server which included the Debug Monitor by default.
The current version is 0.9.0.201202141140
skoehler
leJOS Team Member
 
Posts: 1449
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXTRegulatedMotor program exit

Postby marvin » Sat Mar 24, 2012 1:40 pm

Hello,

I have got the plugin leJOS Development Tools, Version: 0.9.0.201202141552 installed and still have the same problem.

Is there another solution?

Thank you very much.

Bye marvin
--
I am feeling very depressed...
marvin
Novice
 
Posts: 26
Joined: Mon Mar 19, 2012 12:47 am

Re: NXTRegulatedMotor program exit

Postby marvin » Sun Mar 25, 2012 11:22 am

Hello, it's me again ;-)

I checked a bit and found in lejos.nxt.NXTRegulatedMotor this:

Code: Select all
static {
        // Start the single controller thread
        cont.setPriority(Thread.MAX_PRIORITY);
        cont.setDaemon(true);
        cont.start();
        // Add shutdown handler to stop the motors
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {cont.shutdown();}
        });
    }


I think the problem has something to do with this shutdown hook. But I do not understand why - to me the code in cont.shutdown() reads correct. Well but I am a beginner in java... ;-)

How can I check this quickly? Do I have to pack the classes.jar all the time or how could I overwrite NXTRegulatedMotor only?

Thank you,
marvin
--
I am feeling very depressed...
marvin
Novice
 
Posts: 26
Joined: Mon Mar 19, 2012 12:47 am

Re: NXTRegulatedMotor program exit

Postby gloomyandy » Sun Mar 25, 2012 1:27 pm

The "Program exit" message is being displayed by the leJOS debug monitor, so one way or another you have that code linked into your program. It may not be handling the program exit case very well. Can you get back to the menu by pressing exit+escape multiple times? To se if the debug monitor is being linked with your code enable verbose linker output and check the linker class list to see if it includes the DebugMonitor class if so then you need to work out why the class is present. It will normally be included as a result of the various linker debug options. You may want to try turning them on in the eclipse options building your program then turn them off again. It may be that an older version of the plugin has set them in the build file. If all else fails try creating a new project and copy your code into that....

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4181
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NXTRegulatedMotor program exit

Postby marvin » Sun Mar 25, 2012 3:12 pm

Hello Andy,

thank you for your reply. It helped me to solve my _really simple_ mistake: I used the debug button instead of the run button in eclipse #-]

Yes the Enter + Exit Button worked all the time. I have verbose linker output active and of course the DebugConsole was linked in ;-) The only question left is how to set the linker options in the eclipse workspace? I did not find the difference between the debug and the run linker scripts... I may be blind to them...

Thank you again :-)
marvin
--
I am feeling very depressed...
marvin
Novice
 
Posts: 26
Joined: Mon Mar 19, 2012 12:47 am


Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests

more stuff