Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Control Serial Ports


How do I control the serial ports through VB?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Access Control & Serial Ports
I do hope this type of request has not been posted in the past but if so, I apologize.

I have developed a security access control keypad. The keypad memory will store the last 100 transactions through the keypad. A small hand held printer (Seiko) can be connected to my keypad's controller to enable the printing of these transactions (Audit Trail). As the software for the keypad was written by my pc board manufacturer, I am told the ASCII characters in the keypad memory could instead be uploaded to a pc hard drive and printed to a txt file. My keypad's controller connects to the hand held printer via a 9 pin serial cable.

I have recently had a request to connect directly to a pc to store via text file, instead of the printed thermol paper. The current configuration allows that once the printer has been connected, the internal print command commences immediately and repeats every 3 minutes as long as the printer is connected to the controller. If any of you wonderful programmers know of code that would enable me to resolve this issue, I would greatly appreciate any assistance.

Regards and happy coding

Paul

Opening Serial Ports With The MSComm Control.
Opening serial ports using the MSComm control takes around .5 seconds. Closing the port also takes around the same time.

I have a program that needs to open 2 ports, print something, and then close both port before starting the program.

So far I have just disabled the main form and had a timer take care of it, and reenabling the main form, but I don't feel this is a good solution.

Is there a better way to handle serial communications?
Is there an API designed for just this task?

Thanks.

Serial Communication On Serial Ports
I am currently trying to let the computer's serial port to communicate with a device with a serial port too. But this device uses a line feed function. Does anyone knows how to send a string with the line feed function?

For example, i want to send the string "DIAP<connect>E01D" How do i send this along with the line feed function?

COM Ports And Serial Ports
Is there way to tell how many available COM ports and how many available Serial ports a PC has?

Serial Ports
Hi all,

Is there a way to get a list of the available open serial ports ( without using the mscomm control). Specifically I am trying to determine which ports have a bluetooth device associated with it. Any help would be greatly appreaciated.

Thanks!

Serial Ports
I know it can be done I just dont know how!!


How do you read and write to/from the serial ports Comm 1,2 3 etc using VB????


I have searched (maybe not in the right places) and I cant find out how!!


Anyone?????

Serial Ports
heya gang...

I have been trying to access certain ports on my pc...com1 and ltp1 is there even a way to this in vb?? If so, how do i send and recieve data to these things?

Thx eh
Elon

Available Serial Ports
How can I determine the available serial ports? How to retrieve the
defined serial ports which appear in windows configuration/system ? Which
API function is suited for this purpose ?

Thanks

Serial Ports
I am trying to write a program that will open a serial port. Then the user can type a message and push send and the program will serve as a network protocol, sending the information to another computer that the serial port is connected to.

Any information you can give me would be greatly appreciated. I'm sure this isn't very hard, but I'm not aware of how to do it.

Need Help With Serial Ports
I'm new to programming and I am wondering the best way to use the serial port to recieve inputs from 3 simple circuits. All I have to do is to know which circuits have been completed and in what order they where completed in. This is for a knowledge bowl type of situation with three teams. Also can we recieve the inputs through the different pins of the serial port or do I have to make some hardware that gives each strip a different binary number. Any help would be much appreciated. thank you in advance.

Serial Ports And +5v
howdy,, i'm workin on a little project readin some serial data from an IR device,, what i need to know is a good way to get +5v outta a pin on the serial port,, anyhelp you got is great! (i relize this isn't much of a vb question, but i am using vb for the coding =) ) thanks for any help,,

Controlling USB Serial Ports
Hello,

I've created an application in which I've utilized the MSComm contorl
to allow access to the serial ports. Unfortunately my customer would like
to use USB Serial ports. I've found in Microsofts stuff that MSComm does not support USB Serial Ports.

Does anyone know how to control USB serial ports in VB 6.0.

Thanks in advance for any assistance.

MSCOMM With More Than 16 Serial Ports
MSCOMM can adress up to COM16. I am using higher comport-numbers.
Do anyone have a solution with MSCOMM?

