Advice Needed - Beginner and Material Handling


Thread Starter


I have basic experience with VB and C/C++. I've been asked if I can "learn" how to write a PC app on Win2K that will work through a multiport serial card to read from a scanner and scale, and then output to a PLC (conveyor divert).
I have no idea even where to start with this. Is MSComm an option? Is there a simple path? This wouldn't be anything complex. The scanner would give me the id number so that I can look up a value (expected weight). The scale would return the actual weight, and then I'd tell the PLC what to do with the carton (divert to a QC area or divert normally). We haven't purchased a multiport card yet, I'm just gathering requirements. Any help would be greatly


James Ingraham

This isn't a horrendously difficult task, but it's not exactly trivial either. The biggest problem is that you can't talk directly to a
serial port in Win2k. There are some software solutions around this. One is at "":
There are probably many others. Of course, if you use Win98, Linux, QNX, etc. you CAN talk directly to the serial ports. You can always
get the Microsoft Driver Development Kit (DDK) and learn how you're really supposed to write to serial ports. I've never used the DDK, but
I understand that it is quite a learning curve.

Another option would be to buy a PC-Based software solution that is designed to do this kind of problem. We've succesfully Think & Do
Software to communicate serialy with barcode scanners and PLCs. That would also let you pick a host of options for talking to the PLC,
either over a fieldbus or using an OPC server.

Sage Automation, Inc.


What sort of PLC? The reason I ask is that many PLC's have or can have added some serial port interfaces. It might be easier to do it all in the PLC rather than try to handle synchronization issues between the PC and PLC.

Just a thought.....

--Joe Jansen
We have done lot more projects on this, give me the exact detail of scanner and scale , also the detail of PLC to which u have to send the data, its not too diffiult but its very tricky, to handle data to multipple devices.


Using two instance of the MSComm control (set up to read the comm ports on the multiport card) in a VB app would take care of the input portion of the app. Using an OPC server for your PLC to communicate between VB and the PLC would allow you to write data to the PLC to set your divert output. You should also include code in the VB app and the PLC logic to do some handshaking.

We have completed several systems with scanners and weigh scales as you have described.

Our approach has been to use MSComm for the scanner and scale communication, and using a third party OCX to communicate to the PLC. We happen to like the OCX provided by Automated Solutions, but there are many companies that provide PLC drivers. We are now migrating toward OPC using an OPC Client OCX we found at "": .

OPC provides a standard method of communicating to virtually any PLC (and other industrial devices), regardless as to the vendor. However, there must be an OPC server available to communicate to the PLC. Most PLC companies offer their own OPC server, and there are many third party companies that can also provide OPC servers. The OPC foundation provides a lot of good information on what OPC is all about.

Hope this helps, and good luck.::