LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Yet another bluetooth PC/NXT

It's discussed many time over forum and I saw some examples but still missing something obvious..

 

I want an LabView application (standalone in future) running on PC and receiving some data (let's say telemetry) from NXT (standalone)

I have an algorithm emplemented and runing on autonomos robot and just want get some data from the robot.

 

I've tried some examples like ComputerControledNXTCar.vi and BluetoothDriveReceive.vi and that one

But without succes. I run code on nxt and host, I have an NXT connected via bluetooth, but there is no exchange beetween Mailboxes. Realy miss something.

Also not sure about Direct and Standalone modes. Is it possible to use mailbox system in standalone mode? Should I open the connection with the Bluetooth connect block an on which side?

 

Any advice would be appreciated.

Thanks!

0 Kudos
Message 1 of 23
(7,932 Views)

I believe the difference between Standalone and Direct mode is that Direct the device recieves commands from the computer while standalone does not. This would imply that you cannot use the mailbox system in standalone mode because there is only one 'thing' running.

 

Have you been able to check out the document help page for direct mode? This page gives instructions for connecting via Bluetooth: http://zone.ni.com/reference/en-XX/help/372962A-01/lvnxt/directmode/

 

Here is the entire help document for NXT: http://zone.ni.com/reference/en-XX/help/372962A-01/

0 Kudos
Message 2 of 23
(7,906 Views)

Thanks samazing,

 

Ok, I understood the difference between Standalone and Direct mode and realize that mailbox system not suitiable for standalone mode.

But there must be an opportunity to send data to labview from NXT running standalone.

0 Kudos
Message 3 of 23
(7,903 Views)

The other thing that confused me is that in that example said "Connect the NXT to the Computer either through USB or bluetooth.  Deploy the NXT code and get it running on the NXT.  Then run the Host code and see.."

 

I consider that "Deploy and Run on the NXT"  is Standalone mode.

0 Kudos
Message 4 of 23
(7,898 Views)

According to the following pages of the documentation, you should be able to establish  the communication in remote mode, with the steps mentioned here:

 

http://zone.ni.com/reference/en-XX/help/372962A-01/lvnxt/remotemode/

 

and after establishing the connection, you should be able to read or send data from the NXT brick to a host PC (it says that it can't be a client), with what is mentioned in this document.

 

http://zone.ni.com/reference/en-XX/help/372962A-01/lvnxt/sendingreadingbluetoothmessages/

 

 

Cheers,

0 Kudos
Message 5 of 23
(7,861 Views)

Thanks RichieTheBard,

For me it's not working for a strange reason or smth I miss. I use LV2014 and NXT (fw1.31). I connect to NXT and able to download programs. I've tried to run host VI as Main Application Instance and client as Main Application Instance and on NXT. Both are not working.

 

Anyway, is there a way to run my program on NXT (I need fast response) and just send some data to VI unning on the computer?

 

Regards!

0 Kudos
Message 6 of 23
(7,855 Views)

Hey... it might be a bug. Double click the NXT/EV3 mailbox VI to open the VI and change the "Read NXT Outbox" parameter to true. See if that fixes your problem...

 

You're going to want to run the client code in "Target to NXT" mode and the host code in "Target to Computer" mode.

0 Kudos
Message 7 of 23
(7,846 Views)

Sorry garrett8357,

 

If I double click on Read mailbox node  I see this:

1.png

 

Where to find "Read NXT Outbox" parameter?

 

Thanks!

0 Kudos
Message 8 of 23
(7,762 Views)

Go to block diagram (ctrl + E) or from the Window menu, and then open up Bluetooth Read String and the parameter is shown on that block diagram

0 Kudos
Message 9 of 23
(7,757 Views)

Thanks garett8357,

 

It's working finally! Thanks a lot.

 

However I have another noob question.. Unfortunally I don't get LabView execution flow quite well:

My program going to be like:

  1. Execute some referencing code
  2. Read my I2C sensors
  3. Move robot acording sensors state (case structure)
  4. Send data to PC host (anytime)

Is it possible to have several While Loops in the patch running in parallel?

I've tried different approaches:

1.png

 

When I enter Case structure I lose Mailbox connection for both mailboxes (inside and outside the structure). 

 

So i've tried another approach where Case structure is outside of I2C and Bluetooth loop:

2.png

In this case for some reason I can't transfer selector value to the structure from while loop tunnel.

 

Mb it's better to start another topic, but I don't want to flood the forum with my noob questions. Any advice would be appreciated.

0 Kudos
Message 10 of 23
(7,684 Views)