MATLAB Answers


LEGO NXT cannot run with simulink either 2012a, 2012b (32 or 64 bits system)

Asked by Michael Tumabcao on 11 Oct 2014
Latest activity Answered by Royalle
on 23 Jun 2017
Hi Simulink Experts, I'm new in using the NXT LEGO via Simulink. My computer is 64Bit windows 7. And i installed Matlab 2012a,2012b(64 bits) & 2012b(32bits). My device managers shows it can detect the NXT via bluetooth and via usb. Also when i install the targetinstaller in matlab it was successful on all 3 versions of Matlab. The Lego demo simulink files can play in simulink domain, however when run through the target it cannot run. I cannot run all the demo, even the getting started demo in my NXT. i tried both the option USB and bluetooth and both seems not working. One test i did also is to do firmware upgrade on the NXT LEGO but this doesn't work. Even though my NXT is powered on, the USB connection is working. and there is no application running on the NXT(freshly powered on), I keep on getting the error "The call to realtime_make_rtw_hook, during the entry hook generated the following error: Connecting to LEGO MINDSTORMS NXT hardware failed. Check that: 1. LEGO MINDSTORMS NXT hardware is powered on. 2. USB connection to the LEGO MINDSTORMS NXT hardware is working. 3. LEGO MINDSTORMS NXT hardware is not running an application. I tried to use my Nxt to find the Bluetooth of my PC, and it can detect my PC name but when i connect my NXT to the PC, it says on the NXT screen "Line is busy". I'b been reading and trying online discussion stuff in many weeks now but it doesn't seems to work. Can anybody please suggest something i can try to make it work? See some attached snap shots of the errors. .


Hi Michael,
Is there any reason you cannot use a newer version of MATLAB/Simulink? It could be that the issues are resolved in the newer versions. I am trying to reproduce the issue on R2014b, but it has been working as expected for me in those versions thus far. It might be that the NXT firmware on your hardware is more up-to-date than the support package for 12a/12b can handle?
To start, I would suggest sticking to getting the USB to work first. Bluetooth on the NXTs can be a bit inconsistent. At the firmware screen that you show, I originally had the same message as you, but after pressing the refresh button, the device appeared as I would have expected.
You may want to make sure that the properties for the NXT appear correct in the device manager. Mine look like:
Do yours look the same?
I'm having the exact same issue as Michael. I am running matlab 2015 and the hardware shows up under devices and printers, both as a usb and bluetooth version of the nxt. Eventually after much playing I was able to get it to communicate over usb although I have to attribute that to black magic. Matlab, when I tell it to communicate with the nxt over bluetooth, gives me the same error michael got. Please help.
I have the same issue but over usb.

Sign in to comment.



1 Answer

Answer by Royalle
on 23 Jun 2017

Same here. USB can be detected, but always fail to connect.


Sign in to comment.