MATLAB Answers


Check for instrument objects

Asked by Arun
on 6 Jun 2011
Accepted Answer by Gerd

Is there a way to look for existing interface objects prior to creating new ones? For example, if programs don't complete there are often objects in memory still connected to instruments. This causes problems if they are in place when the program is run again.

A better practice would be to make sure no objects exist before creating new ones, but I'm not sure how.



1 Answer

Answer by Gerd
on 6 Jun 2011
 Accepted answer

Hi Arun,

what interface objects are you looking for. When you talking about serial communication object you can find them using



  1 Comment

on 6 Jun 2011

Hi Gerd,
I'm using both serial and VISA objects, but it looks like instrfind works on both. A delete(instrfind) command clears out all interface objects - exactly what I was looking for. Thanks.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!