ROS搭配8051单芯片应用….
小弟想利用ROS的 Scheduler 功能命令ROS串口输出”字元”让外部的8051单芯片接收ROS串口解码来做简单的自动控制.请教前辈有人知道该如何让ROS命令串口输出英文字元吗?(RS232的第3只脚 TXD) :L ,这个……
大概要问mikrotik了,看他留了编程接口没有。 楼主的这个想法不错啊,通过单片机控制外围的设备
答案下面有:
来自http://wiki.mikrotik.com/wiki/Sending_text_out_over_a_serial_port
Sending text out over a serial port
From MikroTik Wiki
Sometimes there's a need to send out some (short) text over a serial port to control other devices.
As RouterOS doesn't (yet?) provide a native command to do that, you can work around with the following little script:
/interface ppp-client add name="scripttemp" port=serial0 modem-init="I am the string" null-modem=yes disabled=no
:delay 1
/interface ppp-client remove
The following assumptions were made:
We want to use serial port "serial0"
We have configured the serial port to match the other devices' setup (baud-rate etc.)
serial0 (or whatever port you use) is not used by RouterOS serial-console
The script sends the text configured as modem-init string out over the serial port when run.
So in the example above, it would send "I am the string" (without the quotes).
:victory: 原帖由 lhn1324 于 2007-3-10 11:41 发表
楼主的这个想法不错啊,通过单片机控制外围的设备
答案下面有:
来自http://wiki.mikrotik.com/wiki/Sending_text_out_over_a_serial_port
Sending text out over a serial port
From MikroTik Wiki
...
哈,太感谢了,一直都没想到用PPP Client这部份.
真是一语点醒梦中人,谢谢.
[ 本帖最后由 YAWPYNG 于 2007-3-10 21:07 编辑 ] 太深奥了 原帖由 YAWPYNG 于 2007-3-10 20:21 发表
哈,太感谢了,一直都没想到用PPP Client这部份.
真是一语点醒梦中人,谢谢.
:lol 不用谢 lhn1324是个好同志。 嘿嘿 , 测试成功了, 可以命令 ROS 串口送出字元了,再来就只剩下单片机的部份啰.
再次感谢lhn1324兄台.
http://img244.imageshack.us/img244/4944/rosrs232testou3.jpg
[ 本帖最后由 YAWPYNG 于 2007-3-13 23:53 编辑 ] 搞好吗?
页:
[1]