04-19-2010 06:38 PM
Hi i'm having trouble trying to figure out how to do this. Im using labview with bluetooth modules. When you call another module you need the address of that module. To find the address you tell your module to inquiry. When the inquiry comes back it is in this format:
INQUIRY_PARTIAL 00:07:80:93:54:97 001f00
INQUIRY_PARTIAL 00:23:d6:a9:0a:b0 5a020c
INQUIRY 2
INQUIRY 00:07:80:93:54:97 001f00
INQUIRY 00:23:d6:a9:0a:b0 5a020c
I'm trying to pull out every istance of the address in the format :
00:07:80:93:54:97
This inquiry found 2 module with 2 different address. I just want to pull out every address and display just the addresses in a string. So my indicator should display:
00:07:80:93:54:97
00:23:d6:a9:0a:b0
Solved! Go to Solution.
04-19-2010 11:17 PM
04-19-2010 11:51 PM - edited 04-19-2010 11:51 PM
Try something like this:
(Of course you can get more fancy for the address matching, because only 0..f are legal elements, but this should probably work.)
04-20-2010 12:23 AM
Thank you for the replies. I actually did figure it out using this method
04-20-2010 12:32 AM
ajh305 wrote:I actually did figure it out using this method
![]()
04-20-2010 05:28 AM
04-20-2010 10:10 AM
jcarmody wrote:
Here's a different implementation using Spreadsheet String to Array and OpenG's Remove Duplicates from 1D Array.
04-20-2010 03:34 PM
Here is some of the recieved information that the program I wrote sifts through:
WRAP THOR AI (3.0.0 build 165)
Copyright (c) 2003-2008 Bluegiga Technologies Inc.
Was Recieved
4/20/2010
3:09:33 PM
READY.
Was Recieved
4/20/2010
3:09:34 PM
inquiry 5
Was Recieved
4/20/2010
3:09:38 PM
INQUIRY_PARTIAL c8:7e:75:6d:75:6b 5a0204
Was Recieved
4/20/2010
3:09:39 PM
INQUIRY_PARTIAL 00:07:80:93:54:97 001f00
Was Recieved
4/20/2010
3:09:39 PM
INQUIRY 2
INQUIRY c8:7e:75:6d:75:6b 5a0204
INQUIRY 00:07:80:93:54:97 001f00
Was Recieved
4/20/2010
3:09:44 PM
call 00:07:80:93:54:97 1 rfcomm
CALL 0
Was Recieved
4/20/2010
3:09:47 PM
CONNECT 0 RFCOMM 1
Was Recieved
4/20/2010
3:09:47 PM
HELLO
Was Transmitted
4/20/2010
3:09:59 PM
.
When the inquiry button is depressed the program sifts though the code and writes the addresses found to a menu ring.
04-20-2010 03:57 PM
Thanks! A VI would be much more useful that an oversize picture of truncated code. 😞
As I said before, your code makes no sense. The while loop runs once per character in the string, meaning the array going to the "strings()" property will potentially have a huge number of mostly empty elements. Do you really need to do that over and over again with every iteration of the big loop? How often does the string actually change?
If you want to reinit something on first run, place that inside the startup frame to the left instead of the main loop. No case needed.
04-20-2010 04:37 PM