Path: news.mathworks.com!not-for-mail
From: "Ankit Desai" <adesai.nospam@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Automatically scan for instruments on bus (GPIB or TCPIP)
Date: Thu, 1 May 2008 22:23:03 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 65
Message-ID: <fvdfs7$qdu$1@fred.mathworks.com>
References: <q5ednZ0PfaoQfRXanZ2dnUVZ_gednZ2d@comcast.com> <PqGdnahZyrlBxgbanZ2dnUVZ_jWdnZ2d@comcast.com> <fnfmkn$2n$1@canopus.cc.umanitoba.ca> <ZNSdnaVWR_oq8QbanZ2dnUVZ_uyinZ2d@comcast.com> <13ppe9igr1lnh0e@corp.supernews.com> <nLqdnd10QJDNTAHanZ2dnUVZWhednZ2d@comcast.com>
Reply-To: "Ankit Desai" <adesai.nospam@mathworks.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1209680583 27070 172.30.248.37 (1 May 2008 22:23:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 1 May 2008 22:23:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 143898
Xref: news.mathworks.com comp.soft-sys.matlab:466205


Jesse Lai <"jlai.[DELETETHIS]matlab"@gmail[NOSPAM].moc>
wrote in message
<nLqdnd10QJDNTAHanZ2dnUVZWhednZ2d@comcast.com>...
> D. Ismay wrote:
> > Jesse Lai wrote on 26-Jan-08 09:26 :
> > [...]
> >> Commonly on a TCPIP "bus", 
> > 
> > As Mr. Robinson tried so diligently to explain to you
earlier, TCPIP is 
> > not a 'bus', it is a communication protocol.  Also, the
acronym GPIB 
> > means 'general purpose interface bus', so TCPIP is not
"...similar in 
> > meaning to the GPIB bus".
> > 
> > It seems unlikely you will be able to solve your problem
if you cannot 
> > be bothered to understand fundamental terminology.
> 
> I have already found a solution to my problem, now I just
have to 
> compile a DLL for the code.  I'm going to use NI's
Measurement and 
> Automation Explorer as the repository for connected
instruments just 
> like LabView does it.
> 
> I've found the correct .NET library calls from C# to
obtain the list of 
> instruments on the various interfaces (GPIB, TCPIP,
Serial, etc).  I'll 
> compile it into a DLL, then call it from MATLAB.
> 
> Perhaps there is a better way to directly call .NET
resources from 
> MATLAB?  If not, I'll continue down this path.

Hi Jesse,

The way you get information about connected instruments is
to use 'instrhwinfo' command that ships with the Instrument
Control Toolbox.

info = instrhwinfo('gpib');

Will return structure info with all details (including
constructor to create GPIB object). Once you have an object,
you can pass *IDN? query and get the identification.

Similar commands you can use are:

infoVisa = instrhwinfo('visa','agilent');

infoTCPIP = instrhwinfo('tcpip');

infoUDP = instrhwinfo('udp');

infoSerial = instrhwinfo('serial');

help instrhwinfo should provide you with the documentation.

Hope this helps,

-Ankit