Skip to main content

Module iec104

Module iec104 

Source
Expand description

IEC 60870-5-104 active-power set points as limits and back, behind the iec104 feature.

A grid operator’s control centre caps a plant or a site over IEC 104 with a set-point command: type 48 (normalized), 49 (scaled) or 50 (short float). The command carries a number; what it means is in the operator’s point list (which information object, which unit, what 100 % is). That is a Point, the integrator’s configuration, and every conversion takes one.

  • Normalized values are fractions of a full-scale power in steps of 2⁻¹⁵: 30 % of 10 MW is not a whole watt, so the reading names a Rounding. Rounding::TowardZero never exceeds the exact value: for a cap, the stricter side.
  • Scaled values are whole counts of a step (1 kW, 0.1 MW): exact.
  • Short floats are read through their shortest decimal, the number the operator typed: 4.2 (kW) is 4 200 W exactly. Writing one, a cap that needs more digits than an f32 keeps is refused rather than sent rounded.
  • The command has no duration: a set point holds until the next one, so the window is the caller’s. A select of select-before-operate sets nothing and is refused.
use flexibility::iec104::{self, wire, Direction, Point, Scale};
use flexibility::{Provenance, Rounding, Window, kw};
use wire::types::{Normalized, SetpointNormalized, SetpointScaled};
let scc = Provenance::new("tso.example", "IOA 4711", now);
// A wind park, 10 MW installed: feed in at most 50 % of it.
let park = Point { direction: Direction::FeedIn, scale: Scale::Normalized { full_scale: kw!(10_000) } };
let cap = iec104::limit(SetpointNormalized::new(Normalized(16_384)), park, window, Rounding::Exact, scc.clone())?;
assert_eq!(cap.bounds().min(), Some(kw!(-5_000)));

// A site cap in whole kilowatts: 250 counts of 1 kW.
let site = Point { direction: Direction::Consumption, scale: Scale::Scaled { step: kw!(1) } };
let cap = iec104::limit(SetpointScaled::new(250), site, window, Rounding::Exact, scc)?;
assert_eq!(cap.bounds().max(), Some(kw!(250)));

Re-exports§

pub use ::iec60870 as wire;

Structs§

Point
One information object’s meaning: which way it caps and how its number reads.

Enums§

Direction
Which way a set point caps.
Scale
What a set point’s number is, from the operator’s point list.
Setpoint
A set-point command of type 48, 49 or 50.

Functions§

limit
The cap a set point sets at point, over window (until the next set point): a consumption cap or a feed-in cap of the value read as the point list says, rounded as named.
setpoint
The execute set point that carries a cap of cap (a magnitude) at point, rounded as named. Rounding::TowardZero sends a value that never exceeds the cap; a normalized 100 % (not representable, the largest value is 1 − 2⁻¹⁵) becomes the largest value under it.