Controling DAC with arduino and using app inventor

I want arduino code to program DAC by pwm to control a 4-20mA valve has i/p converter if give 4mA it opens 0% and if give 20mA it opens 100%
sorry my english is not good