LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

bluetooth messages between 2 NXT

Hi there,

I have a problem using bluetooth comunication between 2 nxts.

Everything works fine, if i send only one message.

But if i want to send 2 Messages to the same mailbox, it seems like the old message is still in the mailbox and doesnt get cleared after reading.

In the help i found this: "When you read the message, the program removes the message from the mailbox."


So I build a programm that sleeps till the first message comes in. Then it showes the text of the message. Everything fine so far.

Then i want to do the same thing again sleep till an other message comes in and show the text. But it skips through the sleep process since there is allready a message in the mailbox and shows the old one.

 

Im using Labview 12.0.1f3 and my NXT bricks have the firmeware 1.31

 

Is this a known bug or am i doing something wrong?

I also found this in the internet: https://sites.google.com/site/tuftsceeok12projects/lesson-plans/text-messenger

 

but if i reprogramm it or use the code given at the bottom it spams the sound because it allways thinks new message new message..... even if nothing is send.

 

Hope you understand what i mean 🙂 and some knows a solution

 

Greetings

0 Kudos
Message 1 of 7
(6,546 Views)

Hi Moritz,

 

do you still have this issue?

Normaly, this should not happen... My first idea would be that for some reason or another, the NXT-brick abords the execution of the read/delete function

What happens if you delete the message again, after you've red it? does that resolve the issue?

 

Oliver

0 Kudos
Message 2 of 7
(6,520 Views)

Hi,

yea the problem still occure. The message stays in the inbox. As far as i know there is no message delete function. The help says When you read the message, the program removes the message from the mailbox.


So my programm is just like a case strukture linked to the mail funktion and that in an infinite loop. And it executes the case lets say if i send a 5 all the time and not one time 5 and than default....

 

0 Kudos
Message 3 of 7
(6,509 Views)

Ok i have a workaround now.

I send a message from nxt1 to nxt2.

I let nxt 2 send a message to nxt1 that he recieved the message.

Now i let nxt1 overwrite the messages with some bull**bleep** so i know ok message received.

 

not the best way of doing this but its still ok.

I also let the messages send each other like 10 times, otherthise they sometimes get lost.

 

Im still interested if it is "working as intended" that the message stays in the inbox.

0 Kudos
Message 4 of 7
(6,501 Views)

Ok that doesnt quit work allways 😞

 

sometimes its just not possible to overwrite messages eg. i send a 1 to host host reads 1 then i send 100 times the 2 with a while function. but there is still the one in the mailbox 😞

 

someone knows why?

0 Kudos
Message 5 of 7
(6,491 Views)

Hi Moritz,

Looks like you have found a bug in the NXT module that was recently introduced.

You can fix it somewhat simply.

Open the following VI on disk.

C:\Program Files (x86)\National Instruments\LabVIEW 2012\vi.lib\NXT\Remote Library\Message\NXT_ReadMessage.vi

 

You will see two NXTSystemCall method nodes on the block diagram. They both have an optional parameter named "Remove(T)".

Create and wire true constants to both of them and save the vi. You may not be able save the file at first because it is readonly. Just change it to writeable.


I think that will fix your issue. I'm not sure when or how this parameter started defaulting to false. I will make sure this is fixed in the next NXT update.

Thanks for reporting this issue!

 

Message 6 of 7
(6,403 Views)

Thank you.

Allready found it. Did exactly what you said some days ago and it worked.

0 Kudos
Message 7 of 7
(6,395 Views)