The simplest way is to use the MSCOMM control and a timer to poll the input stream.
I've attached the simplest demo I could muster that will receive data on com1 and put it in a text box. It contains a total of three lines of code so not too scary.
i've also read from other website.they told me to use the code as follows:
MSComm1.CommPort = 2 ' Set the port number
MSComm1.Settings = "56000,N,8,1" ' Set UART parameters
MSComm1.PortOpen = True ' Required, might lock port
MsComm1.Output = "Text string" ' Send data
Buffer$ = Buffer$ & MSComm1.Input ' Read data
My code is simpler because I left everything as default. So, it's com1, 9600,n,8,1. To change any of the parameters look at the properties of MSCOMM1.
One thing to note that is not widely known is that the MSCOMM control doesn't work correctly with USB-RS232 converters unless you set MSCOMM1.RThreshold=1.
I think VB is very good for Small programs or simple programs. but, in VC# and Delphi you have more power and ability. Of course, i have not worked with VB much.
I think VB is very good for Small programs or simple programs. but, in VC# and Delphi you have more power and ability. Of course, i have not worked with VB much.
I'm a Delphi user, wouldn't touch C with a bargepole - but VB is fairly easy to understand, and even the early interpreted versions were amazingly quick for an interpreter. You would probably be surprised how many applications, even commercial ones, are written using VB.
Hmm.. if I'm not mistaken, nowadays, VB is the same with C# as in what C# can do, VB can also do, which is because of .NET. There have been on going 'arguments' about which language is better, VB or C#.
As for me, I use C# not because it is better than VB, but because when I was studying, I was taught C so the natural progression would be to move on to C#.
My code is simpler because I left everything as default. So, it's com1, 9600,n,8,1. To change any of the parameters look at the properties of MSCOMM1.
One thing to note that is not widely known is that the MSCOMM control doesn't work correctly with USB-RS232 converters unless you set MSCOMM1.RThreshold=1.
actually i'm using USB-RS232 converter. before this,i've try to interface the PIC but when i run the VB code,my computer will automatically shutdown and restart.tq mike for the information.it might help me.
hi,
i think am in the right session. i want to interface PIC16F84A to the Visual Basic.net , i want to get a value from the PIC counter and send it to the program ans assign it to a variable?..need help!!
hi,
i think am in the right session. i want to interface PIC16F84A to the Visual Basic.net , i want to get a value from the PIC counter and send it to the program ans assign it to a variable?..need help!!
my programmer has serial cable but mylaptop doesnt have the serial port, so i have bought a serial to USB cable, and so to mean i will be using USB.
thanks
Use the parallel port one of the handshake lines will make a good TTL level input, you'll still need a .dll that allows direct access to it if using XP.