computing
  • 3

Serial Port Communication With Batch File

  • 3

I currently have a program called serialterm.exe, which is designed to open a serial port an allows me to send data to a serial port. The program works well in Command line, but the minute I transfer the instructions to a batch file I have a few problems.
I need this batch file to enter in data, that the program will send to the serial port.

My current code:
serialterm.exe com1 9600 acsii empty no C:\test1.txt
Succesfully opens the program and then waits for some form of user input.
IS their any way to put code into the batch file that would allow user input to be simulated, or allow me to send data to a serial port.
All help well apreciated

Share

1 Answer

  1. Stated this is a Programming Forum question as there is no DOS in Windows XP, if serialterm.exe reads its input from stdin then it should accept data redirected from a text file holding the simulated user’s input, e.g.

    serialterm.exe com1 9600 ascii empty no C:\test1.txt < input.txt
    

    or as a better alternative

    echo.User's Text | serialterm.exe com1 9600 ascii empty no C:\test1.txt
    

    Anyway a program is required to READ data from a serial port while to send text to a serial device batch commands suffice.

    What you need is not fully clear however.

    • 0