LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to register for events on a bluetooth instance

 

The following was copied from IntheHand.net's help files.  I can't figure out how to do anything once the "Get Instance" method has been called.  There are no other properties for that reference, nor are there any useful methods.

 

///<para>To see the events get an instance of this class via its method/// <see cref="M:InTheHand.Net.Bluetooth.BluetoothWin32Events.GetInstance"/>.

/// Then one should register for the events on that instance and keep a/// reference to it.///</para>

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 1 of 7
(3,172 Views)
Sounds like they are talking about performing .net callback events. It is possible to this in LV -- and I believe that there is an example that ships with LV. If you can find an example that shows ActiveX call backs, that's still useful since the process is the same.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 7
(3,150 Views)

eximo,

 

The "GetInstance" method does not appear to exist in the dll you provided.  There is a "GetStream" method that might do what you want, but that's about all I can tell you.

 

Is there maybe a newer version of that DLL?  Or maybe a newer version of that help file?

 

-Jim B
Applications Engineer, National Instruments
CLD, CTD
0 Kudos
Message 3 of 7
(3,136 Views)

This utilizes the recommendation by Mikeporter to use the callback events.

 

James-B, there are two dlls in the file, one is the 3.x Version of the library and one is the 2x version, the 3.x version contains the event arguments.

 

You can see from the Main Program and The Call back subVI that I have registered for the event, but I am not able to get the information out of the event that I desire.  The instance is started in the Main and passed to the event call back (did I say that right?) The callback subvi has access to the instance and the device info for that instance, however I don't know how to get that information displayed in the main VI.

 

The bluetoothwin32events require the generic bluetooth stack to be installed, not the broadcom stack.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 4 of 7
(3,130 Views)

The thing to remember is that callback event VIs run in their own little world and you can't effectively troubleshoot or debug them. The way I have used to get information out of them is to create a user event that carries the data you want to send out. Pass the reference to that event to the callback VI and inside the callback, fire the event with the information from the callback.

 

In the Main VI register the same event and create an event handler to catch it. When it fires pass the data from event to wherever you need it.

 

VERY IMPORTANT: Put as little code as possible in the callback VI -- reread the first line above!

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(3,126 Views)

I'm sorry to say that as much experience that I have had with labview, this is the first I've had dealing with event call backs.  What you just wrote was mostly chinese to me, I've read the 2 examples included with LabVIEW on call backs, but I am at a loss as to how to get the information registered to the event in the subvi back to the main program in a reference.  I am also unsure how to register that event in the main VI.

 

Any additional help, or examples, or modifications to my code would be most appreciated.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 6 of 7
(3,120 Views)

Here's an example that someone wrote using a .net assembly for putting a menu in the system tray. It looks for events to occur in the tray and fires a user event to pass the information back to the main VI.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(3,107 Views)