查看: 287|回复: 1
收起左侧

[教程经验] 汇川PLC 任意类型先入先出方法

邀请回答

马上注册,享受更多特权

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

x
    // Title:            FIFO
    // Comment/Function: Shift the data to  FIFO
    // Library/Family:   
    // Author:           DDA
    // Tested with:      V1.6.2 SP1
    // Engineering:      Lib_Dang
    // Restrictions:     ENO disabled - error handling done with error and status
    // Requirements:     PLC (AM610_AM400)
    //-------------------------------------------------------------------------------
    // Change log table:
    // Version  | Date       | Expert in charge       | Changes applied
    //----------|------------|------------------------|------------------------------
    // 09.00.00 29.7.2021  dangguodong
    // the index the of array must be start with the zreo                  
    //==================================================================================



// Check the param
IF Contianer=0
   OR arrayLenght<=0
   OR elementBytes<=0
   THEN
   FC_FIFO_V1:=FALSE;
RETURN;
END_IF;

   // put the pointer to the array , according of the first pointer
FOR i:=arrayLenght-2 TO  0 BY -1 DO
       
  pointerArray:=Contianer+ INT_TO_DWORD(i*elementBytes);
  pointerArrayNext:=Contianer+ INT_TO_DWORD((i+1)*elementBytes);       
BMOV(pbyDataSrc:=ADR(pointerArray^), uiSize:=INT_TO_UINT(elementBytes) , pbyDataDes:=ADR( pointerArrayNext^));

END_FOR

FC_FIFO_V1:=TRUE;


点评

这个试试  发表于 2023-7-26 14:11




上一篇:s7-SCL编程
下一篇:汇川中大型AC801程序模板分享

已有 0 人打赏作者

回复 邀请回答送花

使用道具 举报

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

本版积分规则

热点推荐

有技术问题,就上汇川技术社区

INOVANCE汇川技术 公众号

扫码下载掌上汇川APP

全国服务热线:8:30-17:30

4000-300124

苏州地址:江苏省苏州市吴中区越溪友翔路16号

深圳地址:深圳市龙华新区观澜街道高新技术产业园汇川技术总部大厦

Copyright © 2003-2100 汇川技术 Powered by Discuz! X3.4 ( 苏ICP备12002088号 )
快速回复 返回列表 返回顶部