MODBUS -- VB code to communicate to a PC and Device


Thread Starter

srinivas duddu

Hi!!, Please let me know if any code samples are available in VB to communicate with a modbus device. I am badly in need to communicate to a gas analyser supporing MODBUS RTU. Anybody pls, let me know the possibilities of getting the communication work. I tried with the MODTEST utility program and it works, but when i tried to send the same query using MSCOMM control in VB it doesnt work . what could be the problem ?

Santosh Singh

Hi Srinivas,
Probably u need to go through the technical details and version of the MSCOMM Control Component on Win Platform. As Driver Module for Win95 differs totally from Win98 and Win2000(WDM architecture).
Santosh Singh
[email protected]
"Searching srinu frm YBL"

Alex Pavloff

MSComm has absolutely nothing to do with any of the device driver models. In the Windows world (and the Linux world, for that matter), the device
drivers are there to interface to hardware in the box, like Ethernet cards, video cards, and the actual serial port itself. Beyond that, you don't need "device drivers".

If you need to talk to a Modbus RTU device, the fastest way to get that done is to buy an ActiveX component from someone like Software Toolbox and just plug the thing in and go. If you can't do that, and have to write a driver yourself, you're going to want to sit down with the Modbus protocol guide, and read the protocol. A much better place to get help on these issues, because it really is a MSComm learning issue, not a Modbus problem, is the newsgroup comp.lang.basic.visual.misc as well as some of the
microsoft.public.vb.* newsgroups.

Alex Pavloff
Software Engineer
Eason Technology