Dear Erel,
dear agraham,
thanks a lot for the fast reply.
I am not so familar with VB.Net. I could compile my programm to the Emulator as well as to the Device. The problem was only that I could'nt established the BT Connection by starting my program. I got always a system exception. Only if I create the BT connection before I start my program I was able to connect the NXT.
I also compiled the Mindsqaulls with C# and the DLL works and you are right
I don't like C# because for me it's totally confusing and for sure I'm not able to modified the code. Delphi :sign0060:
If I embedded the DLL in B4PPC there are several Objects are available.
I.e.: NXTBrick, NXTBluetooth
Please see hereafter:
Variable "port" is in Sub GLOBAL
Sub App_Start
nxtbrick.New1(port) 'Create New1 with COM5
End Sub
Sub mnuConnect_Click
ErrorLabel(btnConnectErr)
nxtbrick.Connect
If nxtbrick.IsConnected Then
ModGeneral.Connected
End If
Return
btnConnectErr:
Msgbox("Kann Anschluß " & port & " nicht öffnen", "Fehler")
If nxtbrick.IsConnected Then 'close port
nxtbrick.Disconnect
ModGeneral.NotConnected
Else
nxtbrick.IsConnected
ModGeneral.Connected
Sender.LabConnect.Color = 255,0,0
End If
End Sub
The above code works well with the Mindsquall DLL but only for the object
"NXTBrick".
If I try now to get information from the object "NXTBluetooth" like
"NXTBluetooth.GetFirmwareVersion" I create an Error because
NXTBluetooth.New1(port) is not open. But I can't open due to
the open NXTBrick.New1. :BangHead:
Is there any possibility to bypass the NXTBluetooth.New with any command in B4PPC and get the information thru NXTBrick's open port?
I hope you could understand what my problem are.
Thanks for your Feedback
Thomas