Power monitoring 240VAC devices
off-the-shelf devices

Many off-the-shelf power monitoring devices do most of what you want to do.
I wouldn't be surprised if several companies sell industrial versions on DIN rail mounts -- please tell us if you find any.
If you can't find any, perhaps you could use commercial versions:


http://openenergymonitor.org/emon/ (thank you, TiOLUWA)
http://www.opto22.com/lp/optoemu.aspx
http://www.killawattplus.com
http://themodlet.com/
http://en.wikipedia.org/wiki/Kill_A_Watt
http://en.wikipedia.org/wiki/Home_energy_monitor
http://en.wikipedia.org/wiki/Wattmeter#Electronic_wattmeter
http://en.wikipedia.org/wiki/Automatic_Meter_Reading


They use a variety of current sense techniques and communication protocols.

unnecessarily cranky response to other "answers":

A typical power monitoring device measures the instantaneous current and voltage many times per second.
From those numbers, it calculates the instantaneous real power, and from the instantaneous real power it can calculate the average real power RealP over one or more full power cycles.

Also from that data the device can calculate the power factor Pf over one or more full power cycles with

Pf := RealP / (Vrms * Irms) -- by definition


Some textbooks imply that the power factor is the cosine of something, perhaps something related to zero-crossings. That's doing it wrong. It may happen to give the currect result for perfectly linear loads with ideal sine-wave power, but not for nonlinear loads, or linear loads with our less-than-ideal not-exactly-sine-wave power. Instead, good power monitoring devices use the above equation, which gives the correct power factor even with nonlinear loads or non-sine-wave power or both.

Some textbooks imply that one can calculate the real power by multiplying the power factor times something. That's doing it wrong. It is an unnecessarily round-about method of getting the real power, since the device must have already calculated the real power in order to get the power factor.