09-07-2012 09:28 AM
Is there any way to get data from the NXT brick back to the connected PC? Before the Samantha FCS there was the basic Bluetooth (BT) connection, read/write functionality. Now it seems like all the connection functionality resides in either invoke nodes or password protected VIs. Can there be a separate BT connection while Samantha is connected and pass data through that way.
On the host side, can I have a separate VI running to host the BT connection and get the data? Again, before Samantha, teams had access to the controller station source code. Now we cannot add any functionality to the FCS to my knowledge. I completely understand keeping a version of FCS locked down for tournament and official use, but I also see a lot of very smart team members that want to add to their design and testing capabilities. Our team members have used the display on the NXT brick in the past to display code troubleshooting values, like sensor readings. This is a little problematic because you have to stop the robot and have the display in a position to be able to read it.
Thanks,
-Steve
FTC Mentor
Team 4150
09-21-2012 03:20 PM
Hi Steve,
You can pass data back by using NXT mailboxes. In your NXT program (teleop), grab the "Mail (Communication Control)" block found on the NXT I/O Palette. Configure it for "Send To Host" and also select a datatype. You will need to specify a mailbox number (1 - 10). The FCS uses mailbox 1 so don't use that.
In your PC vi, go to the DirectOnly palette, and select the "Read From NXT Mailbox" and specify the same mailbox. You should be able to read data sent from the NXT now.
Note that this can work over any connection type, not just bluetooth. The mailbox is just a memory location on the NXT, and your program running on the PC can inspect that memory over any connection type. That being said, if you are using the official FCS or something other than LabVIEW, LabVIEW won't be able to connect over the Samantha at the same time, so maybe bluetooth is your best bet. If you are using the FCS mode that is part of the joystick application than you should be able to share the connection.
The old controller station source still ships with FTC toolkit, you can find it at LabVIEW dir/Targets/NI/NXT/NXTToolkit/FTC Controller Station Source/
I'm not sure if its password protected/functional etc.
Also, another cool way to get NXT data back onto your PC is to use the "NXT debug mode". In your NXT program create front panel indicators for whatever you want to display, and then when you compile/run your program, instead of clicking the normal run arrow, click the run button that has the little lightbulb next to it.This will cause LabVIEW to try and update the NXT VI's front panel as the program runs with live data. It's a little buggy but it does work for most controls (not clusters).
Let me know if you have any questions,
Ethan Searl