LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building Bluetooth program on LabVIEW

Hi there,
 
I am doing a project where I am suppose to build a Bluetooth software using LabVIEW to replace the current Bluetooth software for a set of timing lights (uses Bluetooth as means of communicating with the computer). This is how the setup is suppose to work,
1. The timing lights are on. A set of 7 pairs. One emitter and one receiver each. Light from emitter is received by the receiver. All 7 pairs are linked to the computer via Bluetooth.
2. When the connection between the emitter and receiver is broken, a signal is sent to the computer.
That is basically how they work. I have tried the Bluetooth examples but they are somewhat different from what I need to do. I was wondering if it was possible to just create one Bluetooth VI which is able to just acquire, process and present the signals (either light received or not) from the timing lights just like a data acquisition VI.
 
p/s I am new to how Bluetooth works so I am not sure what signal(s) is sent from the timing lights. How can I check what signal is sent from the timing lights? Any help on this is really appreciated. Thx.
0 Kudos
Message 1 of 13
(5,707 Views)
Smiley Sad anyone?? Smiley Sad
0 Kudos
Message 2 of 13
(5,680 Views)
> I am doing a project where I am suppose to build a Bluetooth software using LabVIEW
> to replace the current Bluetooth software for a set of timing lights (uses Bluetooth as
>  means of communicating with the computer).
 
There are really two separate tasks here - first, getting registers (or variables) for the timing lights.
The second task is transmitting the data by Bluetooth radio/software.
 
> 1. The timing lights are on. A set of 7 pairs. One emitter and one receiver each.
So each receiver is a separate Bluetooth radio?  Then when you do a "Bluetooth Discover"
you should find (at least) 7 addresses (listed for example as 12:34:56:7a:bc:de").
Use each of these addresses as an input to a separate "Bluetooth Open" - which will give
you 7 separate connection ID's.  Most likely you will use Channel 1 for the Bluetooth Open too.
Then it's simply a matter of using "Bluetooth Read" to listen for any response.  I use a 1ms
timeout and ignore timeout errors ("the device just doesn't have anything to say").  You
may always expect a response from yours (light or no light), or you may want a longer timeout,
and/or use a timer so that you aren't polling every microsecond. 
 
> 2. When the connection between the emitter and receiver is broken, a signal is sent to the computer.
> I was wondering if it was possible to just create one Bluetooth VI which is able to just acquire,
> process and present the signals (either light received or not) from the timing lights just like a data acquisition VI.
 
Sure.  I would use a state machine.  The "initialize" would do a discover (if you don't have the addresses
hard coded).  You may need some method of selecting devices so that you don't get everybody's
cell-phone head set.
Then go to state "open" where you open all 7 bluetooths.  Pass the 7 connectID's to the "Read" state
where you read the current data from all 7 receivers.  (If you have to write a message to them before
you can read a response, be sure to do that too.)  This data is presented on the panel in any
format you desire.  Put in the desired time-delay/polling rate and continue in the "Read" state.
The Stop button on your panel takes you out of the Read state and goes to the Disconnect state
where you disconnect all 7 bluetooths.
 
That should do it.
 
~~Les Hammer
Message 3 of 13
(5,679 Views)
Hi Les,

Thx for the info. But there are still some parts which I am still uncertain on.

For the equipment, firstly I dont have the equipment with me to test on it first-hand. Thus I need to prepare an experimental VI and then go to another place to test it. Secondly, there is no datasheet or sort for the equipment. The people who own the equipment dont have it and I cant seem to find the datasheet as well. So I dont actually know how the equipment "talks" to the computer I only know that the type of communication is Bluetooth. Hence I am not sure how the timing lights tell the computer if light is received or blocked. Is there a way to find that out? Or is it not necessary to know since all Bluetooth equipments "talk" to the computer in the same way? (New to Bluetooth @_@!!)

I have tried the Bluetooth discover with handphones and I know how to use them (I hope!). To use LabVIEW's Bluetooth module for data acquisition, I will need to know;
The address of the timing lights.
Use Bluetooth read to receive the (whatever) signal from the timing lights?
Use Bluetooth write if it is needed?
Then how do I see the signal from the timing lights? Since Bluetooth communication, signals are sent using RF right? So the signals would be in packets?
I am wondering if they work like an Infra-Red where a voltage level will tell if the light is receive or not.

Sorry for being so vague and I have attached a picture of the timing lights and a one page specification on it (that is the only information of the timing lights that I have @_@!!)


Download All
0 Kudos
Message 4 of 13
(5,664 Views)

Hi,

 

  The specs show a very accurate timing of the light,

that mean, Blouetooth is just there to transmit the result time or elapsed time,

I am sure the design put a microcontroller in the lights emitter and send all the 7 results timing.....

your customer   would want labview just to retreive the data from the light, sure it is not to count elapsed time

of each light, because blouetooth is slow etablishing the connection.

Then it is very simple, try to etablish a communication with ant bloutooth device, more like palm

with labview to transfer some file and on site you willl find very similar...

0 Kudos
Message 5 of 13
(5,651 Views)
> For the equipment, firstly I dont have the equipment with me to test on it first-hand.
 
I had a project like that once.  We called it the project from h*ll.  Poorly written specs on hardware we never saw.
The only comments we could get we're "no, guess again what our protocol really is."  Good luck!
 
>  Is there a way to find that out?
Not unless the equipment owner gives a hint.
 
> Or is it not necessary to know since all Bluetooth equipments "talk" to the computer in the same way?
 
What you'll get from Bluetooth equipment is an array of bytes.  How big the array is and what they mean depend upon the equipment.  The equipment may require you to send an array of bytes first - an encoded command.  That's why spec sheets are important.
 
> The address of the timing lights.
That could either be written on the tming light box, or it's the new address that appears in the Bluetooth Discover array after you turn the timing light box on.  🙂
 
> Use Bluetooth read to receive the (whatever) signal from the timing lights?
Yes.
 
>Use Bluetooth write if it is needed?
Yes
 
> So the signals would be in packets?
Yes.  But the decoding of the packets depends on the equipment specs.
 
~~Les

Message 6 of 13
(5,635 Views)
Thx for the replies guyz... really appreciate it.
 
To jjcimon,
 
Firstly its actually an educational project but nontheless I need to get it done! Smiley Very Happy Anyway what I have to do is to actually replace the whole program as seen in the pdf file which I posted with a LabVIEW one.
 
So if I understand your reply correctly, you are saying that the light detection bit will be done by the timing lights themselves and they will just send the information on whether light is received or not back to the computer. So all I will need to do is to develop a Bluetooth VI which will be able to receive the signals sent by the timing lights and to deceiver what the signals are saying; either light received or not. Once I can do so I will be able to present the timing on LabVIEW itself as well.
 
To Les,
 
I have planned to do this in 3 parts.
Firstly using Bluetooth Discover to obtain the addresses of eah timing lights.
Secondly to build the Bluetooth VI to only detect the timing lights. This is to be able to check if the timing lights are connected correctly to the Bluetooth VI as well to avoide other Bluetooth equipments from interfering.
Thirdly would be to acquire the signal from the timing lights and to process the signal and finally to present the timings.
 
I think for the first and second part, it should be straight forward. I have tried the first and am currently developing the second. For the third part, just to check, since I only need to receive the data from the timing lights, can I just use Bluetooth Read (and Bluetooth Write if necessary) alone to do so. Meaning that just fit in the address of the device to read from and just get the output or do I actually need to follow the Bluetooth examples where I must make a server/client VI?
 
When I go through the descriptions of the other Bluetooth functions and examples, it seems to me that most of the other functions here are needed only if you want to make a server/client VI but for my case I dont need to do so?
0 Kudos
Message 7 of 13
(5,608 Views)
Hi Zen,
 
> ... Meaning that just fit in the address of the device to read from and just
> get the output or do I actually need to follow the Bluetooth examples where
> I must make a server/client VI?
 
You'll need 5 of the Bluetooth items:
 
1) Bluetooth Discover:  Gives you the addresses of the Bluetooth devices
2) Bluetooth Open:  This is what you give one of the addresses from Discover.  It will return a Connect ID.
3) Bluetooth Read:
4) Bluetooth Write:  These two take the Connect ID as an input.  The Read gives a string output which can be transformed into an array of bytes.  The Write takes a string input and sends it out.
5) Bluetooth Close:  When you are all done and ready to stop the program, do it cleanly and Close the connection.
 
