FUNCTION "libWIN_Chuck" :VOID
VAR_IN_OUT
Structur :S7_CHUCK;
ptr AT Structur :S7_CHUCK;
END_VAR
VAR_INPUT
HydPumRun :BOOL;
END_VAR
VAR_TEMP
Tc :REAL;
PressueMin :BOOL; // Pressure Minimum after Delay Time
TimOut :BOOL; // Time Out Delay Time
CenOff :BOOL; // Flag for Center off
ClmDelOk :BOOL; // Flag for Clamping Ok
END_VAR
CONST
CMD_READY2CLOSE :=3;
CMD_READY2OPEN :=4;
CMD_OPEN :=5;
CMD_CLOSE :=6;
CMD_CENTER :=7;
CMD_DISABLE :=8;
VERSION :=4.1;
//Alr Mode
PrsMin :=8; // Alr Mode Bit 0,in S7 the low Byte of a Word is the left one (7..0_15..8)
TimeOut :=9; // Alr Mode Bit 1
END_CONST
BEGIN
(* tc *)
tc:=libTOOLS_OBInfos.TC;
//==================
//***Version***
//==================
ptr.Vrs:=VERSION;
//=================
//***Faults***
//=================
//==Pressure minimum==
libTOOLS_Delay(TimValSec:=ptr.PrsMinDelSet, Run:=ptr.VlvClsOup AND NOT ptr.InpPrsMin AND HydPumRun AND ptr.AlrMod[PrsMin], On:=PressueMin, TimActSec:=ptr.PrsMinDelAct);
libTOOLS_FltInp(InpFlt:=PressueMin,FltRst:=ptr.FltRst, Flt:=ptr.AlaPrsMin);
//==Timeout==
libTOOLS_Delay(TimValSec :=ptr.TimOutSet, Run:=((ptr.Mode=CMD_OPEN) OR (ptr.Mode=CMD_CLOSE)) AND ptr.AlrMod[TimeOut], On:=TimOut, TimActSec :=ptr.TimOutAct);
libTOOLS_FltInp(InpFlt:=TimOut,FltRst:=ptr.FltRst, Flt:=ptr.AlaTimOut);
//==Delay for Center==
libTOOLS_Delay(TimValSec :=ptr.TimFixSet, Run:=(ptr.Mode = CMD_CENTER), On:=CenOff, TimActSec:=ptr.TimFixAct);
//===============
//***Mode***
//===============
,我想知道CONST
CMD_READY2CLOSE :=3;
CMD_READY2OPEN :=4;
CMD_OPEN :=5;
CMD_CLOSE :=6;
CMD_CENTER :=7;
CMD_DISABLE :=8;
VERSION :=4.1;
//Alr Mode
PrsMin :=8; // Alr Mode Bit 0,in S7 the low Byte of a Word is the left one (7..0_15..8)
TimeOut :=9; // Alr Mode Bit 1
END_CONST这部分对应的地址是什么
最佳答案
不记得iec61131的格式化文本中可以声明const。
类比一下其他平台吧,仅供参考。
这些都是符号地址。若想看绝对地址,要看变量配置选项。一般重要的IO都是在变量声明中标出了绝对地址如:
start at %ix0.0 :bool:=0;(*声明为输入点、布尔量、初值为0*)
提问者对于答案的评价:
thanks
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc305954.html