Virtual Serial Ports
Suppose your PC has 2 serial ports: COM1, COM2. Suppose you need to let your program user see a COM3 which you want to redirect (e.g. you want to send the output strings of this virtual COM3 through the Ethernet card and to to read in the COM3 receive buffer what is coming from the Ethernet card). Does anyone know how to provide such an "illusion" (COM3 does not physically exist but a serial communication program can use it)???
Thanks in advance!

VB6, MSComm, Serial Ports?
Has anybody used COM ports, MSComm1, and detecting serial ports????

Does anybody know how to find out what COM ports are available on a computer using VB6. I found out that the WIN.INI file on my computer lists COM ports 1 throu 4 but that doesn't mean that they are available does it. For example when I look under Control Panel/System/DeviceManager/Ports all that is listed is COM1 and LPT1.

I have also tried openeing them with MSComm1 and catching the error if it is already oppened. My end result was 1, and 2 are not used and 3 and 4 are being used. The unusual thing is when I send 2 bytes to port 2 I get two bytes back in my input buffer.I only have COM1 in device manager though. COM1 works fine.

Basically I am trying to find an INI file or someway to find out what COM ports are availlable on a computer. Any ideas?

High Serial Ports
High serial ports ...?

Virtual Serial Ports
Hi Guy's

I need to include a means of creating virtual serial ports in my program.
A realy good example is the program "Virtual Serial Ports Kit". (here)

This neat little app can create a pair (2) serial ports that are bridged together, so what is outputted on one port is inputted to the other,
as if you had 2 real serial ports bridged with a serial cable.

Is there a free ActiveX or .dll that can do this ?

Thanks
Oly

Serial Ports Not Being Released
From time to time my VBasic application is not properly releasing the serial ports. Even after closing the program Windows says that the port is being used by another program (Port already open Err Code 8005).

Only thing I can do to release the ports is to restart the PC.

Number Of Serial Ports
Can anyone tell me if there is an api call that can get the number of available serial ports on the machine that the software is running on. There has to be something because the device manager knows. I had a good link to all of the api calls on the M$ web site but lost it. Now I can't find it. if someone knows that to I would appreciate that information also.

thanks for your help.

Jason

Does Anyone Know How To Program Serial Ports?
I'm new to programming and I am wondering the best way to use the serial port to recieve inputs from 3 simple circuits. All I have to do is to know which circuits have been completed and in what order they where completed in. This is for a knowledge bowl type of situation with three teams. Also can we recieve the inputs through the different pins of the serial port or do I have to make some hardware that gives each strip a different binary number. Any help would be much appreciated. thank you in advance.

Show All Serial Ports And Modems
Hello !!

I need to show in the combo box all serial ports and modems installed in the PC... I see HKEY_LOCAL_MACHINEHARDWAREDEVICEMAPSERIALCOMM in the windows registers but ... How i can to get that information with VB? Any Clue?

Thanks for your help and your time!!

woman in love

Probably A Stupid Question On Serial Ports
how can i verify if in a loopback cable (the TD pin with the RD one, RTS with CTS and DTR with DSR and CD in the same cable) the various connections between the pins are ok? i hope you understand my horrible english... thanks for your answer.

MSComm And Bluetooth Serial Ports
Hi,

I'm working on a VB6 app. that uses the MSComm contro to connect to a Bluetooth serial port. Hower, when I attempt to open the port using COM 17 or 18 (the automatically assigned port number from the BT hardware), the control returns an error of "Invalid Port Number".

I assume this is a limitation of the control, but I'm not sure. Has anyone run into this or know of a solution/work-around? I would be willing to utilize another .OCX/.DLL if needed.

TIA!

Working With Multiples Serial Ports
hi
i have a system that will work with 30 serial ports on PC. How is the performance of VB working with so much serials?

The machine is a Dell Pentium 4 with 128 MB RAM.

thanks
daniel

Question About Serial Ports And 2 Files In One....
Hey guys!

Plz, anyone know if this 2 things are possible to do with VB....
I need to do some stuff for a client and I will need do something like it...

