There are several sensors included in the different Modelica standard libraries. As an example Modelica.Electrical.Analog.Sensors has a current, voltage, potential, and power sensor. In the case that you want to measure something for which you do not have an available sensor I recommend using the available sensors as "templates" for developing your own sensors.
The potential sensor is an example of calculating something from two different metering points, so for the case you mention you can do similarly.
In some cases you might not want to connect to the metering points, but just calculate the value as a function, then you can do this too of course. An example is to do something like this:
model mySystem
model subSystem
Real v1;
equation
.
.
.
end subSystem;
subSystem sub1, sub2;
Real meter;
equation
meter = sub1.v1 - sub2.v1;
.
.
.
end mySystem;
In this example I have chosen to define the class for my subSystem within mySystem, but of course this would also work for classes that are defined in other places (like the Modelica Standard Library).