I guess I am unclear on what you are trying to do. Are you needing the voltage drop across the resistor for some reason, or do you (as your code says) need the resistance of the resistor? By definition, unless there is another resistance in series with the one you are measuring, the voltage drop across the resistor will be equal to the source voltage.
If what you really need is the value of the resistance, simply put the meter into 4-wire measurement mode, coonect the leads and measure away. By the way, 4-wire mode is a way of improving the accuracy of the resistance measurement by effectively nulling-out the effect of the measurement lead resistances. The way it works is by using two wires on each side of the resistance. One wire on each end is connected to
a fixed current source. The other wires at each end are connected to a measurement circuit with a very high input impedance. These leads measure the voltage across the resistor right at the resistance. Because, the instrument now knows the voltage across the resistance under test and the current it is applying, determining the resistance is a simple math exercise (R=E/I).
What's more, because the input impedance of the voltage meaasurement is very high, the current flow through these sense wires is very low, which results is a very small voltage drop across the wires (E=I*R), which results in a very accurate measurement.
But again, could you please describe in a little more detail exactly what it is that you are trying to do?
Mike...