1- Vb can send/receive information trought serial port as com 1,com 2 or usb... etc.. any port? =-)

2- Theres a way to put 2 or more files (any kind) in one? Like Can you create a proccess that gets 2 exe and put in a file with a new extension and them make the opposite.. Get this one file, and extract both exe from it?

Thanks in advance

Elminster

Quickie Please - Scanning Serial Ports
Is there some routine/object for doing this, as in the case of drives?

TIA

Reading Serial Ports From Browser
Is it possible to read a serial port from a browser based application? Maybe using JScript?

Serial Comm Ports... Silly Question.
I like very much this subject and i am already reading some guides, the problem is, the xplanations always assume so much sttuff and it is definetely not sth easy to swallow... i was thinkng... YOU the people who actually work with this sttuff in their daily routine, do you use special controls or dll components with VB to access ports and so on or you go all by yourselves... also, IF SO, (i suppose) what controls are preffered and how much do i need to know to use it (just the basics)

Something On Webcams And Serial Ports... (and Voice Ctrls)
Hi everyone,
i have a pair of questions for you! Help me please!
1) How can i manage my webcam in a VB program? Is there a control for this?
2) And for the serial(or parralel) port?
3) Does anybody know how to make my directSS speak in italian? It speaks only in english or with english pronunciation!
4) Can you explain me how to use voice recognition in VB?

Thanks a lot!

REgarding Serial Port Communication With Greater Ports
Hi,
Actually i have to set serial ports greater than 16 for communication.
for that i used
There was a hack that came around about modifying the MsComm control to
access greater than 16 ports:
"In the code there is a unique sequence of three bytes, 3d 10 00. Pick a hex
editor and change the value 10 to say 7f. Now you have changed the default
value of a variable MAX_PORTS to 127. The name of the variable is arbitrary.
Save the changed file and off you go." the problem in using this was when some one reinstall the setup the ocx which we created is getting replaced by the old ocx so is there any way to replace an ocx(Mscomm32.ocx) which is being used by the project by another ocx which i has made by hacking the existing ocx and stored in the system file ,this has to replace the system ocx which is used by it at runtime .

give me other ways also for setting up communication with the higher ports

How To Get The Number Of Serial Ports In A Computer For Mscomm Application
Hi,Gurus.How to get the Number of serial ports in a computer for mscomm application.my project is in lagging without it.plz help me

Communicating To Serial Ports With Comm Port Number Greater Than 16
I want to connect to the serial port with comm port number greather than 16, im able to connect to ports with comm port number less than 17 using MSCOMM control in visual basic, but i need to communicate to ports till 256, can anyone please help me out on this.

How To Control Com-ports
i need to write a porgramm which is able to control the com-ports.

Which code could i use??

How Can I Control Com Ports
Hi!
I am looking for code(vb6) or software that i can use to talk to the com ports. I want to detect if there is any devices connected to the ports and also issue instructions to the port. I want open/close a port. Basically i want to have control over the ports. Can any help me please. [Please excuse my choice of words]

Control Firewall Ports
Hi, let me see if I can explain my problem

I have a Cisco PIX firewall on my local LAN, it opens 1025 ports for communication and I have a software that randomly uses 3 out of those 1025 opened ports for each session of the software. Now What I need to do is to control those ports, so when the software selects wich 3 port it is going to use, I need to close the other 1022 port, for security reasons...

Has anyone done somethig like this?, how can I achieve this using VB.

Please any help or suggestions would be appreciated.

Thanks in advance.

Alejandro.

How Do Firewalls Have Full Control Over Ports?
Hey everyone!
I'd like to make a question that I think is not simple:
I know that there are firewalls that have practically full control over ports.
How do they do that?
How do firewalls keep a port closed; how do they keep it stealthy?
And... how do they turn off a connection?

I think these answers won't help me much at programming, but I was just curious.

Thanks for all your time
Regards
angelofwisdom

p.s.: I was unsure of where to post. Either "Communications" or "Tech Discussions". I hope I chose the right forum. If not, then sorry...
p.p.s.: I hope the title was clear enough...

