Return VI value instead of saving it in a global variable.