added retry loop until device is ready

Could you please add this 'retry' code?
It just waits for the BPM to become ready before doing the read of values.