The following is really bad:
javaaddpath("ca-1.3.2-all.jar")
con = org.epics.ca.Context();
ch = org.epics.ca.Channels.create(con, "NON_EXISTANT_PV");
% You can do nothing from here on other than kill Matlab
ch.get()
ch.close()
con.close()
An alternative is to connect via async, but I'm not sure of the consequences of this:
% Only do this once per Matlab session!
javaaddpath("ca-1.3.2-all.jar")
con = org.epics.ca.Context();
ch = con.createChannel("NON_EXISTANT_STRING_PV", java.lang.String().getClass());
ch.connectAsync();
pause(1) % There can be a better way of waiting for connection
if ~strcmp(ch.getConnectionState, "CONNECTED")
warning("PV does not exist")
end
ch = con.createChannel("EXISTANT_STRING_PV", java.lang.String().getClass());
ch.connectAsync();
pause(1) % There can be a better way of waiting for connection
if ~strcmp(ch.getConnectionState(), "CONNECTED")
warning("PV does not exist")
end
ch.get()
ch.close()
con.close()
However, the connect method should allow one to specify a timeout value (and not use an infinite timeout as default).
The following is really bad:
An alternative is to connect via async, but I'm not sure of the consequences of this:
However, the connect method should allow one to specify a timeout value (and not use an infinite timeout as default).