Code covered by the BSD License  

Highlights from
Jasco BPR RS232 communication

Jasco BPR RS232 communication

by

 

20 May 2013 (Updated )

Drivers and higher level commands for controlling Jasco BPRs via RS232.

bprobjtestconnect(serialObject)
function response = bprobjtestconnect(serialObject)
% BPROBJTESTCONNECT tries to send the connect command to the BPR

% e.g. bprtestconnect(serialObject) returns a response if both connection
% and disconnection were successful

% if either of the commands fail, it will error

% checks the number of arguments
error(nargchk(1, 1, nargin))

% sends command to connect
bprobjcomm(serialObject, '#1')

% pause between for robustness
pause(1)

% attempt to disconnect from RC mode
try
    % send command
    bprobjcomm(serialObject, '#2')
    
catch
    % display a warning if it didn't like it
    warning('bprDisconnect:rcError', 'Did not properly exit RC mode.')
end

% if it got this far, both were successful - response is 1 (doesn't matter
% what it is as long as it doesn't error)
response = true;

Contact us