Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help needed for RS 232

zepledzepled Posts: 9Member
Hi,

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,

Juergen

Comments

  • ibyiby Posts: 323Member
    [b][red]This message was edited by iby at 2003-5-3 16:43:37[/red][/b][hr]
    : Hi,
    :
    : 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,
    :
    : Juergen
    :

    [code]
    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...)

    have fun



Sign In or Register to comment.