回复:请教高人!!s7-200与pc通信问题????急急急!!!

Amcorben

  • 帖子

    164
  • 精华

    1
  • 被关注

    0

论坛等级:游士

注册时间:2003-06-06

普通 普通 如何晋级?

发布于 2003-05-19 16:04:06

0楼

The Receive Message function is automatically terminated in case of an overrun or a parity error. You must define a start condition, and an end condition (maximum character count) for the Receive Message function to operate. A receive is started when the communication line has been quiet or idle for the number of milliseconds specified in SMW90 or SMW190. When the Receive instruction in your program is executed, the receive message function initiates a search for an idle line condition. If any characters are received before the idle line time expires, the receive message function ignores those characters and restarts the idle line timer with the time from SMW90 or SMW190. Start character detection: The start character is any character which is used as the first character of a message........自由口格式的问题你去看联机文档。
因为自由口是字符模式,mscomm也要设成字符模式。要想把数字发送出去,可以这么转换:
TEXT1 = "字符串1" '前面的字符串
TEXT3 = "字符串2" '后面的字符串
iNum = 123 '数字字节
TEXT2 = chr$(iNum)
MSCOMM1.OUTPUT = TEXT1 + TEXT2 + TEXT3 + chr$(13)

这样PLC收到的TEXT2部分就是数字123(十六进制7B)
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-200

共有33257条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。