MSComm Control Multiple Ports
Hi All,

Can anyone tell me if it is possible to have 2 comm ports open using the MSComm control?

Am I able to poll both ports sequentially (using the OnComm event), or do I need to close port 1 before I poll port 2?

Thanks in advance,

Max

Winsock Control With Multiple Ports
Hi,
I am using Winsock Control in VB6.0. The server program is running in one machine with one winsock control array. I am running 1 client program in another machine which communicates with server without any problem.Now, I have to run 3 instances of my client program in one machine. So, the server IP address in client programs is given same in all the instances. But the port addess is different in each client programs to communicate with the server program. My question is,
1.How the server program identifies the port of client program and responds to the particular client's request?
2.Should I have more than one winsock control array having ports corresponding to each client in server program?
Pls reply....
Thanks in advance.

How To Control IO Ports (read/write) From VB ?
I want to control IO ports (read/write) on my WIN98 pc, providing me with binary inputs and outputs.
How do I do that under VB5.0 ??
I need something similar to INP and OUT, as used in other basic dialects.
Who can help me ?

Problem Of Data Sending Using Two Serial Com Ports</title> <script Type="text/javascript"> <!-- Function PrintTags() { Var Curr=document.getElementById('vB_Editor_QR_textarea').value; Newval=curr.repl
Hi everyone,

Im facing some problem in data sending using two serial com port(RS232).

here is my VB code,

Code:
Private Sub MSComm1_OnComm()
Dim bytToSend1(0) As Byte
Dim strData As String
Select Case MSComm1.CommEvent
Case comEvReceive
'
' The Pic has sent us something notification to allow next data'
'
If boFinished = False Then
strData = MSComm1.Input
'
' Send the next byte
' and increment the next byte pointer
'
bytToSend1(0) = send_L(intNextByte1)
MSComm1.Output = bytToSend1()
intNextByte1 = intNextByte1 + 1

'
' When we've sent 10 bytes we've finished
' so set the finished flag
'
If (intNextByte1 = 10) Then
boFinished = True
MsgBox "All data1 has been sent"
intNextByte1 = 0
boFinished = False

End If
End If

End Select
End Sub

Private Sub MSComm2_OnComm()
Dim bytToSend2(0) As Byte
Dim strData2 As String
Select Case MSComm2.CommEvent
Case comEvReceive
'
' The Pic has sent us something notification to allow next data'
'
If boFinished2 = False Then
strData2 = MSComm2.Input

'
' Send the next byte
' and increment the next byte pointer
'
bytToSend2(0) = send_R(intNextByte2)
MSComm2.Output = bytToSend2()
intNextByte2 = intNextByte2 + 1

'
' When we've sent 10 bytes we've finished
' so set the finished flag
'
If (intNextByte2 = 10) Then
boFinished2 = True
MsgBox "All data2 has been sent"

intNextByte2 = 0
boFinished2 = False

End If
End If

End Select
End Sub


Im using two com ports in the serial communication which connect to two independent PIC circuits.

im have ten pair of data (send_L() and send_R() which are in one byte each) that need to send out to two of my PIC circuits. lets say that, data of send_L() is for PIC circuit 1 and data of send_R() is for PIC circuit 2.
the first pair of data is send out automatically and after my PIC have finished process the first data, it will send a notification to VB to allow the next data come in.

my problem is, this code is sending data independently to each of the PIC without synchronize with the other.
the first pair is working fine but when it come to the next data,VB send the
data whenever which of the PIC send the notification 1st (because the time for the data to process in PIC is different), so this cause the data that send out is not synchronize with the other.

Can i make my VB to send the data in pair, in other word VB will send out the next pair of data when VB receive two notification from each of the PIC.

can anyone help me? what should i write in the VB code? thanks.

Control Serial Port
Is there a way to control the serial receive port.

What i mean is that let's said i will just want to receive 500 data and wait for 5 secs then receive the next 500 data.

I tried to do that using a timer but it does not help.

For example.
I need to receive a 26k bytes of data or more and becaue of the InBufferSize limitation, I have to receive in batches.

What i discover is that if the serial port is idle for a time period the buffer itself can be reuse again. But if the receive buffer is been receiving all the time, it will have the problem of buffer overflow.

So to solve that i will receive in batches and wait for a period so that i can use the buffer again.

Can it be done in this way ??

VB6 Control For Serial Communication
Hi all, I'm a newbie
I'm not sure if i'm asking on the rigth forum, i hope somebody could redirect me if i'm wromg.

I'm working on a project working with microcontoller device that plan to recieve/transmitt data to PC via serial COM port.
I tried to build the software my self using visual basic6.
does anybody know any links where i could find helpfull info?
anybody know which VB6 control to be use?

thank you

Serial Activex Control
Hi there,

I have this code that i used to communicate to a device on a serial port. It worked as an exe. I needed to convert it into an active x control so I could inbed it in a web browser. Now I am getting an error that the port is already in use by another program. Can anyone see where I went wrong?

Julie

Control The Serial Port
i have Electronic attendence Machine (Bar code reader type)
i want download all the data at the machine through VB Program
how can i do this.
the machine is connet through serial port (com1 or com2)

Modem And Serial Control
I Post Again A Message After Not Receving An Answer
:
How can i use the modem with vb (mscomm32.ocx)
i have some few problems -
1. when i send information for the modem ex: MsComm32.Ouput "ATZ"+Chr$(13)
i will get in the Print Mscomm32.Input ;
: "ATZ OK" ? why do i see the atz , i wanna see only the ok
i wanna see only the reaction
Another thing : if anyone knows how to program fire effect ( i need for a spaceship engine) please give me an example
2. i need some wavs for spaceship engine and stuff
it would be very nice

if anyone knows how to ROTATE pictureboxes Pixel-By-Pixel
( Sin,Cos Rotation Formulas) please tell me also

SoLong And Thank You For Reading So Much Bulshit
:-)