~~Les
Message 8 of 13
(5,568 Views)
Hi Les,
 
Sorry to bother you again...
 
I understand the need of using the Bluetooth Discover, Open, Read and Close for my case but what is the Bluetooth Write for? It is just to write to the timing lights if needed as stated in one of your earllier replies?
 
I went through the Bluetooth simple server/client examples and I believe that what I need to do is somewhat similar to the client example but I also dont understand why is there a Bluetooth Write after the Bluetooth Read?
 
One more thing on Bluetooth adapters.
 
I was trying out LabVIEW Bluetooth on my Dell laptop and it was working fine using the Dell Bluetooth adapter. But when I tried on my desktop with a Widcomm Bluetooth adapter, LabVIEW Bluetooth doesn't work. I checked around the forum and found out that LabVIEW's Bluetooth only works with certain Bluetooth adapters but the posts are old so I was wondering if it is still the same right now or are there methods to tackle this problem. Btw currently using LabVIEW 8.0.
 
Thx~~
0 Kudos
Message 9 of 13
(5,544 Views)
Hi Zen
 
> what is the Bluetooth Write for? It is just to write to the timing lights
> if needed as stated in one of your earllier replies?
 
Yes.  If the timing lights need some programming command before they send data.
On the other hand, if they always send data, or send data continuously, there may not be any reason for a write.
 
> I went through the Bluetooth simple server/client examples
Personally, I found the examples a bit more confusing than helpful.  If it wasn't for this group I wouldn't have gotten this thing going.  The examples don't explain the difference between client and server.
 
 
One more thing on Bluetooth adapters.
 
> But when I tried on my desktop with a Widcomm Bluetooth adapter,
> LabVIEW Bluetooth doesn't work.
 
I use a D-Link adapter.  It comes with a set of drivers.  LabVIEW documentation (someplace) warns "Do not install that third party software."  The third party (D-Link or Widcomm) may over-ride the Microsoft sofoftware that LabVIEW uses - confusing the whole thing.  If you installed software with the Widcomm, uninstall it ans see if LabVIEW works with it by itself.
 
 
> I checked around the forum and found out that LabVIEW's Bluetooth only
>  works with certain Bluetooth adapters
 
That's beyond my scope of knowledge.
 
 
~~Les
Message 10 of 13
(5,534 Views)