Added Simulation plc and removed unnecessary files from repository

This commit is contained in:
Matthias Heisig
2024-01-04 18:39:55 +01:00
parent 2bd41279b1
commit bd0bbd9c8b
43 changed files with 4692 additions and 1328 deletions

299
.gitignore vendored
View File

@@ -1,267 +1,52 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
### TwinCAT3 ###
# website: https://www.beckhoff.com/twincat3/
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# TwinCAT PLC
*.plcproj.bak
*.plcproj.orig
*.tpy
*.tclrs
*.library
*.compiled-library
*.compileinfo
*.asm
*.core
LineIDs.dbg
LineIDs.dbg.bak
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# TwinCAT C++ and shared types
# ignoring the TMC file is only useful for plain PLC programming
# as soon as shared data types (via tmc), C++ or in general TcCom-Module are used, the TMC file has to be part of the repository
*.tmc
*.tmcRefac
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# TwinCAT project files
*.tsproj.bak
*.tspproj.bak
*.tsproj.b?k
*.tsproj.orig
*.xti.bak
*.xti.bk?
*.xti.orig
*.xtv
*.xtv.bak
*.xtv.bk?
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Multiuser specific
**/.TcGit/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# exclude not required folders
**/_Boot/
**/_CompileInfo/
**/_Libraries/
**/_ModuleInstall/
**/_Deployment/
**/_Repository/
# VS Shell project specific files and folders
**/.vs/
*.~u
*.project.~u
*.suo
*.suo
# Own Ignores

File diff suppressed because one or more lines are too long

View File

