07-25-2021 12:40 PM
I would like to scan for instruments using for loop and send "not assigned " or "is off line" message for these empty gpib addresses
07-25-2021 03:30 PM
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!
07-26-2021 09:37 AM - edited 07-26-2021 10:31 AM
@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,
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
07-26-2021 09:57 AM
@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.
07-26-2021 10:26 AM - edited 07-26-2021 10:41 AM
@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.