回复:AR1,AR2问题请教

火麒麟

西门子1847工业学习平台

  • 帖子

    571
  • 精华

    18
  • 被关注

    20

论坛等级:侠圣

注册时间:2006-09-21

普通 普通 如何晋级?

发布于 2011-09-20 10:57:43

22楼

If you use the programming options below together with the registers and accumulators listed, you must make sure you restore the contents of the registers or accumulators yourself, otherwise errors may occur.

Using the following higher-language constructions may cause the contents of the DB register and address register AR1 to be modified:

Fully-qualified DB access (for example, DB20.DBW10) as an actual parameter for a function (FC)

Function block (FB) and multiple-instance calls

Structure components of a formal parameter as an address within an FC or FB

Structure components of a formal parameter as an actual parameter for an FC or FB

With FB, FC, and multiple-instance calls, you should not use the RLO or accumulator 1 or 2 as additional (implicit) parameters.

The DI register and address register AR2 are used on the system side for the FB and multiple-instance calls and should not therefore be modified within FBs.

Address register AR1 is used by some of the loadable standard blocks.

The command "L P#parameter_name" loads the address offset of the specified parameter within an FB, relative to address register AR2. In order to determine the absolute offset in the instance data block in multiple-instance type FBs, you must also add the area-internal pointer (address only) of the AR2 register to this value

这是STEP在线帮助中的说明
对于第二条,我当初曾深受其苦,在FB中调用了系统自带的作为多重背景调用的FB后,当前DB号也被改变了,导致程序错误
业精于勤,行成于思
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-300/400

共有54617条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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