Live readings¶
Every gauge on the screen is also published as an attribute on the CAT_Gen model, refreshed five times a second. This is the cheapest way for another script to read the set, with no values to wire up:
local gen = workspace.CAT_Gen
print(gen:GetAttribute("State"), gen:GetAttribute("RPM"), "rpm")
gen:GetAttributeChangedSignal("Breaker"):Connect(function()
print("Breaker closed:", gen:GetAttribute("Breaker"))
end)
Attributes¶
| Attribute | Unit / values |
|---|---|
State |
OFF, CRANK, RUNNING, FAULT… |
Mode |
STOP, AUTO, RUN |
RPM |
rpm |
Hz |
hertz |
Volts |
volts |
Amps |
amps |
KW |
kilowatts |
LoadPct |
percent of rating |
OilPSI |
psi |
CoolantC |
°C |
BatteryV |
volts |
FuelPct |
percent |
EngineHours |
hours |
Breaker |
true when on line |
Fault |
text, empty when healthy |
The two that matter most¶
State
The most useful attribute if you are scripting against the set. It tells you exactly where in the sequence it is, which the individual BoolValues cannot.
Breaker
What the ATS watches. It is true only when the set has decided it is ready to carry load, which is later than "running".
Engine hours
Engine hours accumulate while the set turns and survive a Studio save. They do not survive a live server restart: that needs a DataStore, which is not included.