forked from hbkworld/open-api-time-data-recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWaitForTEDSDetection.m
39 lines (22 loc) · 1.06 KB
/
WaitForTEDSDetection.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function WaitForTEDSDetection(ip,DefaultTimeout)
% Bruel & Kjaer LAN-XI Open Application Programming Interface
% MATLAB Simple Recorder GUI Version 1.0 (September 15, 2021)
% By Matthew Houtteman and Gert Nyrup
% +1 800-332-2040
% Developed in MATLAB R2021a with LAN-XI Firmware 2.10.0.501
% This function runs a while loop until the REST GET command
% /rest/rec/onchange returns transducerDetectionActive = false
RecorderStatus = GetRecorderStatus(ip,DefaultTimeout);
if isempty(fieldnames(RecorderStatus)) % Keep issuing GET command until we get a proper result
while isempty(fieldnames(RecorderStatus))
RecorderStatus = GetRecorderStatus(ip,DefaultTimeout);
end
end
while RecorderStatus.transducerDetectionActive == true
RecorderStatus = GetRecorderStatus(ip,DefaultTimeout);
while isempty(fieldnames(RecorderStatus)) % Keep issuing GET command until we get a proper result
RecorderStatus = GetRecorderStatus(ip,DefaultTimeout);
end
end
end