Generating a 0-40 ohm signal

Seems OP wants a digitally controllable load between 0 and 40ohm.
Maybe an 8-relay module with R-2R resistors.
Leo..