Bluethoot serial com problem :(

camolas

Member
Licensed User
Longtime User
Hi there,

Im going crazy with this, i have a Qtek 9100 WM5 and im doing a BT serial com here is the code:

***********************************
Sub Globals

x=0
portflag = 0
strlabel0="COM 6 > 9600,N,8,1"
strlabel1=" [CLOSED]"
strlabel2=" [ OPEN ]"
strlabel3=" TX= "
strlabeltemp=""
End Sub

Sub App_Start

Form1.show
label1.Text = strlabel0 & strlabel1 & strlabel3
strlabeltemp = strlabel0 & strlabel1 & strlabel3
serial.New2 (6,9600,"N",8,1)
End Sub

Sub Button1_Click

If portflag = 0 Then
serial.PortOpen=True
portflag = 1
label1.Text = strlabel0 & strlabel2 & strlabel3
strlabeltemp=label1.Text
For x=0 To 3000
Next
serial.Output ("*")
End If
End Sub

Sub Button2_Click

If portflag = 1 Then
serial.Output ("^")
For x=0 To 3000
Next
serial.PortOpen=False
portflag = 0
label1.Text = strlabel0 & strlabel1 & strlabel3
strlabeltemp=label1.Text
End If
End Sub

Sub Button3_Click

serial.Output ("sf1")
label1.Text = strlabeltemp & "sf1"
End Sub

Sub Button4_Click

serial.Output ("sf2")
label1.Text = strlabeltemp & "sf2"
End Sub
Sub Form1_Close

End Sub

***********************************

Im conecting this to my PC from the BT PC (in Qtek i have 2 com ports one in one out 6 and 7 are ther numbers after paring the device) and using Hyperterminal to see what came from the Qtek and what he do is sends the "*" but then it give a error screen on the Basic4Pcc program the and stops !! whats wrond in the code ??


p.s. If i turn off the BT from the PC and then run the program it runs good !!!

Please :sign0085:

Thankzzz
 
Last edited:

camolas

Member
Licensed User
Longtime User
What error message does it give?

My WM5 is in Portugese... i have change my project and now im working with the serial term that came as sample code it works god for me,
Thanks for helping Erel. :)

By the way i cant change in the code de default port number that is 4 and i need 6, can you please help?

Thanks one more time (because is never to much) ;)
 
Last edited:

camolas

Member
Licensed User
Longtime User
All problems above solved, but now there is one more :BangHead: i have to click on the MenuPort/Port number (6) every time i run the program, how can i disable that need?

Thanks
 
Top