Jump to content

Handling Serial Port with script - Tera Term application


Recommended Posts

Hello,

I would like to control a device connected to my PC over a serial cable.

I'm really a newbies in Auto-It and I managed to get a hyperterminal-like program (in this case Tera Term) launched, the serial port configured and opened.

I see the character strings coming out of the serial port, but I don't know how to catch them - and how to send commands on the port.

I would like to:

- check some information on the character flow sent by my device (like Revision number of the firmware, MAC address, IP address, etc...). Can I store these information in variables?

- send commands after the prompt is recognized

Can I do this over an Auto-It script controlling the hyperterminal software or should I create my own GUI with direct support of the serial port (over an external API maybe...)?

Any hint is welcome.

Thanks.

Link to comment
Share on other sites

Hello Sebastien,

I've been working for a long time with AutoIt and Tera Term and I can tell you this:

To send commands to Tera Term you will need to use

ControlSend ("Tera Term", "", "", "command you wish to send")

take a look at this command and keep in mind the following:

- you need to use an empty control ""

- you need to be sure that Tera Term window is active at the moment when the command is sent

- you need to be sure that the title will match the one in ControlSend

To get the text from Tera Term - activate the "log" ability and just simply read the log file.

Feel free to ask anything and I'll help.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...