06-23-2014 03:29 PM
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>
06-24-2014 01:08 AM
06-24-2014 10:29 AM
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?
06-24-2014 12:39 PM
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.
06-24-2014 01:05 PM - edited 06-24-2014 01:07 PM
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...
06-24-2014 01:33 PM
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.
06-24-2014 04:21 PM - edited 06-24-2014 04:42 PM
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...