Page 1 of 1

Bricx variable watch in NXC program

Posted: 15 Mar 2011, 01:20
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)

Re: Bricx variable watch in NXC program

Posted: 15 Mar 2011, 03:56
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.

Re: Bricx variable watch in NXC program

Posted: 15 Mar 2011, 15:54
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

Re: Bricx variable watch in NXC program

Posted: 15 Mar 2011, 18:30
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

Re: Bricx variable watch in NXC program

Posted: 16 Mar 2011, 08:00
by timpattinson
Ok.. I'd love to improve BricxCC
-Tim

Re: Bricx variable watch in NXC program

Posted: 17 Mar 2011, 00:17
by muntoo
Post it here. :)