using mscomm control to communicate with a embedded device
- From: saudrehman@xxxxxxxxx
- Date: 17 Feb 2006 00:46:44 -0800
hi guys,
i am a new to VB .
i am implementing a VB GUI for an energy meter .A PC will send and
receive modbus frames from the energy meter.
i am using the comm control object in VB
will this work
suppose i need to transmit this Hex frame 01 06 00 08 00 01 CRC
then will this work ?
MSComm1.PortOpen = True
MSComm1.Output = Chr(&H0) & Chr(&H1) & Chr(&H0) & Chr(&H6) & Chr(&H0) &
Chr(&H0) & Chr(&H0) & Chr(&H7) & Chr(&H0) & Chr(&H0) & Chr(&H0) &
Chr(&H1) & Chr(&HD0) & Chr(&HF9)
and i receive the same response from the meter if OK
Dim ValResult As Double
ValResult = Val(MSComm1.Input)
If ValResult Then
MsgBox "Valid response"
Else
MsgBox "No response "
End If
mscomm1.portopen=false
plz tell me whats wrong
.
- Follow-Ups:
- Prev by Date: Re: ADO Join Recordset
- Next by Date: Re: using mscomm control to communicate with a embedded device
- Previous by thread: ADO Join Recordset
- Next by thread: Re: using mscomm control to communicate with a embedded device
- Index(es):