Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / February 2005



Tip: Looking for answers? Try searching our database.

VB Com-port readout

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Deerhunter - 25 Feb 2005 08:38 GMT
Hi,

I'm just started wit an application in Visual Basic.
I connected a USB barcode scanner and I just want to read out the com port
and put this value into a variable.
Anyone an idea how to do this in an easy way? Can someone help me on the
way?

Many thanks!

Mike
btpanek09@yahoo.com - 25 Feb 2005 14:13 GMT
Assuming you have VB6, find the MsComm control in the
Project\Components\Controls and check the box to add to your project.
In the tool box you will find a "Phone" which is the MsComm control.
Add this to your Form.

Set up the Settings Property string to match your device.  Then call
Open to Open this port somewhere early in your program.

Your InputMode property should most likely be set to comInputModeBinary
for a device like a Bar Code Scanner unless you know that it will be
reporting only text strings.

View the MS help on the InputMode property to see how to receive a
binary array from the com port.  You use a Variant to receive the
initial data (in Binary mode, not text) then copy this to a Byte Array
for further processing.

Use the OnComm event to "find" the data you receive within the
comEVReceive event.  See OnComm example in MS.
Deerhunter - 28 Feb 2005 08:06 GMT
Thanks a lot!

Mike

> Assuming you have VB6, find the MsComm control in the
> Project\Components\Controls and check the box to add to your project.
[quoted text clipped - 15 lines]
> Use the OnComm event to "find" the data you receive within the
> comEVReceive event.  See OnComm example in MS.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.