Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powermeter fast-fault edits #78

Merged
merged 4 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ VAR
fbPulseWattageBuffer: FB_LREALBuffer;
fbCalibMJBuffer: FB_LREALBuffer;

FFO: FB_FastFault :=(
FF: FB_FastFault :=(
i_Desc := 'Fault occurs when the per-pulse energy reading is high enough to damage the power meter',
i_TypeCode := 16#500);
bOverAllowableEnergy: BOOL;
uOverCounter: UINT := 1;
END_VAR
VAR_STAT CONSTANT
// Voltage limits for wavelength ranges
Expand Down Expand Up @@ -287,7 +288,7 @@ END_IF
fPulseWattage := SEL(fResponsivity <> 0, 0, (fVoltage - fBackgroundVoltage) / fResponsivity);
fCalibMJ := SEL(fFrequency <> 0, -9999, fPulseWattage / fFrequency);

// FF in case voltage is high enough to damage power meter based on wavelength
// FF in case voltage is high enough to damage power meter based on wavelengths
{IF defined (K)}
CASE REAL_TO_UINT(PMPS_GVL.stCurrentBeamParameters.neV) OF
0 .. uSoftWavelengthEdge1L: bOverAllowableEnergy := fCalibMJ > 2;
Expand All @@ -303,7 +304,12 @@ fCalibMJ := SEL(fFrequency <> 0, -9999, fPulseWattage / fFrequency);
uHardWavelengthEdge3 .. 65535: bOverAllowableEnergy := fCalibMJ > 10;
END_CASE
{END_IF}
FFO(i_xOK := NOT bOverAllowableEnergy,
IF eEnumGet = E_PPM_States.POWERMETER AND bOverAllowableEnergy THEN
uOverCounter := MIN(uOverCounter + 1, 10);
ELSE
uOverCounter := 0;
END_IF
FF(i_xOK := eEnumGet <> E_PPM_States.POWERMETER OR uOverCounter < 10,
i_DevName := sDeviceName,
io_fbFFHWO := fbFFHWO);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<TcSmProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmProject" TcSmVersion="1.0" TcVersion="3.1.4024.35" TcVersionFixed="true">
<Project ProjectGUID="{AB70FBBB-83F0-4609-9FD5-DF42CB839A31}" TargetNetId="172.21.140.70.1.1" Target64Bit="true" ShowHideConfigurations="#x3c6">
<Project ProjectGUID="{AB70FBBB-83F0-4609-9FD5-DF42CB839A31}" Target64Bit="true" ShowHideConfigurations="#x3c6">
<System>
<Tasks>
<Task Id="5" Priority="20" CycleTime="100000" AmsPort="350" AdtTasks="true">
Expand Down