找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2869|回复: 8

[其它] ROS搭配8051单芯片应用….

[复制链接]
发表于 2007-3-8 12:12:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
小弟想利用ros的 Scheduler 功能命令ROS串口输出”字元”让外部的8051单芯片接收ROS串口解码来做简单的自动控制.
请教前辈有人知道该如何让ROS命令串口输出英文字元吗?(RS232的第3只脚 TXD)
routeros
发表于 2007-3-8 16:50:25 | 显示全部楼层
,这个……
大概要问mikrotik了,看他留了编程接口没有。
routeros
回复

使用道具 举报

发表于 2007-3-10 11:41:40 | 显示全部楼层
楼主的这个想法不错啊,通过单片机控制外围的设备


答案下面有:
来自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 [/interface ppp-client find name="scripttemp"]
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).

routeros
回复

使用道具 举报

 楼主| 发表于 2007-3-10 20:21:34 | 显示全部楼层
原帖由 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 编辑 ]
routeros
回复

使用道具 举报

发表于 2007-3-10 23:28:04 | 显示全部楼层
太深奥了
routeros
回复

使用道具 举报

发表于 2007-3-11 08:43:01 | 显示全部楼层
原帖由 YAWPYNG 于 2007-3-10 20:21 发表


哈,太感谢了,一直都没想到用PPP Client这部份.
真是一语点醒梦中人,谢谢.



不用谢
routeros
回复

使用道具 举报

发表于 2007-3-11 09:05:03 | 显示全部楼层
lhn1324是个好同志。
routeros
回复

使用道具 举报

 楼主| 发表于 2007-3-13 23:52:05 | 显示全部楼层
嘿嘿 , 测试成功了, 可以命令 ROS 串口送出字元了,再来就只剩下单片机的部份啰.
再次感谢lhn1324兄台.


                               
登录/注册后可看大图


[ 本帖最后由 YAWPYNG 于 2007-3-13 23:53 编辑 ]
routeros
回复

使用道具 举报

发表于 2007-3-16 13:11:55 | 显示全部楼层
搞好吗?
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-9-30 03:31 , Processed in 0.078273 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表