|
-
Sep 2nd, 2000, 05:12 AM
#1
Thread Starter
New Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|