VB.net code
Dim abytSendData() As Byte
Dim SQL As String
SQL = strSendString
ReDim abytSendData(strSendString.Length - 1)
For i = 0 To strSendString.Length - 1
abytSendData(i) = Asc(strSendString.Substring(i, 1))
Next
Try
mobjRS232.Write(abytSendData, 0, abytSendData.Length)
Catch ex As Exception
UpdateLog("Error Sending " & abytSendData.ToString, "")
End Try
VB6 CODE
If strSendString <> chr(ACK) Then
strSendString = chr(STX) & strSendString & chr(ETX)
strLRC = chr(ComputeLrc(strSendString))
strSendString = strLRC & strSendString
End If
Dim abytSendData() As String
Dim SQL As String
SQL = strSendString
ReDim abytSendData(Len(strSendString) - 1)
For i = 1 To Len(strSendString) - 1
strString = Asc(Mid(strSendString, i, 1))
abytSendData(i) = Asc(Mid(strSendString, i, 1))
Next
varSend = "abytSendData, 0, Len(abytSendData)"
MSComm1.Output = strSendString
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE