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

NXC: import NXT-G blocks into NXC code?

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

NXC: import NXT-G blocks into NXC code?

Postby doc-helmut » 20 Mar 2011, 11:34

hi,
is it possible to import NXT-G blocks into NXC code and use their built-in functionality via input pins and output pins e.g. like variables passed to a NXC function?
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: NXC: import NXT-G blocks into NXC code?

Postby mightor » 20 Mar 2011, 12:01

Not unless you look at how they work internally and code an NXC equivalent yourself. Not all blocks can be viewed in LabView without a password.

You can download a student version of LV for free and try it yourself.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
User avatar
mightor
Site Admin
 
Posts: 1060
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands

Re: NXC: import NXT-G blocks into NXC code?

Postby doc-helmut » 20 Mar 2011, 12:06

[T]oo complicated. I wanted to use the block "as a black box", included like an #include function or library.
But I meant NXT-G, not Labview. Anyway, probably it's the same.

Nevertheless, it would be a great thing if would be possible though...
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: NXC: import NXT-G blocks into NXC code?

Postby mightor » 20 Mar 2011, 12:13

The problem is that the LV compiler used to make the RXEs is not open source, so it wouldn't be possible to integrate with NXC.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
User avatar
mightor
Site Admin
 
Posts: 1060
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands

Re: NXC: import NXT-G blocks into NXC code?

Postby ronmcrae » 23 Mar 2011, 21:25

doc-helmut wrote:hi,
is it possible to import NXT-G blocks into NXC code and use their built-in functionality via input pins and output pins e.g. like variables passed to a NXC function?


One thing I've done with some success is to create a very small NXT-G program that included the block I was interested in (the move block). Compile the program then upload the RXE into BricxCC and by some careful detective work you can figure out the exact section of code that relates to the block. Then by repeating the procedure while changing various parameters on the configuration panel of the block (just one at a time!) it was possible to determine which NBC variables are being used to pass those parameters to the 'block'. With all that done I did some global renaming of the variables, then cut and pasted the relevant NBC code to create an NXC function.

This was not trivial by any means, but it was a fun exercise.

Ron.
ronmcrae
 
Posts: 33
Joined: 28 Sep 2010, 14:56

Re: NXC: import NXT-G blocks into NXC code?

Postby doc-helmut » 23 Mar 2011, 21:31

reverse engineering, eh? :geek:

Edited by Mightor: This troll has been banned for a day.
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: NXC: import NXT-G blocks into NXC code?

Postby doc-helmut » 24 Mar 2011, 23:57

haha, lets formulate it differently: 8-)
do you think you can reversely engineer an I²C block with "multiple functionality"? :ugeek:
:roll:
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: NXC: import NXT-G blocks into NXC code?

Postby mattallen37 » 25 Mar 2011, 00:40

Well, you seem to have ruled out programming errors, so are you looking for timing issues? I think you would have a much easier time finding it in ROBOTC, than in NXT-G (I think it would have to be the education version). It is supported by ROBOTC, isn't it? Why don't you look at how the drivers are made, and attempt to translate them into NXC (or NBC if you like really low level stuff, like what it would take to translate the NXT-G code)?
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: NXC: import NXT-G blocks into NXC code?

Postby mightor » 25 Mar 2011, 05:58

ROBOTC support is in the actual firmware, so the drivers are exposed through the same motor*[] arrays and functions. You would still need a protocol analyser.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
User avatar
mightor
Site Admin
 
Posts: 1060
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands

Re: NXC: import NXT-G blocks into NXC code?

Postby mattallen37 » 25 Mar 2011, 06:10

Ah, okay. Is the FW open-source?
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 2 guests

cron