Generating a 0-40 ohm signal

It seems we need to take him at face value.

Maybe he is trying to test an ohmmeter.

Rdrost:

You can use a MOSFET as a variable resistor. You need to measure the voltage across it and current through it. Adjust the gate voltage to set the current so that R=V[ across the MOSFET ]/ I [the current through the MOSFET].