Hi there, I was always surrounded by VB receiving problem. I used MSComm to do the receiving task from the PLC. But my PLC (Programmable Logic Controller) always send the signal in binary form. Once i reveived the signal and log it in notepad (*.txt), things that i received was in weird simbol, maybe it's kind of ASCII or ANSI form, i am not sure. How to convert the binary form to readable form , for example Integer? I used this kind of method:

Private Sub MSComm1_OnComm()
If MSComm1.CommEvent = 2 Then
While MSComm1.InBufferCount > 0
Temp = MSComm1.Input
Print #1, "ErrorCode = " & CInt(AscB(Temp))
Print #1, "Date = " & Date
Print #1, "Time = " & Time
Print #1, "......................"
Wend
MSComm1.Output = Chr$(26)
End If
End Sub

Thanks for your help!!!


Regards, Jesse.