How to compute the work function in siesta?

Hello,
I would like to know the procedure to compute the work function of a surface and an interface with Siesta. I used keywords savetotalpotential and savelectrostatic potential.