Page 1 of 2
NXT-G GUI behaving weird as code gets longer
Posted: 03 Feb 2012, 23:29
by cfp999
I am a Mindstorms newbie, and until now I have found the NXT-G programming environment more than satisfying. Writing longer and more complex code, I have noticed that the NXT-G interface is beginning to:
- mess up my wires for no apparent reason (must rewire every time I open a program)
- sometimes won’t allow a beam to grow (blocks are getting stacked in a mess on top of each other)
- getting error messages complaining something’s wrong with hotwires when trying to move things around
So my question is: Is this the way it’s going to be? Are these normal symptoms? It seems that every time I try to edit my code, I have to spend a lot of frustrating time fixing things.
Re: NXT-G GUI behaving weird as code gets longer
Posted: 04 Feb 2012, 01:16
by mattallen37
That's just the way it is. It was because of that, and other more severe symptoms (crashing...), that I switched to NXC (using
BCC).
I still open NXT-G on occasion to help someone with their program, but almost never (perhaps once a quarter).
I really suggest you look into using NXC. You can do
so much more than you can with NXT-G, and BCC is far lighter on your computer.
Re: NXT-G GUI behaving weird as code gets longer
Posted: 04 Feb 2012, 08:35
by h-g-t
Yes, even with fairly small programs I found it could be frustrating and moved on to NXC.
I discovered later that NXT-G is programming as you change it.
Most languages wait until you have written your code and only start working on it when you select 'run' or 'compile'.
NXT-G modifies the code in the background every time you add a block or wire.
If you do not give it time to complete these re-writes, either by changing or exiting the program too quickly, it can get confused.
The larger the program the longer modifying the underlying code can take.
The answer is patience - if it is not responding just wait a few seconds.
There are some good tips about using NXT-G here (
http://www.teamhassenplug.org/NXT/), as well as a neat addition which helps to remove broken wires.
Re: NXT-G GUI behaving weird as code gets longer
Posted: 05 Feb 2012, 09:47
by pepijndevos
If you don;t want to work with NXC, there are other visual options, like Matlab and Zenon(or so I heard). But I also recommend a text-based language.
Re: NXT-G GUI behaving weird as code gets longer
Posted: 05 Feb 2012, 10:13
by HaWe
I doubt that Matlab (only remote control, needs a PC host!) or Zenon (never heard - what about community? support?) would be a good choice.
I agree with mattallen37:
IMO, there is no alternative to NXC if you are a beginner.
In case you are already an advanced programmer, there are only 2 alternative options which are worth while to consider:
- nxtOSEK firmware, programmed by "real" ANSI C/C++ e.g. by gnu gpp compiler and the monster IDE "Eclipse"
- LeJOS firmware for Java if you already are experienced in Java (if you're not, I'd suggest to drop this option Java sucks! :) )
Re: NXT-G GUI behaving weird as code gets longer
Posted: 05 Feb 2012, 11:30
by mightor
ROBOTC is also an option, which has a beginner's API called "Natural Language". You can find more info about ROBOTC here: [
LINK].
Another option is LabView, for which there is a Student Version, you can find more info about that here: [
LINK].
I have tried the zenon Science Package and I can assure you that it is not for the faint of heart. However, you can find more info about it here: [
LINK].
Doc, just because you have never heard of it, does not make it a bad piece of software. The zenon Science Package software would probably be excellent for someone who already uses zenon and other COPA-DATA products for embedded software development. They have a forum and so far the people have been very helpful with answering my questions.
- Xander
Re: NXT-G GUI behaving weird as code gets longer
Posted: 05 Feb 2012, 12:40
by HaWe
Xander,
just as an opinion to clarify since I have been approached directly:
I admit that RobotC might be an option if one wants to buy money for a not-quite-C language, and if he will need a transitional "Natural Language".
I assume if one was already working with zenon he might already know about this Lego option but I assume too that this is not very likely in this case.
For someone who is already struggling with the "disconnection & spaghetti syndrome" of NXT-G I would not recommend to use another grafical environment like Labview instead.
Re: NXT-G GUI behaving weird as code gets longer
Posted: 05 Feb 2012, 20:21
by pepijndevos
Ah, when I said matlab, I think I meant labview. Anyway, there's also pbLua, which is nice and easy, but requires a custom firmware.
The only thing that really bothered me with pbLua is that while the REPL is very cool, it doesn't have an obvious way to store files.
Re: NXT-G GUI behaving weird as code gets longer
Posted: 05 Feb 2012, 20:48
by HaWe
you won't seriously recommend a Mindstorms newbie tu use pbLua...?
Re: NXT-G GUI behaving weird as code gets longer
Posted: 06 Feb 2012, 11:53
by cfp999
Thanks for all your comments, info and suggestions! When I started out, I wanted to learn NXT-G. Well, obviously because it came with the box and I wanted to be able to teach my kids something not overly advanced. Over the past couple of weeks I have enjoyed trying to “translate†NXC code to NXT-G to improve my tutoring skills. Like the cool “Minesweeper†described in this book:
http://tinyurl.com/72ku6oj
Apart from the weird NXT-G behavior, I am now beginning to reach the top of the NXT memory capacity with my code. I will try to use Myblocks more, and other tips. In the meantime, I would love to check out some of the text-based languages. From searching the net I get the feeling that NXC is very popular. RobotC on the other hand comes with a simulator. Are the two very similar in terms of syntax? Will I be able to switch between them, once I start to get the hang of one of them?