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.

Reading the COM ports of your PC How to?????

Status
Not open for further replies.

cubdh23

New Member
Hi does anyone know how to read the Ports via RS232 input to your computer. I need to use a program to input a few bits of data at a constant rate then use the data later on. What program would be best to do this with. Visual C ++???? Visual basic? I know i can do it with Labview but the software is too expensive for this project. With visual C++ can i make graphics too like a red light yellow light green light that turns on depending on input?
desparatly need help
thanks
Prior back Friday.
 
All of the languages you mention either have built in function calls or available APIs from micro$oft ( I assume we're talking windoze.)
Both serial (Rs-232) and parallel ( centronics) ports can be written to and read from. Pick the language that You are most comfortable with.

Good informational source here.
**broken link removed**
 
I am a VB.NET programmer and i did a lot of project using the VB and the comm.

To be honest its a lot simpler to use VB6 (with the MSCOMM) but you can do it in VB.NET with the microsoft's API samples (do a little search @ https://msdn.microsoft.com ).

In order to read or send a serial data to/from the com port you need a Microcontroller that has a serial UART like the PIC's or the 8051...
 
What do you mean by serial Uart?
The one im using has a 9 pin rs232 and also a 4 pin rs232
I most use both of them. The 9 pin going from controller to PC and i need to use the 4 pin to read an indicator. The 4 pin has grd, transmit and recieve and no connect. Iv never done this before but is that enough pins to read the indicator? Indicator output is RJ 12. So RJ 12 going into my 4 pin rs232. Also do you know if the indicator will continuously transmit because i only want to recieve once in a while. I have not the slightest clue as to the code needed to read the indicator with the 4 pin. any ideas?
 
Yea i want to connect 9 pin rs232 to PC. Hey I hope im not asking for too much but would it be possible if you have that VB code nearby if you could give me the code to read the serial port? I have not used VB but i really need to do this part of else my entire project is a bust. thanks
Prior pitch friday :)
 
cubdh23....

tell us what is on the other side of the com port..???

in VB6 it isn't to difficult to archieve your thing..

TKS
 
udi_hakim

I would greatly appreciate if you could do that for me,
Yea parallel is completely different. Ok IM doing a lot of data aquisitions but to make a long story short, i just need to be able to capture serial information via rs232 from my microcontroller SCI port to the PC.
There are a few programs that i manage to do this with. like " COM port toolkit" The problem with this program is it just captures the data but its hard to export it or do usful things with the data. For some reason lot of extra garbage is added. I need to graph my data and be able to export it. I really am not familar with VB or Java so if u can give me a program that; when i send data from my controller it appears and can be exported to log file for use in excel and stuff like that .
thanks
prior pitches in 2 days .
 
mhh..

there are mucho more programs out that just do that..

i know that if you goto the gooogle.com site and there you search for pic basic you get the site of the proton compiler on their site unther examples there is project search and also a prog called terminal..

but if you search in google for it i'm sure you will find something..

if not i also could make something..

but the problem is that it takes fast a couple of hours to do so..

TKS
 
OK i guess ill take out my VB6.0 for dummies book and start reading :-(
Thanks for all the help. If anyone knows of any code online that does read the COM with VB that would be greatly appreciated, but i guess i need to learn basics of VB regardless.
 
cubdh23 said:
OK i guess ill take out my VB6.0 for dummies book and start reading :-(
Thanks for all the help. If anyone knows of any code online that does read the COM with VB that would be greatly appreciated, but i guess i need to learn basics of VB regardless.

Try looking for 'mscomm' that's a commonly used ActiveX component.
 
well..

ahh..


try to use the ms comm object that one is easy to use for com port ****..

also you should use a timer..because pc's are so fast...

(in the timer event you look at your buffer of the com port..)

i have code for you as a example..

hope you can read it will post it when i'm home..

you need a good version of VB o be able to use the comm object..

(the telefhone logo..)

TKS

Tip: learn adding ocx files to you project..
 
Thank you Nigel for the links but im not using a PIC
IM using motorola 6812.
The microcontroller codes is not the problem. The problem is reading the controller and having a log of the results.
OK TKS ill check for that code later if u manage to put it up
thank u all a lot.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top