Loading ...
Sorry, an error occurred while loading the content.

Com Port Problem - I think

Expand Messages
  • mt_head_98
    A while back I wrote some code to communicate with a piece of equipment at work. It s nothing fancy, just the basic; open Com1:9600,o,7,2,ds0,cs0,rs for
    Message 1 of 3 , May 5, 2007
    • 0 Attachment
      A while back I wrote some code to communicate with a piece of
      equipment at work. It's nothing fancy, just the basic;

      open "Com1:9600,o,7,2,ds0,cs0,rs" for random as #comm

      Print #comm, s$;

      for x = 1 to 1000:next

      dataRead$ = input$(#comm, lof(#comm))

      Close #comm

      Everything worked great using windows 98. When I tried to run the
      code on a system running XP, I can transmit but not receive. I used
      portmon and it looks like I'm sending the same string in XP as I am
      sending running 98.

      Just wondered if anyone else has had the same problem and found a
      solution?
    • Zoom Kat
      I d try replacing the for...next loop with a timer delay like below. The for/next loop may be completing before the gizmo can send back the info. timer 50,
      Message 2 of 3 , May 5, 2007
      • 0 Attachment
        I'd try replacing the "for...next" loop with a "timer" delay like below. The
        for/next loop may be completing before the gizmo can send back the info.

        timer 50, [delay]
        wait

        [delay]
        timer 0

        >A while back I wrote some code to communicate with a piece of
        >equipment at work. It's nothing fancy, just the basic;
        >
        >open "Com1:9600,o,7,2,ds0,cs0,rs" for random as #comm
        >
        >Print #comm, s$;
        >
        >for x = 1 to 1000:next
        >
        >dataRead$ = input$(#comm, lof(#comm))
        >
        >Close #comm
        >
        >Everything worked great using windows 98. When I tried to run the
        >code on a system running XP, I can transmit but not receive. I used
        >portmon and it looks like I'm sending the same string in XP as I am
        >sending running 98.
        >
        >Just wondered if anyone else has had the same problem and found a
        >solution?
        >

        _________________________________________________________________
        Get a FREE Web site, company branded e-mail and more from Microsoft Office
        Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
      • Stefan Pendl
        ... You may have to use the following line directly after opening the device: OUT hexdec( 3FC ),INP(hexdec( 3FC )) or 1 3FC is the com port address. ... Stefan
        Message 3 of 3 , May 7, 2007
        • 0 Attachment
          >
          > A while back I wrote some code to communicate with a piece of
          > equipment at work. It's nothing fancy, just the basic;
          >
          > Everything worked great using windows 98. When I tried to
          > run the code on a system running XP, I can transmit but not
          > receive. I used portmon and it looks like I'm sending the
          > same string in XP as I am sending running 98.
          >
          > Just wondered if anyone else has had the same problem and
          > found a solution?
          >

          You may have to use the following line directly after opening the device:
          OUT hexdec("3FC"),INP(hexdec("3FC")) or 1

          3FC is the com port address.

          ---
          Stefan Pendl
        Your message has been successfully submitted and would be delivered to recipients shortly.