1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

NXT Mindstorms 2.0 Program Size limit

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.

NXT Mindstorms 2.0 Program Size limit

Postby jcatricala » 04 Oct 2012, 01:01

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?
jcatricala
 
Posts: 2
Joined: 04 Oct 2012, 00:52

Re: NXT Mindstorms 2.0 Program Size limit

Postby inxt-generation » 04 Oct 2012, 01:10

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!"
User avatar
inxt-generation
 
Posts: 290
Joined: 03 Oct 2011, 00:06
Location: Gallifrey

Re: NXT Mindstorms 2.0 Program Size limit

Postby mattallen37 » 04 Oct 2012, 01:19

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 ;)
User avatar
mattallen37
 
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA

Re: NXT Mindstorms 2.0 Program Size limit

Postby inxt-generation » 04 Oct 2012, 01:21

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!"
User avatar
inxt-generation
 
Posts: 290
Joined: 03 Oct 2011, 00:06
Location: Gallifrey

Re: NXT Mindstorms 2.0 Program Size limit

Postby hassenplug » 04 Oct 2012, 13:03

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 --->
User avatar
hassenplug
 
Posts: 346
Joined: 27 Sep 2010, 03:05

Re: NXT Mindstorms 2.0 Program Size limit

Postby jcatricala » 04 Oct 2012, 13:10

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
jcatricala
 
Posts: 2
Joined: 04 Oct 2012, 00:52

Re: NXT Mindstorms 2.0 Program Size limit

Postby doc-helmut » 04 Oct 2012, 20:27

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.
regards,
HaWe
±≠≈αγδεωΔΦΣ∫√∅∞
NXC CHESS for NXT: http://www.mindstormsforum.de/viewtopic.php?f=70&t=6790
indispensable for NXC + EV3-C: easy + trouble-free network & sensor+motor remote control for rs485, BT, USB!
User avatar
doc-helmut
 
Posts: 2425
Joined: 29 Sep 2010, 14:25

Re: NXT Mindstorms 2.0 Program Size limit

Postby hassenplug » 05 Oct 2012, 13:18

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 --->
User avatar
hassenplug
 
Posts: 346
Joined: 27 Sep 2010, 03:05

Re: NXT Mindstorms 2.0 Program Size limit

Postby doc-helmut » 05 Oct 2012, 13:53

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.
regards,
HaWe
±≠≈αγδεωΔΦΣ∫√∅∞
NXC CHESS for NXT: http://www.mindstormsforum.de/viewtopic.php?f=70&t=6790
indispensable for NXC + EV3-C: easy + trouble-free network & sensor+motor remote control for rs485, BT, USB!
User avatar
doc-helmut
 
Posts: 2425
Joined: 29 Sep 2010, 14:25

Re: NXT Mindstorms 2.0 Program Size limit

Postby mattallen37 » 05 Oct 2012, 14:09

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 ;)
User avatar
mattallen37
 
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA

Next

Return to Mindstorms Software

Who is online

Users browsing this forum: No registered users and 3 guests