How To Control The Serial Port?
Hi, i want to be able to send data thru the Tx and Rx pins of the serial ports in order to control their voltage levels. This is to be interface with a relay. Is there any ways which allow me to send +5v or -5V to thru the serial port? Thanks

VB Ms Comm To Control Your PC Serial Port
Hi guys, I'm really REALLY new to VB and i would like to learn more. I have been given a task to complete, and i seriously don't know where to start. I hope you guys could give me some guidance and examples.

TASK:writing simple codes in VB you can send some ‘On’ and ‘Off’ state to your serial TX output. You should be able to see some results from the MMU. You will find that the voltage would be too high and not feasible for your circuits. That is why you need a voltage translator, Max232 or SP3203EEY. The output from these devices will be within the 5V range that you can communicate it with other logic devices such as your microcontroller. Since the output from a serial port is in serial you will need a SP converter. It will convert your data to parallel form. This you will have to find out yourself what chip is able to do this. The output of this chip will then be channeled to simple LEDs to show you the display.

How To Control The Serial Or Printer Port?
I'm trying to control the opening of the door or gate using computer. and I'm trying to design a controller in VB that use the power of serial or printer port of the pc so that the pc can send a signal using a port down to the relay to switch the gate. do you have any guide or can you explain how to control the power or which pin that hold the power on ports? example? or code?. or any suggestion that i should have to research so i can elaborate more, regarding my problem.

hope someone can help me.

thanks

Comm Control 6.0 And Serial Printer
Hi,

I have a situtation where I have two programs using the same serial port. Usually COM1. We have a hardware device that handles which device receives the communication.

The two things are: 1) Serial printer 2) My VB Program. Neither of these can change.

The issue: It appears that when we do a reboot, the serial printer steals the Serial port so my VB Program always gets a "Run-time error '8015': Could not set comm state, there may be one or more invalid communcations parameters."

I can't appear to set the printer so it doesn't steal the port. Is there a way to force control of the serial port within my VB Program so I gracefully gain control of it even though the printer asked for it first? Any other suggestions?

Thanks,

Scott

Copyright © 2005-08 www.BigResource.com, All rights reserved