serial port in vb

S

Thread Starter

sahar

i have project and i want to move a motor to left and right white board that connect to serial port and i think i must use mscomm but i dont know what am i doing. plz help me. thank u.
 
S

Santhosh Jayarajan

I presume that you have electronics of some kind that can accept serial communications commands. You can use the MSCOMM object in VB.

Do the following:
1. Set up the MSCOMM.PORTNo to match the port you are using.
2. Use the MSCOMM.Settings proprerty to set the baud rate, parity and stop bits, etc. Like "9600,n,8,1" for 9600 Baud, No parity 8 data bits and 1 stop bit.
3. Use the MSCOMM.Output property to send the command to the electronics board. If the Electronics is supposed to send a reply immediately execute an Mscomm.Input in a loop to get back the required characters.

If you need more help please email me.
Santhosh Jayarajan
Malaysia
 
There is a good demo in the Samples section of Microsoft Help & Support:
http://support.microsoft.com/default.aspx?scid=kb;en-us;140880 (Search for article 140880 if the link breaks)

That will give you a starting point. From there, search for "serial API" on the Microsoft web site and you will find several more articles. Look for the links that start with 'msdn'.

Sealevel Systems (http://www.sealevel.com) includes help files and code samples for C++ and VB on the CD that ships with their serial products.
 
hi!!

how can i find out the input and output instruction to send instruction to PLC board to read the value from PLC?

good read ur manual... can u please help something... me too from malaysia (KL)... give me a call... i call back... i'll as directely.

my hp no: 016-2403891

i'm leaving to china... coming tuesday... before that means very useful for me...

my mail address: [email protected]

Durai.C.T
 
H

Habacuc Herrera

I have been tried to develop an application to be able to communicate the PC with one microcontroller PIC16F870. Would you mind helping me to do it?

Habacuc Herrera
México
 
Hi,

I am trying to address a LANC device for which I have built a converter. This system works when I am using Hyperteminal

For example the code for starting the VCR is 1034 Now How do I implement that in Visual Basisc?

THX,
Harpert
 
S

Smith, James

This will set the port number baud rate and open the port then send the data out the port. If you would like more help email me and I can help you with the app

MSComm1.CommPort = "1"
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MSComm1.Output = "1034"

Regards,

James Smith
[email protected]
Automation Department
American Castings LLC
Pryor Oklahoma
918-476-4391 V.
918-476-4321 F.
 
how to issue a new command in front of MSComm
like this
"Set MSComm1 = New MSComm"

its not working, so can anyone help me in this?
 
i'm trying to identifying between two serial ports for which the mouse is connected and for which the hardware (data logger (for taking input only)) is connected... thru vb 6. plz. repy me as soon as possible...

sheetal
 
Top