Haven't got the time at the moment, however, Length_L is the length of the tank, Radius is half the tank dia, Part_Fill is the level in the tank (the only dynamic variable).
Here is a little more detail
formula (Radius^2 * ACOS(((Radius) - Part_Fill) / (Radius)) - (Radius - Part_Fill) * (2 * (Radius)*Part_Fill - Part_Fill^2)^(0.5))*Length_L
*)
(* Just for testing Setting values in metres so it does not divide by zero *)
IF SM402 THEN
Length_L:= 1.0; (* Metres*)
Radius := 0.5;
Part_Fill := 0.5;
END_IF;
(* Note: ACOS & Power are Standard FB's here so cannot put them directly into the formula *)
POW(TRUE,Radius, 2.0,Rad_Pow2); (* Radius^2 *)
ACOS(TRUE, ((Radius - Part_Fill) / Radius),Acos_T1); (* ACOS (((Radius)-Part_Fill)/(Radius))) *)
POW(TRUE,Part_Fill,2.0,POW_H_2); (* Part_Fill-Part_Fill^2 *)
POW(TRUE,(2.0*Radius * Part_Fill - Pow_H_2),0.5,Part_F_Part_F_0_5); (*Part_Fill-Part_Fill^2)^(0.5)) *)
Act_Level:= ((Rad_Pow2 * Acos_T1) - (Radius - Part_Fill) * (2.0 * Radius) * Part_F_Part_F_0_5) * Length_L;
Litres := Act_Level * 1000.0; (* convert to litres *)