LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan for instrument

I would like to scan for instruments using for loop and send "not assigned " or "is off line" message for these empty gpib addresses 

0 Kudos
Message 1 of 5
(1,415 Views)

Hi ermiway,

 


@ermiway wrote:

I would like to scan for instruments using for loop and send "not assigned " or "is off line" message for these empty gpib addresses 


Just do it!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,383 Views)

 


@ermiway wrote:

I would like to scan for instruments using for loop and send "not assigned " or "is off line" message for these empty gpib addresses 


You could simple do a *IDN? query on GPIB addresses 1-255 30 (0 is your GPIB interface) and wait for a timeout and move on if nothing is there... 

 

Or Start with VISA Find Resource

 

The VISA Find Resources tells you that there is a VISA Resource available, 

findCapture.PNG

you need to do an *IDN? on each returned resource to find out exactly what instrument is on what GPIB address.

 

 

EDIT 30 not 255

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(1,339 Views)

@RTSLVU wrote:

You could simple do a *IDN? query on GPIB addresses 1-255 and wait for a timeout and move on if nothing is there... 


Per 488.2, addresses only range 0 to 30.  Some devices also have subaddresses, which also range 0 to 30.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(1,330 Views)

@crossrulz wrote:

@RTSLVU wrote:

You could simple do a *IDN? query on GPIB addresses 1-255 and wait for a timeout and move on if nothing is there... 


Per 488.2, addresses only range 0 to 30.  Some devices also have subaddresses, which also range 0 to 30.


Yeah, I couldn't remember the max GPIB address right off the top of my head.  

 

Anyway instead of just searching every possible address for an instrument, or in the case of multiple instruments then making a list of what is where and going from there.

 

I keep all the instruments' VISA Resource (GPIB address, Com port, IP address, etc.) in a configuration file that is parsed on startup. Then since I know where each instrument should be, that is the only place I look for them. Then I can do a *IDN? and expect a certain response.

 

If an instrument is NOT there then I do something. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(1,323 Views)