Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I'm telling this.Let say I have typed those letters in my text box.
WELCOME TO THE SHOPPING COMPLEX OPEN FROM........
Now what I need is I want to send this string to the PIC UART.But it must send 16 characters at a time until entire string transmits.
Transmit 1st 16 characters---Send 2nd set of characters--Send the balance.
Dim OutLen As Integer 'Length of entire string...
Dim OutCount As Integer 'OutLen / 16...
Dim i As Integer 'Loop Temp
Dim TestString As String 'Temp string holder
Dim MyArray As New List(Of String) 'Array Holder
ListBox1.Items.Clear() 'Clear List
TestString = TextBox1.Text 'Place out textbox text into string
OutLen = TestString.Length ' Get the length of string
OutCount = OutLen / 16 ' Divide the length by 16
For i = 0 To OutCount - 1 'Loop to add to array
MyArray.Add(Mid(TestString, (i * 16) + 1, 16)) 'add to array
pointer = 1
Do While pointer < Len(Text1.Text)
out = Mid(Text1.Text, pointer, 16)
Debug.Print out
pointer = pointer + 16
Loop
If pointer <> Len(Text1.Text) Then
out = Mid(Text1.Text, pointer, 16)
Debug.Print out
End If
Dim string_Length As Integer
Dim pointer As Integer
Dim Ack_Byte As Integer
Private Sub Command1_Click()
pointer = 1
string_Length = Len(Text1.Text)
Loop_Here: Call Send_Block ' send 16 characters
If string_Length > 0 Then ' if string length 0 exit
While Ack_Byte = A ' wait until acknowledge 'A'
GoTo Loop_Here ' if not A wait here
End If
End Sub
Private Sub Send_Block()
Ack_Byte = 0
If string_Length > 16 Then
Text2.Text = Mid(Text1.Text, pointer, 16)
pointer = pointer + 16
string_Length = string_Length - 16
Else
If string_Length = 0 Then
Text2.Text = ""
Else
Text2.Text = Mid(Text1.Text, pointer, string_Length)
string_Length = 0
End If
End If
End Sub
Private Sub Form_Load()
With MSComm1
.CommPort = 1
.PortOpen = True
.Settings = "9600,n,8,1"
End With
End Sub
Private Sub MSComm1_OnComm()
If MSComm1.CommEvent = comEvRecieve Then
Ack_Byte = MSComm1.Input
End If
End Sub
Loop_Here: Call Send_Block ' send 16 characters
If string_Length > 0 Then ' if string length 0 exit
While Ack_Byte[COLOR="red"] <> asc("A")[/COLOR] ' wait until acknowledge 'A'
[COLOR="red"]Ack_Byte=0 'clear it[/COLOR]
GoTo Loop_Here ' if not A wait here
End If