@@ -62,12 +62,16 @@ VAR
// Pressure sensors posolyt
_fbPressurePosolytSegmentInlet : FB_AnalogInput('P1_P');
_fbPressurePosolytTankInlet : FB_AnalogInput('P3_P');
_fbPressurePosolytTankOutlet : FB_AnalogInput('P4_P');
// Pressure sensors negolyt
_fbPressureNegolytSegmentInlet : FB_AnalogInput('P1_N');
_fbPressureNegolytTankInlet : FB_AnalogInput('P3_N');
_fbPressureNegolytTankOutlet : FB_AnalogInput('P4_N');
// Temperature sensor posolyt
_fbTempSensorPosolyt : FB_AnalogInput('T1_P');
// Temperature sensor negolyt
_fbTempSensorNegolyt : FB_AnalogInput('T1_N');
// Unit voltage
_fbVoltageSegment : FB_AnalogInput('Voltage');

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<DUT Name="ST_MODULE_ERROR" Id="{f48f024b-dcdb-4f15-9afc-badf412ed600}">
<Declaration><![CDATA[TYPE ST_MODULE_ERROR :
STRUCT
// Unit error array
astUnitErrors : ARRAY[0..3] OF ST_UNIT_ERROR;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<DUT Name="ST_STRING_ERROR" Id="{269f429d-5923-4dac-b08e-323d4429d2dd}">
<Declaration><![CDATA[TYPE ST_STRING_ERROR :
STRUCT
// Module error array
stModuleError : ARRAY[0..2] OF ST_MODULE_ERROR;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<DUT Name="ST_UNIT_ERROR" Id="{b3532ce3-68c1-42ff-89b7-ea0ef92c8a32}">
<Declaration><![CDATA[TYPE ST_UNIT_ERROR :
STRUCT
// Error high posolyt
xErrorHighPressurePosolytSegmentInlet : BOOL := FALSE;
xErrorHighPressurePosolytTankInlet : BOOL := FALSE;
xErrorHighTempPosolyt : BOOL := FALSE;
// Error high negolyt
xErrorHighPressureNegolytSegmentInlet : BOOL := FALSE;
xErrorHighPressureNegolytTankInlet : BOOL := FALSE;
xErrorHighTempNegolyt : BOOL := FALSE;
// Error low posolyt
xErrorLowPressurePosolytSegmentInlet : BOOL := FALSE;
xErrorLowPressurePosolytTankInlet : BOOL := FALSE;
xErrorLowTempPosolyt : BOOL := FALSE;
// Error low negolyt
xErrorLowPressureNegolytSegmentInlet : BOOL := FALSE;
xErrorLowPressureNegolytTankInlet : BOOL := FALSE;
xErrorLowTempNegolyt : BOOL := FALSE;
// Error valve posolyt
xErrorOpenValvePosolyt : BOOL := FALSE;
xErrorCloseValvePosolyt : BOOL := FALSE;
// Error valve negolyt
xErrorOpenValveNegolyt : BOOL := FALSE;
xErrorCloseValveNegolyt : BOOL := FALSE;
// Error voltage segment
xErrorHighVoltageSegment : BOOL := FALSE;
xErrorLowVoltageSegment : BOOL := FALSE;
// MCB ok pump posolyt
xMCBOkPumpPosolyt AT %Q* : BOOL := TRUE;
// Repair switch ok pump posolyt
xRepairSwitchOkPumpPosolyt AT %Q* : BOOL := TRUE;
// MCB ok pump negolyt
xMCBOkPumpNegolyt AT %Q* : BOOL := TRUE;
// Repair switch ok pump negolyt
xRepairSwitchOkPumpNegolyt AT %Q* : BOOL := TRUE;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<GVL Name="GVL_CONFIG" Id="{67a902f8-b820-49bc-8915-3c28de9d0ca8}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL
stPressureSensorConfig : ST_ANALOG_IO_CONFIG := (iAIMax := 32767, iAIMin := 0, rPVMax := 1500, rPVMin := -1000, sUnit := 'mbar');
stTempSensorConfig : ST_ANALOG_IO_CONFIG := (iAIMax := 32767, iAIMin := -32768, rPVMax := 3276.7, rPVMin := -3276.8, sUnit := '°C');
stVoltageSensorconfig : ST_ANALOG_IO_CONFIG := (iAIMax := 32767, iAIMin := 0, rPVMax := 150, rPVMin := 0, sUnit := 'V');
END_VAR]]></Declaration>
</GVL>
</TcPlcObject>

View File

@@ -5,6 +5,12 @@
VAR_GLOBAL
// Random number generator
fbRandom : DRAND;
// Emergency stop ok
xEmergencyStopOk AT %Q* : BOOL := TRUE;
// String error array
astStringError : ST_STRING_ERROR;
END_VAR]]></Declaration>
</GVL>
</TcPlcObject>

View File

@@ -18,6 +18,19 @@
<LibraryReferences>{2e35f69f-cdc6-406f-ab1c-2ecda0902edb}</LibraryReferences>
</PropertyGroup>
<ItemGroup>
<Compile Include="DUTs\ST_MODULE_ERROR.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="DUTs\ST_STRING_ERROR.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="DUTs\ST_UNIT_ERROR.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="GVLs\GVL_CONFIG.TcGVL">
<SubType>Code</SubType>
<LinkAlways>true</LinkAlways>
</Compile>
<Compile Include="GVLs\GVL_GLOBAL.TcGVL">
<SubType>Code</SubType>
<LinkAlways>true</LinkAlways>
@@ -28,6 +41,12 @@
<Compile Include="POUs\Analog_Sensor_Mockup\FB_AnalogSensorMockup.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\FB_ModuleMockup.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\FB_StringMockup.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\FB_UnitMockup.TcPOU">
<SubType>Code</SubType>
</Compile>
@@ -54,6 +73,9 @@
<Folder Include="POUs" />
</ItemGroup>
<ItemGroup>
<PlaceholderReference Include="BaseLib">
<DefaultResolution>BaseLib, * (cmblu)</DefaultResolution>
</PlaceholderReference>
<PlaceholderReference Include="Tc2_Standard">
<DefaultResolution>Tc2_Standard, * (Beckhoff Automation GmbH)</DefaultResolution>
<Namespace>Tc2_Standard</Namespace>

File diff suppressed because one or more lines are too long

View File

@@ -6,20 +6,29 @@ VAR_INPUT
// Raise sensor level from min to max
xEnable : BOOL;
// Switch to error high
xErrorHigh : BOOL := FALSE;
// Switch to error low
xErrorLow : BOOL := FALSE;
// Sensor value when enabled
rOnValue : REAL;
// Sensor value when dissabled
rOffValue : REAL;
// Sensor value error high
rErrorLowValue : REAL;
// Sensor value error high
rErrorHighValue : REAL;
// Sensor noise value
rNoise : REAL := 0.0;
// Sensor min value for analog scaling
rMinValue : REAL := 0.0;
// Sensor max value for analog scaling
rMaxValue : REAL := 1.0;
// Analog output scaling
stAnalogScaling : ST_ANALOG_IO_CONFIG;
END_VAR
VAR_OUTPUT
iAnalogValue AT %Q* : INT;
@@ -42,18 +51,25 @@ VAR
_rPrevValue : REAL := 0.0;
// Analog output
_fbValveAnalogOutput : FB_AnalogOutput('');
// Analog output scaling
_stAnalogScaling : ST_ANALOG_IO_CONFIG;
_stAnalogEWConfig : ST_ANALOG_EW_LEVELS;
_stAnalogEWDelays : ST_ANALOG_EW_DELAYS;
{attribute 'hide'}
_fbAnalogOutput : FB_AnalogOutput('');
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Pressure only if enabled
IF xEnable THEN
// Normal enable value
_rTargetValue := rOnValue;
// Switch to error high value
IF xErrorHigh AND (NOT xErrorLow) THEN
_rTargetValue := rErrorHighValue;
END_IF
// Switch to error low value
IF xErrorLow AND (NOT xErrorHigh) THEN
_rTargetValue := rErrorHighValue;
END_IF
ELSE
_rTargetValue := rOffValue;
END_IF
@@ -70,16 +86,11 @@ IF xEnable THEN
_rValue := _rValue + (LREAL_TO_REAL(_lrTmp - 0.5) * rNoise);
END_IF
// Set analog output scaling
_stAnalogScaling.iAIMax := 32767;
_stAnalogScaling.iAIMin := 0;
_stAnalogScaling.rPVMax := rMaxValue;
_stAnalogScaling.rPVMin := rMinValue;
// Calculate analog output from ramp generator setpoint
_fbValveAnalogOutput(
_fbAnalogOutput(
rSetpoint:= _rValue,
stScalingConfig:= _stAnalogScaling,
stScalingConfig:= stAnalogScaling,
xReleaseErrors:= FALSE,
xReleaseHardwareErrors:= FALSE,
xConfirmAlarms:= ,
@@ -87,11 +98,7 @@ _fbValveAnalogOutput(
xError=> );]]></ST>
</Implementation>
<LineIds Name="FB_AnalogSensorMockup">
<LineId Id="719" Count="14" />
<LineId Id="798" Count="0" />
<LineId Id="734" Count="0" />
<LineId Id="799" Count="0" />
<LineId Id="735" Count="14" />
<LineId Id="1084" Count="38" />
<LineId Id="9" Count="0" />
</LineIds>
</POU>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="FB_ModuleMockup" Id="{7849a7a0-5044-422d-86cf-733e0cdbe96b}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_ModuleMockup
VAR_INPUT
stModuleError : REFERENCE TO ST_MODULE_ERROR;
END_VAR
VAR_OUTPUT
END_VAR
VAR
// Unit array
afbUnits : ARRAY[0..3] OF FB_UnitMockup;
i : INT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[FOR i := 0 TO 3 DO
afbUnits[i](stUnitError:= stModuleError.astUnitErrors[i]);
END_FOR]]></ST>
</Implementation>
<LineIds Name="FB_ModuleMockup">
<LineId Id="9" Count="0" />
<LineId Id="14" Count="1" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="FB_StringMockup" Id="{f680b9a5-3af1-4e93-b52d-21296306c101}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_StringMockup
VAR_INPUT
stStringError : REFERENCE TO ST_STRING_ERROR;
END_VAR
VAR_OUTPUT
END_VAR
VAR
afbModules : ARRAY[0..2] OF FB_ModuleMockup;
i : INT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[FOR i := 0 TO 2 DO
afbModules[i](stModuleError:= stStringError.stModuleError[i]);
END_FOR]]></ST>
</Implementation>
<LineIds Name="FB_StringMockup">
<LineId Id="9" Count="0" />
<LineId Id="15" Count="1" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -3,6 +3,7 @@
<POU Name="FB_UnitMockup" Id="{a1155b26-00e6-4710-a8e4-140d6d5cd082}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_UnitMockup
VAR_INPUT
stUnitError : REFERENCE TO ST_UNIT_ERROR;
END_VAR
VAR_OUTPUT
END_VAR
@@ -19,16 +20,21 @@ VAR
// Pumps negolyt
_fbNegolytPumpInlet : FB_MotorMockup;
// Pressure sensors posolyt
_fbPressurePosolytSegmentInlet : FB_AnalogSensorMockup;
_fbPressurePosolytTankInlet : FB_AnalogSensorMockup;
// Pressure sensors negolyt
_fbPressureNegolytSegmentInlet : FB_AnalogSensorMockup;
_fbPressureNegolytTankInlet : FB_AnalogSensorMockup;
// Temperature sensors
_fbTemperatureSensorPosolyt : FB_AnalogSensorMockup;
_fbTemperatureSensorNegolyt : FB_AnalogSensorMockup;
// Segment Voltage
_fbVoltageSegment : FB_AnalogSensorMockup;
// Helping variables
_xFlowThroughtSegmentPosolyt : BOOL;
_xFlowThroughtBypassPosolyt : BOOL;
@@ -38,74 +44,214 @@ VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// Valves posolyt
<ST><![CDATA[// ===============================
// Valves posolyt
// ===============================
_fbPosolytValveTankOutlet();
// ===============================
// Valves negolyt
// ===============================
_fbNegolytValveTankOutlet();
// ===============================
// Pumps posolyt
// ===============================
_fbPosolytPumpInlet();
// ===============================
// Pumps negolyt
// ===============================
_fbNegolytPumpInlet();
// ===============================
// Simulate flow posolyt
// ===============================
_xFlowThroughtSegmentPosolyt := _fbPosolytPumpInlet.xEnable AND _fbPosolytValveTankOutlet.xOpenFeedback;
_xFlowThroughtBypassPosolyt := _fbPosolytPumpInlet.xEnable AND NOT _fbPosolytValveTankOutlet.xOpenFeedback;
_xFlowThroughtSegmentNegolyt := _fbNegolytPumpInlet.xEnable AND _fbNegolytValveTankOutlet.xOpenFeedback;
_xFlowThroughtBypassNegolyt := _fbNegolytPumpInlet.xEnable AND NOT _fbNegolytValveTankOutlet.xOpenFeedback ;
// ===============================
// Pressure sensors posolyt
// ===============================
_fbPressurePosolytSegmentInlet(
xEnable:= _xFlowThroughtSegmentPosolyt,
rOnValue:= 0.487,
rOffValue:= 0.0,
rNoise:= 0.002,
rMinValue:= -1.0,
rMaxValue:= 1.5);
xEnable:= _xFlowThroughtSegmentPosolyt,
xErrorHigh := stUnitError.xErrorHighPressurePosolytSegmentInlet,
xErrorLow := stUnitError.xErrorLowPressurePosolytSegmentInlet,
stAnalogScaling := GVL_CONFIG.stPressureSensorConfig,
rOnValue:= 487,
rOffValue:= 0.0,
rErrorHighValue := 750,
rErrorLowValue := 0.0,
rNoise:= 0.002);
_fbPressurePosolytTankInlet(
xEnable:= _xFlowThroughtSegmentPosolyt,
rOnValue:= 0.0429,
rOffValue:= 0.0,
rNoise:= 0.002,
rMinValue:= -1.0,
rMaxValue:= 1.5);
xEnable:= _xFlowThroughtSegmentPosolyt,
xErrorHigh := stUnitError.xErrorHighPressurePosolytTankInlet,
xErrorLow := stUnitError.xErrorLowPressurePosolytTankInlet,
stAnalogScaling := GVL_CONFIG.stPressureSensorConfig,
rOnValue:= 42.9,
rOffValue:= 0.0,
rErrorHighValue := 150,
rErrorLowValue := 0.0,
rNoise:= 0.002);
// ===============================
// Pressure sensors negolyt
// ===============================
_fbPressureNegolytSegmentInlet(
xEnable:= _xFlowThroughtSegmentNegolyt,
rOnValue:= 0.487,
rOffValue:= 0.0,
rNoise:= 0.002,
rMinValue:= -1.0,
rMaxValue:= 1.5);
xEnable:= _xFlowThroughtSegmentNegolyt,
xErrorHigh := stUnitError.xErrorHighPressureNegolytSegmentInlet,
xErrorLow := stUnitError.xErrorLowPressureNegolytSegmentInlet,
stAnalogScaling := GVL_CONFIG.stPressureSensorConfig,
rOnValue:= 487,
rOffValue:= 0.0,
rErrorHighValue := 750,
rErrorLowValue := 0.0,
rNoise:= 0.002);
_fbPressureNegolytTankInlet(
xEnable:= _xFlowThroughtSegmentNegolyt,
rOnValue:= 0.0429,
xEnable:= _xFlowThroughtSegmentNegolyt,
xErrorHigh := stUnitError.xErrorHighPressureNegolytTankInlet,
xErrorLow := stUnitError.xErrorLowPressureNegolytTankInlet,
stAnalogScaling := GVL_CONFIG.stPressureSensorConfig,
rOnValue:= 42.9,
rOffValue:= 0.0,
rErrorHighValue := 150,
rErrorLowValue := 0.0,
rNoise:= 0.002);
// ===============================
// Temperatur sensors
// ===============================
_fbTemperatureSensorPosolyt(
xEnable:= _xFlowThroughtSegmentPosolyt,
xErrorHigh := stUnitError.xErrorHighTempPosolyt,
xErrorLow := stUnitError.xErrorLowTempPosolyt,
stAnalogScaling := GVL_CONFIG.stTempSensorConfig,
rOnValue:= 40.0,
rOffValue:= 21.0,
rErrorHighValue := 60.0,
rErrorLowValue := -10.0);
_fbTemperatureSensorNegolyt(
xEnable:= _xFlowThroughtSegmentNegolyt,
xErrorHigh := stUnitError.xErrorHighTempNegolyt,
xErrorLow := stUnitError.xErrorLowTempNegolyt,
stAnalogScaling := GVL_CONFIG.stTempSensorConfig,
rOnValue:= 40.0,
rOffValue:= 21.0,
rErrorHighValue := 60.0,
rErrorLowValue := -10.0);
// ===============================
// Voltage sensor
// ===============================
_fbVoltageSegment(
xEnable:= _xFlowThroughtSegmentPosolyt AND _xFlowThroughtSegmentNegolyt,
xErrorHigh:= stUnitError.xErrorHighVoltageSegment,
xErrorLow:= stUnitError.xErrorLowVoltageSegment,
rOnValue:= 64.3,
rOffValue:= 0.0,
rNoise:= 0.002,
rMinValue:= -1.0,
rMaxValue:= 1.5);
]]></ST>
rErrorLowValue:= 35.0,
rErrorHighValue:= 80.0,
rNoise:= 0.05,
stAnalogScaling:= GVL_CONFIG.stVoltageSensorconfig);]]></ST>
</Implementation>
<LineIds Name="FB_UnitMockup">
<LineId Id="482" Count="1" />
<LineId Id="486" Count="2" />
<LineId Id="491" Count="2" />
<LineId Id="495" Count="2" />
<LineId Id="499" Count="2" />
<LineId Id="812" Count="0" />
<LineId Id="482" Count="0" />
<LineId Id="813" Count="0" />
<LineId Id="483" Count="0" />
<LineId Id="822" Count="0" />
<LineId Id="814" Count="0" />
<LineId Id="486" Count="1" />
<LineId Id="815" Count="0" />
<LineId Id="488" Count="0" />
<LineId Id="823" Count="0" />
<LineId Id="816" Count="0" />
<LineId Id="491" Count="1" />
<LineId Id="817" Count="0" />
<LineId Id="493" Count="0" />
<LineId Id="824" Count="0" />
<LineId Id="818" Count="0" />
<LineId Id="495" Count="1" />
<LineId Id="819" Count="0" />
<LineId Id="497" Count="0" />
<LineId Id="825" Count="0" />
<LineId Id="820" Count="0" />
<LineId Id="499" Count="1" />
<LineId Id="821" Count="0" />
<LineId Id="501" Count="0" />
<LineId Id="695" Count="3" />
<LineId Id="502" Count="8" />
<LineId Id="519" Count="7" />
<LineId Id="568" Count="3" />
<LineId Id="699" Count="3" />
<LineId Id="826" Count="0" />
<LineId Id="810" Count="0" />
<LineId Id="502" Count="1" />
<LineId Id="811" Count="0" />
<LineId Id="504" Count="1" />
<LineId Id="804" Count="1" />
<LineId Id="788" Count="0" />
<LineId Id="506" Count="1" />
<LineId Id="864" Count="0" />
<LineId Id="882" Count="0" />
<LineId Id="510" Count="0" />
<LineId Id="519" Count="2" />
<LineId Id="806" Count="1" />
<LineId Id="789" Count="0" />
<LineId Id="522" Count="1" />
<LineId Id="866" Count="0" />
<LineId Id="881" Count="0" />
<LineId Id="524" Count="0" />
<LineId Id="899" Count="0" />
<LineId Id="809" Count="0" />
<LineId Id="568" Count="1" />
<LineId Id="808" Count="0" />
<LineId Id="570" Count="1" />
<LineId Id="830" Count="1" />
<LineId Id="790" Count="0" />
<LineId Id="699" Count="1" />
<LineId Id="868" Count="0" />
<LineId Id="880" Count="0" />
<LineId Id="576" Count="0" />
<LineId Id="585" Count="7" />
<LineId Id="600" Count="0" />
<LineId Id="585" Count="2" />
<LineId Id="845" Count="1" />
<LineId Id="791" Count="0" />
<LineId Id="588" Count="1" />
<LineId Id="879" Count="0" />
<LineId Id="870" Count="0" />
<LineId Id="592" Count="0" />
<LineId Id="829" Count="0" />
<LineId Id="827" Count="0" />
<LineId Id="769" Count="1" />
<LineId Id="828" Count="0" />
<LineId Id="856" Count="2" />
<LineId Id="863" Count="0" />
<LineId Id="860" Count="1" />
<LineId Id="855" Count="0" />
<LineId Id="874" Count="0" />
<LineId Id="878" Count="0" />
<LineId Id="862" Count="0" />
<LineId Id="772" Count="1" />
<LineId Id="851" Count="1" />
<LineId Id="792" Count="0" />
<LineId Id="774" Count="1" />
<LineId Id="877" Count="0" />
<LineId Id="875" Count="0" />
<LineId Id="779" Count="0" />
<LineId Id="898" Count="0" />
<LineId Id="896" Count="1" />
<LineId Id="784" Count="0" />
<LineId Id="886" Count="9" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -1,13 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="MAIN" Id="{bb83bde3-1093-40be-b27d-d7bc60ebb5a6}">
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="MAIN" Id="{bb83bde3-1093-40be-b27d-d7bc60ebb5a6}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM MAIN
VAR
// String mockup
fbString : FB_StringMockup;
END_VAR
]]>
</Declaration>
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
<ST><![CDATA[// Call string mockup
fbString(stStringError:= GVL_GLOBAL.astStringError);]]></ST>
</Implementation>
<LineIds Name="MAIN">
<LineId Id="7" Count="0" />
<LineId Id="2" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -7,13 +7,15 @@ VAR_INPUT
xEnable AT%I* : BOOL;
// Motor setpoint
iSetpoint AT%I* : INT;
iSetpoint AT %I* : INT;
END_VAR
VAR_OUTPUT
// Motor circuit breaker ok
{attribute 'hide'}
xMCBOk AT %Q* : BOOL;
// Repair switch ok
{attribute 'hide'}
xRepairSwitchOk AT %Q* : BOOL;
// Motor speed feedback
@@ -24,11 +26,14 @@ VAR
_fbRampGenerator : FB_RampGenerator;
{attribute 'hide'}
_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;
{attribute 'hide'}
_fbValveAnalogOutput : FB_AnalogOutput('');
END_VAR
]]></Declaration>

