IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> .NXC to .RXE to .NXC
muntoo
post Feb 14 2009, 11:50 PM
Post #1


The Great Evil Genius
***

Group: Members
Posts: 1,069
Joined: 17-January 09
From: Your Worst Nightmare
Member No.: 6,714



Here are a few questions I have...

1) Is there any way to convert .nxc to .rxe, and then back to the original .nxc?

2) Is there any way to convert .nxc to .rxe, without having to connect to the NXT? Is there one that doesn't require you to use CMD.exe?


--------------------
Muntoo
The Great Evil Genius
Go to the top of the page
 
+Quote Post
WikiY
post Feb 15 2009, 02:59 AM
Post #2


Advanced Member
***

Group: Members
Posts: 323
Joined: 20-September 07
From: California, USA
Member No.: 3,931



1) You can compile .nxc to .rxe, then decompile to .nbc, but not to .nxc because the "high-level" structure information was lost when you compiled it to bytecodes. If the program was simple enough, you might still be able to look at the bytecodes and manually rewrite it NXC, though I would think that would be difficult and tedious.

2) In BricxCC, go to the "Tools" menu and open "Configure Tools...". Click "Add". Put something like "Compile to File" for the title. Click "Browse...". Find nbc.exe in your BricxCC install directory (usually "C:\Program Files\BricxCC\nbc.exe"). Put the text in the code box below in the "Parameters:" box.
$SAVE -Z1 -EF -E="$PATH($EDNAME)errors.log" -O="$PATH($EDNAME)$NAMEONLY($EDNAME).rxe" "$EDNAME"
(remove the -EF flag if you are not using enhanced firmware)
Click "OK", then "Close".

To use, have the file you want to compile open in the code editor. Then, go to "Tools" and find your menu item at the bottom of the list. When you click it, the command prompt window should briefly appear on the screen and you should find a .rxe file in the same directory and same name as your .nbc/.nxc source file. Any errors are printed in an errors.log file with the .rxe file. An empty .log file means a successful build. Hit F5 or click the "Compile program" on the toolbar before you build to check for errors. It will say "Program compiled sucessfully" if there were no errors, but you still need to use your custom menu option to compile to a file.

This is how I've been doing it. If there already was a "Compile to file" option in Bricxcc, I haven't found it yet.
Do Not Use! This is a horrible hack.
BricxCC already has
Save Compiler Output.

See NXTBoy's post below.


--------------------

Go to the top of the page
 
+Quote Post
NXTboy
post Feb 15 2009, 03:56 AM
Post #3


Advanced Member
***

Group: Members
Posts: 477
Joined: 1-September 07
From: UK
Member No.: 3,844



QUOTE(WikiY @ Feb 15 2009, 07:59 AM) *
1) You can compile .nxc to .rxe, then decompile to .nbc, but not to .nxc because the "high-level" structure information was lost when you compiled it to bytecodes. If the program was simple enough, you might still be able to look at the bytecodes and manually rewrite it NXC, though I would think that would be difficult and tedious.

2) In BricxCC, go to the "Tools" menu and open "Configure Tools...". Click "Add". Put something like "Compile to File" for the title. Click "Browse...". Find nbc.exe in your BricxCC install directory (usually "C:\Program Files\BricxCC\nbc.exe"). Put the text in the code box below in the "Parameters:" box.
CODE
$SAVE -Z1 -EF -E="$PATH($EDNAME)errors.log" -O="$PATH($EDNAME)$NAMEONLY($EDNAME).rxe" "$EDNAME"

(remove the -EF flag if you are not using enhanced firmware)
Click "OK", then "Close".

To use, have the file you want to compile open in the code editor. Then, go to "Tools" and find your menu item at the bottom of the list. When you click it, the command prompt window should briefly appear on the screen and you should find a .rxe file in the same directory and same name as your .nbc/.nxc source file. Any errors are printed in an errors.log file with the .rxe file. An empty .log file means a successful build. Hit F5 or click the "Compile program" on the toolbar before you build to check for errors. It will say "Program compiled sucessfully" if there were no errors, but you still need to use your custom menu option to compile to a file.

This is how I've been doing it. If there already was a "Compile to file" option in Bricxcc, I haven't found it yet smile.gif.


There is a compile to file option:
Edit->Preferences->General->Save compiler output

After doing this, every compile (not compile and download, just compile) saves in the same place as the source. The occasional "compile error" alert is due to the file not yet habing been saved.

NXTBoy


--------------------
Lego Mindstorms StackExchange proposal - Follow it here!

Technobotts - UK Robocup Junior Champions 2010            NXTraordinary - My robotics blog
Go to the top of the page
 
+Quote Post
WikiY
post Feb 15 2009, 02:14 PM
Post #4


Advanced Member
***

Group: Members
Posts: 323
Joined: 20-September 07
From: California, USA
Member No.: 3,931



QUOTE(NXTboy @ Feb 15 2009, 12:56 AM) *
There is a compile to file option:
Edit->Preferences->General->Save compiler output

After doing this, every compile (not compile and download, just compile) saves in the same place as the source. The occasional "compile error" alert is due to the file not yet habing been saved.

NXTBoy

I need to look harder next time... blink.gif
Had thought "Save Compiler Output" meant compiler messages and not the program.


--------------------

Go to the top of the page
 
+Quote Post
muntoo
post Feb 15 2009, 04:19 PM
Post #5


The Great Evil Genius
***

Group: Members
Posts: 1,069
Joined: 17-January 09
From: Your Worst Nightmare
Member No.: 6,714



QUOTE(WikiY @ Feb 15 2009, 11:14 AM) *
I need to look harder next time... blink.gif
Had thought "Save Compiler Output" meant compiler messages and not the program.


Thanks, NXTboy. I hadn't noticed that, I guess. I tried looking in the other tabs related with compiling, but didn't look in the General tab.


--------------------
Muntoo
The Great Evil Genius
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



Lo-Fi Version Time is now: 1st August 2010 - 04:35 AM