How to measure the resistance of digital potentiometer AD5241 in circuit when power on
Since the - input of the opamp will be at GND, (zero volts) no matter what, the opamp's output voltage will change in order to force enough current through the AD5241 to keep the - input at zero volts, no matter what the diode's doing.

So, if the AD5241 is sitting at, say, 1 megohm and everything is stable, then if you shunt the AD5241 with 1 megohm,  the output of the opamp will drop to half of what it was before it was shunted since that's the voltage that's needed to pump the same current as before through half the resistance.

Then, in order to divine the resistance when you don't know what it is, measure the voltage from the output of the opamp to GND  (NOT to the summing junction)  and then shunt the AD5241 with resistance until the opamp's output voltage falls to half of what is was originally.

Then disconnect the shunt, measure its [the shunt's] resistance, and VOILA! that'll be the AD5241's resistance.

Of course you'll need to be careful not to change the illumination of the diode or disturb it in any way...