View File

@@ -5,6 +5,9 @@
VAR_INPUT
xOpenValve AT %I* : BOOL;
xCloseValve AT %I* : BOOL;
xErrorOpen : BOOL := FALSE;
xErrorClose : BOOL := FALSE;
END_VAR
VAR_OUTPUT
xOpenFeedback AT %Q* : BOOL;
@@ -21,8 +24,8 @@ _tonOpen(IN := xOpenValve);
_tonClose(IN := xCloseValve);
// Open and close feedback
xOpenFeedback := _tonOpen.Q;
xCloseFeedback := _tonClose.Q;]]></ST>
xOpenFeedback := _tonOpen.Q AND (NOT xErrorOpen);
xCloseFeedback := _tonClose.Q AND (NOT xErrorClose);]]></ST>
</Implementation>
<LineIds Name="FB_ValveMockup">
<LineId Id="54" Count="5" />

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,9 +0,0 @@
<?xml version="1.0"?>
<TcTargetDesc>
<TargetVersion>
<Version>3</Version>
<Revision>1</Revision>
<Build>4024</Build>
<Subbuild>53</Subbuild>
</TargetVersion>
</TcTargetDesc>

File diff suppressed because one or more lines are too long

View File

@@ -1,103 +0,0 @@
<?xml version="1.0"?>
<TcEventSources Version="2">
<Source>
<GUID>{E80DD7BA-FA01-494C-9EFA-D70175C5A769}</GUID>
<Name LcId="1033">NewEventClass_DisplayText</Name>
<Event>
<Id>1</Id>
<Message LcId="1033">Valve {0} did not open</Message>
</Event>
<Event>
<Id>2</Id>
<Message LcId="1033">Valve {0} did not close</Message>
</Event>
<Event>
<Id>3</Id>
<Message LcId="1033">Valve {0} feedback open circuit</Message>
</Event>
<Event>
<Id>4</Id>
<Message LcId="1033">Valve {0} setpoint open circuit</Message>
</Event>
<Event>
<Id>5</Id>
<Message LcId="1033">Valve {0} not in range</Message>
</Event>
</Source>
<Source>
<GUID>{0B767148-8FC5-4340-B6EB-6151E49FC9FF}</GUID>
<Name LcId="1033">EventClass2_DisplayText</Name>
<Event>
<Id>1</Id>
<Message LcId="1033">{0} input open circuit</Message>
</Event>
<Event>
<Id>2</Id>
<Message LcId="1033">Analog Input {0} card error</Message>
</Event>
<Event>
<Id>3</Id>
<Message LcId="1033">Analog Input {0} short circuit</Message>
</Event>
<Event>
<Id>4</Id>
<Message LcId="1033">Analog Input {0} configuration error</Message>
</Event>
<Event>
<Id>5</Id>
<Message LcId="1033">Analog Input {0}: Input Value below error limit ({1})</Message>
</Event>
<Event>
<Id>6</Id>
<Message LcId="1033">Analog Input {0}: Input Value below warning limit ({1})</Message>
</Event>
<Event>
<Id>7</Id>
<Message LcId="1033">Analog Input {0}: Input Value above warning limit ({1})</Message>
</Event>
<Event>
<Id>8</Id>
<Message LcId="1033">Analog Input {0}: Input Value above error limit ({1})</Message>
</Event>
</Source>
<Source>
<GUID>{8BFB4FDD-3EEC-40D7-987E-004CDA8B9B54}</GUID>
<Name LcId="1033">EventClass3_DisplayText</Name>
<Event>
<Id>1</Id>
<Message LcId="1033">Analog output {0} config error</Message>
</Event>
</Source>
<Source>
<GUID>{BF1D9A4D-48E1-4CE9-9A52-161E93CC0C6D}</GUID>
<Name LcId="1033">Motor events</Name>
<Event>
<Id>1</Id>
<Message LcId="1033">Motor {0} MCB tripped</Message>
</Event>
<Event>
<Id>2</Id>
<Message LcId="1033">Motor {0} repair switch open</Message>
</Event>
<Event>
<Id>3</Id>
<Message LcId="1033">Motor {0} not in target</Message>
</Event>
</Source>
<Source>
<GUID>{C1141D67-F77A-4C56-9A6D-82359097C6E6}</GUID>
<Name LcId="1033">Safety door errors</Name>
<Event>
<Id>1</Id>
<Message LcId="1033">Safety Door {0} not ok</Message>
</Event>
</Source>
<Source>
<GUID>{449AFAF7-1CB8-43A8-977D-36C33E7AFF6C}</GUID>
<Name LcId="1033">General alarms and infos</Name>
<Event>
<Id>1</Id>
<Message LcId="1033">Unit {0} not all components in automatic mode</Message>
</Event>
</Source>
</TcEventSources>

View File

@@ -1 +0,0 @@
ө<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD>FU<EFBFBD>Qr<EFBFBD>;<3B>u

View File

@@ -1 +0,0 @@
<EFBFBD><01><>\<5C><>أ<EFBFBD><D8A3><EFBFBD>K9<07>