Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interface to PC using Visual Basic

Status
Not open for further replies.

c828

New Member
I have tried to interface PC with Visual Basic. But I cant because i dont have basic knowlegde. Can you help me?
I'm a Vietnamese because I am bad in English.
 
u cannot access the h/w ports directly using vb .
i'll give u some refrences.
to communicate with parallel port have a look at
**broken link removed** and
**broken link removed**

with com port .. u can use "microsoft comm control " select it from the components tab.. in vb.

replay how this helped u.
 
i don't interface with h/w. I want to interface with RS232
THanks much
I want you helping
 
just don't forget to change RThreshold to one or anything bigger than 0...
 
c828 said:
I have tried to interface PC with Visual Basic. But I cant because i dont have basic knowlegde. Can you help me?
I'm a Vietnamese because I am bad in English.

Visual basic can interface to any computers through winsock (PC = Personal Computer)

BUT, if you mean the PIC microcontroller, then forget using Visual Basic unless there is a special driver that acts as a middleman between Visual Basic and the computer port you are interfacing through.

Get a hold of Quick Basic and you can interface it to a port as follows:

out (port),(1-byte data).

In fact, you could use the same instruction in assembler.

So if you wanted to send character code 1 to LPT1, then in Quick Basic you use:

OUT &H378, 1

the &H means the numbers after it are hexadecimal.
The above also assumes LPT1 is at address 378h.
 
mscomm is all you need - if the comm speed doesn't exceed 19200bps.
if you want connections of 38.4kbps or higher you will have to look for alternative driver...
 
if you want to use the latest software, microsoft's .NET 2.0 has had serial port support added back into it, in the System.IO.Ports namespace. so if you use the (currently free) VB.NET express edition (which is based on the upcoming .NET 2.0) you can use it... or you can wait for the new Visual Studio.NET 2005 to be released.

It's a lot more elegant interface than it was in many previous versions of VB, which usually was sort of "hacking" to get it to work. I interfaced a serial port to VB6 a couple years ago, but it was pretty confusing, and the program I ended up with didn't make much sense, although it worked.
 
Visual Studio 2005 was already released, (I use RTM already).
That serialport component is sweet, I use it a lot...
 
Thank you very much!
I want to interface with AT89s52
Because I don't know PIC
I want your helping
 
Thank you very much
You can help me again
I want a example code
If you have both GUI and source code that very fantastic
HELP ME
I have to hand in my teacher in next month
Thanks a lot
 
When i use VB to write program. I used:
mscomm1.comport=1
Error: require hardware
Why?
My software is error?
I use WinXPSP2
Thanks
 
c828 said:
When i use VB to write program. I used:
mscomm1.comport=1
Error: require hardware
Why?
My software is error?
I use WinXPSP2
Thanks
Are you using a laptop?try port number 1 through 3,there must be one that exists.An easier way is to download a serial tester program(e.g Term2x) and run it.No warning will appear if you use the right port number.Set it as the port number of your MSCOMM object and no such error is likely to happen.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top