回复:博图中优化FB块和非优化FB块的接口变量读写有什么区别吗?

已锁定

kkss

西门子1847工业学习平台

  • 帖子

    45
  • 精华

    0
  • 被关注

    1

论坛等级:侠客

注册时间:2018-03-11

普通 普通 如何晋级?

发布于 2024-04-11 21:54:16

15楼

展开查看
以下是引用宝冬在2024-04-07 14:13:56的发言 >8楼

博图帮助里面有。在 Parameter transfer at block call 下面的 Transfer parameter as copy or as pointer,重点如下。




Note:Parameter transfer between blocks with optimized access and blocks with standard access


If structures are transferred to the called block as in/out parameters during a block call, they are transferred by default as pointers (Call by reference). 


However, this does not apply if the two blocks have different optimization settings: If one of the blocks has the property "Optimized access" and the other block has the property "Standard access", all parameters are always transferred as copies (Call by value). 


If the block contains numerous structured parameters, this can quickly lead to the temporary memory area (local data stack) overflowing.


Problems can also occur if the original operands are changed by asynchronous processes, such as by HMI access or interrupt OBs. If the copies are copied back to the original operands after the block processing, the changes carried out asynchronously since the creation of the copy during the block call are hereby overwritten at the original operands.


You can avoid this by setting the same access type for both blocks or by having the asynchronous access written first to a separate memory area and then copying this area synchronously at a suitable time.


是不是优化的FB inout连接优化块的结构体数据是传引用,不一样时候传值?copy完等FB执行结束再写回去?

评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-1500系列

共有10974条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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