Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Using Mscomm control in visual basic for modbus

Status
Not open for further replies.

saudrehman

Member level 1
Joined
Dec 20, 2005
Messages
40
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,697
mscomm modbus

hi guys i am new to VB
i am implementing a VB GUI for an energy meter .A PC will send and receive modbus frames from the nergy meter.
i am using the comm control object in VB
will this work
suppose i need to trnasmit 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
 

can u plz send me the pictures of your GUI design
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top