-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTurboEncabulator.scl
67 lines (55 loc) · 2.52 KB
/
TurboEncabulator.scl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(*
Author: Neil Turley
Created: Yesterday
Last Modified: Today
Copyright Copia Automation 2024
KFC Software License
Permission is hereby granted, free of charge, to any person or persons
obtaining a copy of this software and associated documentation files
(the "Software"), to deal and/or wheel in the Software without restriction
THIS SOFTWARE IS PROVIDED "AS-IS", "AS-WAS", and "HAS-BEEN",
WITHOUT WARRANTY OF ANY KIND, REAL OR IMAGINARY, EXPRESS OR IMPLIED,
OR EVEN SUBTLY HINTED AT IN OBSCURE METAPHORS, SIMILES, OR ACROSTIC POEMS,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, DISTINCTLY UNFIT FOR ANY PARTICULAR PURPOSE
DUE TO LACK OF HEALTHY DIET AND EXERCISE, AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES, LIABILITY, HOUSEHOLD CHORES, OR OTHERWISE WHETHER
IN AN ACTION OF CONTRACT, TORT, ROASTBEEF WITH A SIDE OF FRIES AND
A DIET COKE, IF AVAILABLE OTHERWISE PEPSI IS FINE, ARISING FROM,
OUT OF, OR IN CONNECTION WITH, OR EVEN VAGUELY IN THE VICINITY OF THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
*)
PROGRAM TurboEncabulator
VAR_INPUT
EncabulatorEnergized : BOOL;
MegnetoReluctance, SinusoidalRepleneration : DINT;
END_VAR
VAR
ReplenerationInRange, SideFumblingDetected : BOOL;
END_VAR
VAR CONSTANT
// range of nominal sinusoidal repleneration
MIN_REPLENERATION : DINT := 1;
MAX_REPLENERATION : DINT := 5;
// the megneto reluctance must not go above this value
MAX_RELUCTANCE : DINT := 10;
// the flux power at which side fumbling can occur
FUMBLE_FLUX_POWER : DINT := 4;
END_VAR
VAR_OUTPUT
// the flux power generated by the relative motion of conductors and fluxes
FluxPower : DINT;
// THIS SHOULD NEVER BE TRUE
HeadChopper : BOOL;
END_VAR
// Check if the sinusoidal repleneration is in range
ReplenerationInRange := SinusoidalRepleneration < MAX_REPLENERATION AND SinusoidalRepleneration > MIN_REPLENERATION;
// calculate power generated by the relative motion of conductors and fluxes
// not sure if this is right, got it from stack overflow
FluxPower := MegnetoReluctance + SinusoidalRepleneration;
// According to ChatGPT, the ambifacient lunar waneshaft is supposed to prevent side fumbling but only while energized
SideFumblingDetected := FluxPower = FUMBLE_FLUX_POWER AND NOT EncabulatorEnergized;
// TODO: VERY IMPORTANT! Make sure the head chopper never activates!!
HeadChopper := ReplenerationInRange AND SideFumblingDetected AND (MegnetoReluctance > MAX_RELUCTANCE);
END_PROGRAM