New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

RS-232 Device error

  • Filter
  • Time
  • Show
Clear All
new posts

  • RS-232 Device error


    I try to connect serial with an MDE-Unit for sending
    und receiving data.

    The settings are 19200 bauds, no parity, 8 data bits,
    and 1 stop bit. It uses RTC/CTS hardware handshaking.

    I opened at the right com-port 2 with:

    open "com2:19200,N,8,1" as no%

    but I get an Device Error 24.

    I tried it with:

    open "com2:19200,N,8,1,cs,ds" as no%

    and then receiving of data works but not the sending of
    data. What´s wrong ???

    Thank for help.

    Matthias Kuhn


  • #2
    If your modem is external:

    1. Make sure your modem is turned on before executing the

    2. Make sure you have your RTS/CTS wires hooked up. Sometimes,
    a modem cable will come with only the Rx/Tx/Gnd wires. This
    requires the use of Xoff/Xon.

    To check this, try the following:

    open "com2:19200,N,8,1,rs,cs,ds,cd" as no%

    This will disable all flow control but you should be able to
    check for full dux operations.

    3. If you are running the program in a windows DOS box, windows
    may be hogging the comm resources preventing a successful
    connection. You may have to free up or disable these resources.
    I don't know how this is done but I have heard of it being done.


    [This message has been edited by Mel Bishop (edited May 06, 2001).]
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.


    • #3

      Perhaps your cable has only three wires (tx, rx and zero).
      Then you must add "rs,cs,ds,cd" in order to ignore the signals not wired.

      Or you can OPEN without options, short-circuiting the pins in the connector. If you want I may tell you the pins involved (I don't remember which are just now).




      • #4
        Thanks Mel & Pere

        for Your ideas - but I worked with the pure Dos of Win95 not in
        a Window without starting the graphical mode.

        The MDE-Device has a Demo-program an this works under Win95 with
        using aktiveX-Support and that cable very good.

        So I think that it is a software problem.


        Matthias Kuhn



        • #5
          Matthias, have you tried their suggestions? They sound pretty good to me!

          Tom Hanlin
          PowerBASIC Staff


          • #6
            First of all: when I posted my reply I hadn't read Mel's one (it covers more questions than mine). Sorry.

            Getting to the point:

            The MDE-Device has a Demo-program an this works under Win95 with
            using aktiveX-Support and that cable very good.

            So I think that it is a software problem.
            The problem is that software must match the cable.
            I don't know what is a MDE device, but if all the RS signals were wired in a standard way, and the MDE device manages them in a standard way, OPENing without parameters would be right.
            The Demo-windows-program manages the RS signals according how they are wired.
            We need to know which signals are wired and how the MDE device manages them (perhaps in the documentation of the device?)




            • #7
              Thanks Tom and Pere,

              for Your idea´s. The only information i´ve had was:

              19200,N,8,1 and RTS/CTS Handshake not more at all.

              A MDE - Device is handheld skanner with a little display and
              a small keyboard - it looks like a handy. Is is called Picco-
              Link and it comes from Norway.

              It is connected over radio with a base-station and the
              base-station is conneced with a serial RS232 with the

              I´ve spent lot of hour´s to get the Device on working. Receiving
              was good but sending not. May be I´ve made mistakes on building
              the sending string - may be not.

              The point was : PB didn't support the easiest way: the microsoft
              ActiveX - protokoll. So I think PB is out of date for solving such
              purpose easy and in short time.

              I´ve had the Device for 14 - days to test but the time is over
              and I've sent it back - unfortunately.

              Best regards from Germany

              Matthias Kuhn



              • #8
                Originally posted by Matthias Kuhn:
                The point was : PB didn't support the easiest way: the microsoft
                ActiveX - protokoll.
                Sorry, but that is not a point at all. An ActiveX is a 32-bit Windows library (very similar to a DLL), not a protocol! The use of an ActiveX is completely irrelevent to the problem you faced.

                Essentially, this was a software problem, but in your code not PowerBASIC. The replies you received in this thread indicate that you did not post enough information about the hardware, and probably indicate that the manufacturer did not supply enough in-depth information either.

                Sure, their ActiveX worked because they have correctly set up the comms parameters for the port. Your app was attempting to duplicate the functionality of the ActiveX but you did not appear to have all the necessary info to do so.

                It is a pity you did not have a bit more time to evaluate the item once you sorted out your port parameters.

                PowerBASIC Support
                mailto:[email protected][email protected]</A>
                mailto:[email protected]