locked
Com ports in scripts RRS feed

  • Question

  • I've been banging my head against the screen trying to get a very simple
    command script to work and wondered if anyone could help me. Basically I need a Windows command script (or any type) that runs a batch file (writes a message for test purposes) on receipt of a code word on the serial port. I don't care what the code word is, any event on com1 will do. I have tried:

    MODE COM1: baud=9600 parity=N data=8 stop=1
    @echo off
    :start
    if COM1 LEQ 2 echo working!:eof
    goto start

    The mode command seems to set up the serial port and I can read from it using:

    type COM1

    but regardless of the value I receive on the serial port (ASCII or raw)
    my message is never displayed. Any help much appreciated.
    • Moved by Marco Zhou Tuesday, October 21, 2008 4:35 AM off topic thread from WPF forum (Moved from Windows Presentation Foundation (WPF) to Where is the Forum For…?)
    Friday, October 17, 2008 9:39 AM

Answers