This block is inserted in series in an electrical circuit to measure the current passing through the coponent. The measure is given to the explicit part of the model via an explicit pout. Conventionally, current flowing into the black port is consiered positive. The ohmic resistance of this block is zero.
class CurrentSensor Pin p; Pin n; Real i; equation p.v = n.v; p.i = i; n.i = -i; end CurrentSensor;