It looks like you're new here. If you want to get involved, click one of these buttons!
C and C++
Delphi and Kylix
DirectX Game dev
Newbie Game Programmers
Database & SQL
Sound & Music
FreeLance Software City
Join the Team
Comments on this site
New programming languages
Off topic board
Mobile & Wireless
Operating Systems & Platforms
Embedded / RTOS
Windows CE & Pocket PC
Quality & Testing
Active Server Pages
HTML & WEB-Design
WEB-Services / SOAP
Help needed for RS 232
I have still a problem to receive data via the RS 232 interface and need a pascal sourcecode that allows the transmission of data to the computer.
It is very urgent and hopefully someone can help me.
Thanks in advance,
Share on Facebook
[b][red]This message was edited by iby at 2003-5-3 16:43:37[/red][/b][hr]
: I have still a problem to receive data via the RS 232 interface and need a pascal sourcecode that allows the transmission of data to the computer.
: It is very urgent and hopefully someone can help me.
: Thanks in advance,
I was posting some code in reply to your earlier post.
Maybe what you need is to get more familiar with work
with the RS232:
- get one straight cable (DB9M-DB9F : 2-2, 3-3, 5-5)
- get one crossover cable (DB9F-DB9F : 2-3, 3-2, 5-5)
- get PC with two COM ports (properly configured and working!)
alternativelly get two PCs, bottom line is you need
[b]two[/b] COM ports. If you are working in DOS,
do yourself a favour and use two computers.
- connect com ports with crossover cable
- open each port using terminal program of your choice
- setup both ports to same speed etc. (9600,N,8,1 for example)
- ensure that when you type something in one of the terminals
same stuff shows on other terminal. this is to check
if ports are operational. if you cannot make this work
forget about programming RS232... seriously!
[b]Note:[/b] OS like NT4, Win2000 and WinXP will probably not work
for you if your pascal program is going to be DOS version.
Try using Win9x or DOS for development. One terminal program
comes with windows. It's called hyperterminal.
- now take that crossover cable away and plug the female side
of the straight cable to one of the ports and male to your
RS232 device (if your device is DTE, you will have to use
the crossover cable)
- open that com port in a new terminal sesion and ensure proper
port settings are used ( 9600,N,8,1...?). Note that you
[b]must[/b] match your PC COM port settings with what your
device is going to use.
- try to communicate with the device from terminal. This might
be difficult in case your device is not using ASCII. If so
you might try to paste prepared and [b]valid[/b] commands
from clipboard into your terminal. Anyway, the absolute
minimum you should be satisfied with is to see
some [b]valid[/b] replies from your device.
- if all above was ok, you can finaly try to write your own program.
simply use the same setup as mentioned in the top of this post
(the part with two terminals) except that your program should be
using one com port. second com port should be used by the terminal
so you can monitor messages sent by your program.
Now few more words about the program. There are plenty of pascal
units for RS232. Usually the best keyword to search for one
is "async" since RS232 is using assichronous transmision.
check my last post for sample code and name of the guy who
wrote it. use those in your search (google, yahoo, altavista...)
Share on Facebook
Programmers Heaven articles
Programmers Heaven files
Programmers Heaven uploaded content
Programmers Heaven C Sharp ebook
Operated by CommunityHeaven
- All rights reserved.