回复:TIA 自制普通电机块

宁超

  • 帖子

    1009
  • 精华

    39
  • 被关注

    370

论坛等级:至圣

注册时间:2012-12-11

普通 普通 如何晋级?

发布于 2017-11-21 14:57:39

59楼

展开查看
以下是引用Zane在2017-10-26 18:15:02的发言 >17楼

 看了楼主和Letham版主的程序贴图,前者是FC+DB,但DB是设置为不保持的,后者是FB,但所有变量都设置为保持的;


断电重启后,该功能块的输出是做如何反应,二位能否说明一下?

1.3 Initialization Implementing an initialization sequence It is usually required to initialize various parameters at the initial call of your block. The block may also contain additional tasks it only has to execute once, depending on the technological function of your block. If this is the case in your block you must implement an initial startup sequence. This is done by defining a BOOLEAN variable, for example sbRESTART, which can be implemented as static variable.  Your block is not only initialized when you restart the system, but also when you reload it while the CPU is in RUN. It is for this reason that you have to integrate the initial startup sequence in the cyclic section of your block. You may therefore, if necessary, distribute the initial startup sequence to several call cycles of the block.  //**************************************************************************** // Dependency on the calling OB //****************************************************************************  // Reading the start info by calling SFC6 (RD_SINFO)  

 DUMMY := RD_SINFO (TOP_SI := TOP_SI, START_UP_SI := START_UP_SI);  

   

 IF sbRESTART THEN   // Initialization sequence      

TOP_SI.NUM := 100;     // Execution of the initialization sequence as restart   

sbRESTART := FALSE;    // Reset initialization sequence   

END_IF; 

// Which OB called the block?  

 CASE WORD_TO_INT(BYTE_TO_WORD(TOP_SI.NUM)) OF  //**************************************************************************** 

// Handling of error OBs //****************************************************************************     

 // OB80: Timeout error     

80:     QH_ALM  := 0;          

 // Reset error outputs     

QL_ALM  := 0;  //**************************************************************************** 

// Startup 

//****************************************************************************      

// OB100: Restart     

100:     QH_ALM  := 0;           

// Reset error outputs     

QL_ALM  := 0;     

siRUNUPCNT := RUNUPCYC;  // Save RUNUPCYC value 

评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-1500系列

共有10590条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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