Thanks for that suggestion. It obviously could be the problem, but I thought that the command get_usb_power only returned a result on the transition mark to space. Have I misunderstood this command? Whoops, I see a fault in my logic there, if it only returns a result on the transition I don't know how long the loop is anyway (that is also true for your code segment). The question is still valid though, what exactly does the command return and when? Is it the case that zero is returned unless there has been a transition and if so surely that means that the result will always be zero unless the command is activated at the exact moment of the transition. Sorry to be a pain, I am probably showing my ignorance of the basic coding.