I am new both in ROBOTC and Mindstorms, can you please let me know if ROBOTC is able to hande a database? I didn't find much relevant info about this in the ROBOTC manual.

Thanks a million in advance,Horeg

Wed Jan 04, 2012 5:56 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Can ROBOTC handle a database?

horeg wrote:

Hello all,

I am new both in ROBOTC and Mindstorms, can you please let me know if ROBOTC is able to hande a database? I didn't find much relevant info about this in the ROBOTC manual.

Thanks a million in advance,Horeg

What do you mean by "handle a database"?

Wed Jan 04, 2012 6:03 pm

horeg

Rookie

Joined: Wed Jan 04, 2012 5:32 pmPosts: 4

Re: Can ROBOTC handle a database?

Something like for instance I can store data in an external file and then load it into the running software as needed? In other words, I would like to construct a robot that can store a large amount of data in an external file (database) and then recall fragments of data from this background storage.

Wed Jan 04, 2012 6:11 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Can ROBOTC handle a database?

RobotC does support file I/O. The simplest way to do it is to store the file in .csv format (comma separated fields in a text file). You can then transfer the file to a Windows PC and have Excel to open it or you can create the CSV file on a Windows PC, transfer it to the NXT and have RobotC open and read the data.

Wed Jan 04, 2012 6:15 pm

horeg

Rookie

Joined: Wed Jan 04, 2012 5:32 pmPosts: 4

Re: Can ROBOTC handle a database?

MHTS wrote:

RobotC does support file I/O. The simplest way to do it is to store the file in .csv format (comma separated fields in a text file). You can then transfer the file to a Windows PC and have Excel to open it or you can create the CSV file on a Windows PC, transfer it to the NXT and have RobotC open and read the data.

If you're a very good programmer, you could use some kind of tiered approach with a WiFi sensor and a database server with a front-end on a Linux or Windows box. The NXT does transactions over WiFi to the DB server.

How big is the amount of data you're planning to store? 10K? 100K? As far as I know, files need to be contiguous, that is, not fragmented. The bigger the files, the harder it will be to satisfy this requirement. That is also why you need to specify the size of the file you wish to write to when you create it.

The short answer: yes, as many have pointed out. The longer answer: probably not.

If you intend you write a database on the NXT, the lack of pointers is going to slow you down to a stop almost completely. If you take the approach of using wifi, as Xander suggested (and I would as well if you're brave) you will find the technology in its early stages, and you will probably have to discover, diagnose, work around as much with the communications protocol as you would the database protocol. With a ton of patience, you probably can do it, and you will be the first and only so far.

If (more and likely it sounds like) you are just looking for data storage, as opposed to a database, then the file IO is ok for small amounts of data, or large amounts only if you want to access it sequentially in entirety each time, or append only when writing. There are no read/write at offset type functions that I am aware of, and are critical to accessing 'records'.

I hate to be the pessimist, but I am also the realist. If you have a particular plan for data in mind, run it by us here. maybe someone will have some ideas.

Thank you very much for your answers and I apologize for being back so late. My robot project was on hold for a year but I am now about to get a fresh start. This will be really a fresh one as I have only limited experience in programming, some experience with C back in 1997 and Basic 3.14 back in 1986. I want to try to write a sw that can learn. I have a kind of (psychological-logical) theoretical model for that that I would like now to implement into a sw. I believe in learning by doing so my model is far from being complete. For first I think I will try to connect visual and tactile information with each other so that the robot would herself make the abstractions by continuously grouping and regrouping the acquired information. This grouping and regrouping must take place in an external database/data storage as the memory of the brick will be very probably too small for this. But I was not sure if RobotC is able to handle such a database or I should look for some other SW.

Tue Jan 22, 2013 11:15 am

amcerbu

Novice

Joined: Sun Oct 21, 2012 10:01 pmPosts: 76

Re: Can ROBOTC handle a database?

You'll be happy to know that the RobotC folks added official support for pointers. There're still some bugs (dereferencing a pointer that's not set to an initialized variable's location crashes the NXT), and there's no dynamic memory access, but you can do a lot more now.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum