NXT Mindstorms 2.0 Program Size limit

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
jcatricala
Posts: 2
Joined: 04 Oct 2012, 00:52

NXT Mindstorms 2.0 Program Size limit

Post by jcatricala »

Is there a limit to the size of an NXT program? Even though I may have 90kbs+ of space can I use it all for single application?
inxt-generation
Posts: 290
Joined: 03 Oct 2011, 00:06
Location: Gallifrey
Contact:

Re: NXT Mindstorms 2.0 Program Size limit

Post by inxt-generation »

The only limit is your imagination. And how much memory is on the NXT. So yes, the programs can be as large as you want, as long as they don't hit the memory limit.
A.K.A. NeXT-Generation.
"A kingdom of heaven for RobotC now has recursion!"
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT Mindstorms 2.0 Program Size limit

Post by mattallen37 »

If you use NXT-G I have a feeling your computer would crash before you build a 90kB program (NXT-G does not run well on a computer, especially when the program get large).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
inxt-generation
Posts: 290
Joined: 03 Oct 2011, 00:06
Location: Gallifrey
Contact:

Re: NXT Mindstorms 2.0 Program Size limit

Post by inxt-generation »

mattallen37 wrote:If you use NXT-G I have a feeling your computer would crash before you build a 90kB program (NXT-G does not run well on a computer, especially when the program get large).
This is true. I have nightmares about NXT-G and its slowness and glitchiness.
A.K.A. NeXT-Generation.
"A kingdom of heaven for RobotC now has recursion!"
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: NXT Mindstorms 2.0 Program Size limit

Post by hassenplug »

I think the actual limit is around 59kb. I'm sure John knows the exact size, but the limit is between 50 and 60kb. I have written a program in Labview that I had to reduce to get under the limit.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
jcatricala
Posts: 2
Joined: 04 Oct 2012, 00:52

Re: NXT Mindstorms 2.0 Program Size limit

Post by jcatricala »

Thank you Steve, I knew that it wasn't anywhere close to 90kbs. This isn't usually a problem except for FLL where the students that I coach begin to combine missions so that they have only one program (with a menu) to run.
I'll pass the information on.
John
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXT Mindstorms 2.0 Program Size limit

Post by HaWe »

I think the actual limit is around 59kb
Available memory of course is the RAM size for code plus variable memory plus fw (bytecode interpreter, VM).
So my guess also was sth close to 60 kB for code plus variable memory, the rest up to 64 kB is for the VM.

The max variable memory I ever could allocate was round 30 KB (once for an astar and in another case, for a neural net), in that case the code was limited to about 30 kB, too.
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: NXT Mindstorms 2.0 Program Size limit

Post by hassenplug »

doc-helmut wrote:Available memory of course is the RAM size for code plus variable memory plus fw (bytecode interpreter, VM).
There is a program size limit, that is different from the available memory. It has something to do with how programs are stored in the RAM.

Oh, that's another important point. Programs must occupy consecutive RAM. So, sometimes a program won't fit, because there is no single block that's large enough because of deleted files and such. If you delete all the files, and download them again, you may find more programs will fit.

Labview has a tool for doing this. I'm not sure if it's available in NXT-G.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXT Mindstorms 2.0 Program Size limit

Post by HaWe »

I expressed myself probably wrong.
you wrote "the actual limit is around 59kb".
I agree, because the RAM is 64kByte, and I assume that the fw/VM takes the remaining (first) 4-5kB or what ever.

But I wanted to express that the 59 ? kByte for program code depends on how much the code is allocating variable memory,
so it might be max 59 kByte but maybe even much less (e.g., 30 kByte code limit if the code needs additionally 30 kByte for variables).

CMIIW, but IMO the "deleted files issue" is an issue of the 256 kByte flash memory ("linear" unfragmented vs. fragmented files), not of the 64 kByte RAM.
So source code stored on the flash which should be larger than these 59 kByte probably would never fit into the RAM and so never could be executed.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT Mindstorms 2.0 Program Size limit

Post by mattallen37 »

Programs are stored in flash, not RAM. There is about 30k of RAM available to the user, and it seems quite independent of the program size.

The ARM 7 HW in the NXT has 256k of flash, and 64k of RAM. Obviously a large chunk of each is used by the FW, VM, and other resources.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 7 guests