TCL和TCL串行端口(COM1)命令的免费编译器或解释器 [英] Free compiler or interpreter for TCL, and TCL serial port (COM1) commands

查看:97
本文介绍了TCL和TCL串行端口(COM1)命令的免费编译器或解释器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)是否有结合了tcl编辑器和编译器(或interpenter)的免费软件?

1) Is there any freeware which combine tcl editor and compiler (or interpenter)?

2)使用fconfigure打开串行连接(COM1)之后,如何我可以通过连接发送几个单词的字符串吗?我需要连接到某些硬件,并且希望能够在其CLI上运行脚本。

2) After opening of the serial connection (COM1) using fconfigure , how can I send via the connection, a string of several words? I need to connect to some HW and I want to be able running a scripts on its CLI.

谢谢

推荐答案

尽管我还没有尝试过完整的IDE,但我非常喜欢Active State的Komodo Edit的免费版本,并结合使用 tclshkit 以便在Windows上制作可执行文件。

Although I haven't tried the full IDE, I really like the free version of Active State's Komodo Edit, and use it in combination tclshkit to make executables on Windows.

我很幸运地将Expect与串行端口结合使用对思科交换机进行编程。 Expect的模式匹配能力使其变得非常简单...以下示例在Windows上有效,但我尚未在* nix框上尝试过相同的操作:

I had some luck using Expect with serial ports to program Cisco switches. The pattern matching abilities of Expect made it pretty simple... the following example works on Windows, I haven't tried the same thing on a *nix box yet:

 package require Expect
 set com "COM1"

 if { [ catch { set serial [ open "$com:" "RDWR" ]  } ] } then {
      puts  "Error! Cannot open $com!" 
      exit 1
 }
 fconfigure $serial -mode 9600,n,8,1

 spawn -leaveopen $serial
 send "somecommand\r"
 expect "someprompt"

 close $serial

这篇关于TCL和TCL串行端口(COM1)命令的免费编译器或解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