| | 62 | %% Check valid-flag, re-request data if necessary |
| | 63 | if ~in.Valid |
| | 64 | % init timeout-counter |
| | 65 | startTime = clock(); |
| | 66 | timeOut = 0.1; % in seconds |
| | 67 | % loop until valid |
| | 68 | while (~in.Valid) && (etime(clock, startTime) < timeOut) |
| | 69 | in = NXT_GetInputValues(port, handle); |
| | 70 | end%while |
| | 71 | %TODO please note that we DO NOT warn or do anything else if this |
| | 72 | %procedure above times out -- that seems ok, since we didn't do |
| | 73 | %that before (old ver. up to 2.02) either... |
| | 74 | % in that case, the returned value will probably be invalid... |
| | 75 | % dangerous. |
| | 76 | % solutions: either WARN, or return NaN... |
| | 77 | end%if |
| | 78 | |