Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to write a one to a com port using a Windows batch file  (Read 4643 times)

0 Members and 1 Guest are viewing this topic.

Ruprecht

    Topic Starter


    Newbie

    How to write a one to a com port using a Windows batch file
    « on: September 16, 2009, 03:23:02 PM »
    Does anybody know if there is a way to write a 1 (high) to a com port using a Windows (XP) batch file?

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: How to write a one to a com port using a Windows batch file
    « Reply #1 on: September 16, 2009, 03:54:00 PM »
    Maybe. But may I ask does it need to be limited to just a batch file that could be used on any omputer?
    It is quite easy to do that in a compiled or interpreted language. 
    Such as VBS or QBASIC.
    Also, when you say "1", do you really mean a break or mark or space. Or do you want an ASCII one to be written once to the serial output.
    What baud rate?
    What about RTS and DSR lines?
    Look over the documentation the MODE command.
    http://www.computerhope.com/modehlp.htm
    (See Serial port)
    Please be more specific ans to what you intend and you will find lots of help thee.

    Ruprecht

      Topic Starter


      Newbie

      Re: How to write a one to a com port using a Windows batch file
      « Reply #2 on: September 16, 2009, 04:13:47 PM »
      I just need a high on the serial port and it needs to stay high forever or unitl a zero is written or power is cycled. For my specific purpose it needs to be executed from a Windows XP batch file.

      Thanks for your help!

      Helpmeh



        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: How to write a one to a com port using a Windows batch file
      « Reply #3 on: September 16, 2009, 04:29:23 PM »
      I just need a high on the serial port and it needs to stay high forever or unitl a zero is written or power is cycled. For my specific purpose it needs to be executed from a Windows XP batch file.

      Thanks for your help!
      And what is your specific purpose. Writing it in VBS will work on any computer. Batch is kinda limiting for this type of thing.
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: How to write a one to a com port using a Windows batch file
      « Reply #4 on: September 16, 2009, 04:51:27 PM »
      OK. I will suppose that you will wire the connector to use the output you need.
      The three outputs are:
      Tx Data
      RTS
      DTR
      Here are links that show wires and the names of the signals.
      http://www.arcelect.com/rs232.htm
      http://airborn.com.au/serial/rs232.html
      (You may already know all that, but it is here for others.)


      On some PCs the BIOS will automatically set the serial ports to the normal state. In any case the mode command can be:
      mode com1: baud=48 dtr=on rts=on

      This turns on both RTS and DTR for the PC.

      When the PC is turned off the lines will drop down to zero bolts.
      But to make sure, the following could be used:

      mode com1: baud=48 dtr=off rts=off

      http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/mode.mspx?mfr=true

      screen shot:
      http://geek9pm.com/pix/mode_com.png
      « Last Edit: September 16, 2009, 05:14:41 PM by Geek-9pm »