Bricx variable watch in NXC program

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
timheywood
Posts: 2
Joined: 15 Mar 2011, 01:05

Bricx variable watch in NXC program

Post by timheywood »

Probably a newbie question (I am what I am!) but in debugging an NXC program in the latest version of Bricx and using an NXT v1.0 brick, I can't seem to figure out how to use 'Watching the Brick' or 'Configurable Watch', to view variables I've declared in my program. It's helpful to view polled sensor values but I assume there's a way to see my own vars. Given that I've used other embedded IDE's at work, I thought I could figure it out, but no luck so far. Can anybody help?

Tim (New First Lego League coach)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Bricx variable watch in NXC program

Post by mattallen37 »

Is BCC connected to the brick? Are you able to download programs from BCC?

You say you have a 1.0 brick. You definitely should upgrade it to a 2.0 (change the Firmware). I recommend using enhanced FW 1.31 (the latest and greatest lego compatible FW). This might solve your problem.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
timheywood
Posts: 2
Joined: 15 Mar 2011, 01:05

Re: Bricx variable watch in NXC program

Post by timheywood »

Thanks, Matt. I upgraded to v1.31 FW and that did the trick as far as seeing my task variables in the Configurable Watch window.

One remaining question on the 'Watching the brick' window: What are the 32 variables and how are they used? Are they just processor registers? Is there any reference document that explains this? I've been searching but have so far come up empty.

Tim
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricx variable watch in NXC program

Post by afanofosc »

I suggest that you download the latest BricxCC release (3.3.8.9) which I uploaded yesterday. The 3 different NXT variable watch windows that are now available all use the symbol file created by the compiler to help you figure out which variable to watch. The original watch window is based around the RCX having only 32 global variables total. So 32 possible variable watches. With the NXT these are the first 32 variables in your program's dataspace. With the latest BricxCC if you bring up this window after compiling and downloading a program to your NXT you should see a hint when you mouse over the variable value field. This hint should help you figure out which if any of these 32 variables would be one that you want to watch. The variable names are decorated with the name of the function or task where they are defined if they are local variables. Global variables are not decorated. Rather than use this window to watch variables, though, I would use either the configurable watch or the brand new NXT variable watch tool. This is modeled after the Delphi watch window. You add watches to the window. The dialog that lets you add a watch has a drop down list of all the variables which it loads from the symbol file.

If anyone was interested in helping me update the BricxCC help file to describe NXT variable watching I would be grateful. It would involve taking screenshots and editing an html file, basically.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: Bricx variable watch in NXC program

Post by timpattinson »

Ok.. I'd love to improve BricxCC
-Tim
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: Bricx variable watch in NXC program

Post by muntoo »

Post it here. :)
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests