Projektdateien hinzufügen.

This commit is contained in:
Matthias Heisig
2024-01-04 15:15:26 +01:00
parent 4c6f8dc5bd
commit faa33db290
94 changed files with 15104 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="FB_MotorMockup" Id="{2caa045e-1cb0-4e4b-ae71-f86aa7b0d7a4}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_MotorMockup
VAR_INPUT
// Enable motor
xEnable AT%I* : BOOL;
// Motor setpoint
iSetpoint AT%I* : INT;
END_VAR
VAR_OUTPUT
// Motor circuit breaker ok
xMCBOk AT %Q* : BOOL;
// Repair switch ok
xRepairSwitchOk AT %Q* : BOOL;
// Motor speed feedback
iMotorSpeedFeedback AT %Q* : INT;
END_VAR
VAR
_iInternalSetpoint : INT;
_fbRampGenerator : FB_RampGenerator;
_fbValveAnalogInput : FB_AnalogInput('');
_stAnalogScaling : ST_ANALOG_IO_CONFIG := (iAIMax := 32767, iAIMin := 0, rPVMax := 100, rPVMin := 0);
_stAnalogEWConfig : ST_ANALOG_EW_LEVELS;
_stAnalogEWDelays : ST_ANALOG_EW_DELAYS;
_fbValveAnalogOutput : FB_AnalogOutput('');
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Set MCB and repair switch ok
xMCBOk := TRUE;
xRepairSwitchok := TRUE;
// Turn motor off if enable signal is not set
IF xEnable THEN
_iInternalSetpoint := iSetpoint;
ELSE
iSetpoint := 0;
END_IF
// Calculate setpoint 0% - 100%
// from analog value
_fbValveAnalogInput(
iAnalogValue:= iSetpoint,
stScalingConfig:= _stAnalogScaling,
stEWConfig:= _stAnalogEWConfig,
stEWDelayConfig:= _stAnalogEWDelays,
xUnderrange:= FALSE,
xOverrange:= FALSE,
xErrorCard:= FALSE,
xReleaseErrors:= FALSE,
xReleaseLimitErrors:= FALSE,
xReleaseHardwareErrors:= FALSE,
xConfirmAlarms:= ,
xError=> ,
xWarning=> ,
rScaledValue=> ,
xErrorLow=> ,
xWarningLow=> ,
xWarningHigh=> ,
xErrorHigh=> );
// Ramp generator for speed simulation
_fbRampGenerator(
rTarget:= _fbValveAnalogInput.rScaledValue,
rTargetMin:= 0,
rTargetMax:= 100,
timRampUp:= T#10S,
timRampDown:= T#10S,
rSetpoint=> );
// Calculate analog output from ramp generator setpoint
_fbValveAnalogOutput(
rSetpoint:= _fbRampGenerator.rSetpoint,
stScalingConfig:= _stAnalogScaling,
xReleaseErrors:= FALSE,
xReleaseHardwareErrors:= FALSE,
xConfirmAlarms:= ,
iAnalogValue=> iMotorSpeedFeedback,
xError=> );]]></ST>
</Implementation>
<LineIds Name="FB_MotorMockup">
<LineId Id="23" Count="0" />
<LineId Id="9" Count="0" />
<LineId Id="25" Count="0" />
<LineId Id="83" Count="0" />
<LineId Id="75" Count="0" />
<LineId Id="74" Count="0" />
<LineId Id="76" Count="0" />
<LineId Id="81" Count="1" />
<LineId Id="77" Count="0" />
<LineId Id="26" Count="0" />
<LineId Id="35" Count="38" />
<LineId Id="24" Count="0" />
</LineIds>
</POU>
</TcPlcObject>