4

Im very new to this and am probably in over my head but i had an idea to make part of my job easier so i wanted to try.

Im wanting to put together a batch and input file to send commands to a serial device. mode com1 baud=9600 parity=n data=8 stop=1 copy in.txt com1: and get a response from the device in a text file. copy com1: out.txt

in.txt contains the commands to send to the device. i have searched and searched and have ended up here many times as i think this is were i found my examples from. problem is it works then doesnt work. any help in the right direction is greatly appreciated. the codes being sent are for example through hyperterminal are ctrl+A200. Per my research a ctrl+A a square. again it works and then id doesnt and im not completely understanding why. think it has something to do with formating of the text file. also the out.txt doesnt always contain the response.

  • 2
    A google search "autohotkey com port" will get you to http://www.autohotkey.com/board/topic/26231-serial-com-port-console-script/ where you will find information on how to achive this. Please try this and post your code, if you have specific problems. – 576i Nov 27 '13 at 09:28
  • not sure, what's your problem, but maybe this can help: http://stackoverflow.com/questions/16944154/how-do-i-send-dos-commands-to-my-receipt-printer-via-com1/16945984#16945984 Also see the "Related" posts there (the small column at the right side, below the advertisings) – Stephan May 09 '14 at 06:23

1 Answers1

1

On the old DOS days this was done within a simple:

echo "your commands" > com1

Today if you need a better control of the process you could use SerialSend which allows you to change the baudrate and send the commands to usb devices and more:

http://batchloaf.wordpress.com/serialsend/

NetVicious
  • 3,848
  • 1
  • 33
  • 47