|
邀请回答
马上注册,享受更多特权
您需要 登录 才可以下载或查看,没有帐号?立即注册
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;
|
上一篇: s7-SCL编程下一篇: 汇川中大型AC801程序模板分享
|