<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
  <POU Name="FB_CylinderTempRecord" Id="{2ce3cbbc-233d-4b7c-ab14-1cacd6242d1b}" SpecialFunc="None">
    <Declaration><![CDATA[(* FB_CylinderTempRecord	- number of control signals控制信号的数量:
									one direction is controllable一个方向是可控的
							- type of feedback signal反馈信号的类型:
									feedback in base and work position基准和工作位置的反馈
							- with temperature recording for data analysis具有用于数据分析的温度记录		*)

FUNCTION_BLOCK FB_CylinderTempRecord EXTENDS FB_CylinderTemp
VAR_INPUT
	bRecordStart		: BOOL;								// Signal to start the temperature recording开始温度记录的信号
	tIntervalTime		: TIME;								// Time of intervals to record the temperature记录温度的间隔时间 
END_VAR
VAR_OUTPUT
	bRecordDone			: BOOL;								// True if the temperature recording is done如果完成温度记录，则为True
	aTemps				: ARRAY[1..100] OF LREAL;			// Array with recorded temperatures用于记录温度的数组
END_VAR
VAR
	fbTimerInterval		: TON;								// Timer to control the recording interval控制记录间隔的计时器
	nIndex				: INT;								// Index to handle temperature array处理温度数组的索引
END_VAR
]]></Declaration>
    <Implementation>
      <ST><![CDATA[// =========================================================
;
// =========================================================]]></ST>
    </Implementation>
    <Method Name="Record" Id="{0f70c999-2d3c-4955-9049-a6f6f71c9a4c}">
      <Declaration><![CDATA[METHOD Record
VAR_INPUT
END_VAR
]]></Declaration>
      <Implementation>
        <ST><![CDATA[// =========================================================
// Recording array filled记录数组已填充
	
	bRecordDone := (nIndex = 100);

// =========================================================
// Recording temperatures记录温度
	
	IF bRecordStart AND NOT bRecordDone AND NOT fbTimerInterval.Q THEN
		fbTimerInterval(IN := TRUE,
						PT := tIntervalTime );
	END_IF
	
	IF fbTimerInterval.Q THEN
		fbTimerInterval(IN := FALSE);
		
		nIndex 			:= nIndex + 1;
		aTemps[nIndex] 	:= fTempCurrent;
	END_IF

// =========================================================]]></ST>
      </Implementation>
    </Method>
    <Method Name="Reset" Id="{495f7144-4845-4515-a74d-ec16e7445f79}">
      <Declaration><![CDATA[METHOD Reset
VAR_INPUT
END_VAR
]]></Declaration>
      <Implementation>
        <ST><![CDATA[// =========================================================

// Calling method Reset of base class FB_Cylinder via 'SUPER^.'通过'SUPER^'调用FB_Cylinder的方法Reset
SUPER^.Reset();

// Reset temperature array重置温度数组
FOR nIndex := 1 TO 100 BY 1 DO
	aTemps[nIndex] := 0;
END_FOR

// Reset index重置索引
nIndex := 0;

// =========================================================]]></ST>
      </Implementation>
    </Method>
    <LineIds Name="FB_CylinderTempRecord">
      <LineId Id="3" Count="1" />
      <LineId Id="2" Count="0" />
    </LineIds>
    <LineIds Name="FB_CylinderTempRecord.Record">
      <LineId Id="3" Count="19" />
      <LineId Id="2" Count="0" />
    </LineIds>
    <LineIds Name="FB_CylinderTempRecord.Reset">
      <LineId Id="3" Count="12" />
      <LineId Id="2" Count="0" />
    </LineIds>
  </POU>
</TcPlcObject>