08-10-2009 05:39 AM
Hi Kaza
VISA Find Resource returns you the actual name of the instrument; not alias. If you want to display the alias, you need to make some comparision on the block diagram and display the result on the front panel.
For example if you have named your GPIB1::INSTR as "Device1", compare the VISA Find Resource with GPIB1::INSTR and return "Device1", if true.
Does it help?
08-10-2009 06:26 AM
Ravi,
I've connected one signal generator with address GPIB0::12::INSTR, one spectrum Analyser with address GPIB0::17::INSTR to the pc using GPIB.I'm getting GPIB0::12::INSTR,GPIB0::17::INSTR and GPIB0::INTFC.BUT I DNT WANT THIS RAVI.I want the instruments names to be displayed on the front panel with check boxes to see if the instrument is connected on the GPIB or not.Like Signal generator followed by a check box.
Hope now u understand my problem Ravi...
08-10-2009 07:27 AM
Dear gpsrt
Have you ever heard the expression "You catch more flies with honey than with vinegar"? Yelling at people who are trying to help you out of the goodness of their heart isn't going to make them more inclined to help you. Espescially when they are giving you valid suggestions. I'm attaching an example VI (written in LV 8.6.1, please let me know if you are using a earlier version and I will be deligthed to resave it for you) that follows approximately what Ravi and Dennis have suggested. Note that the instrument that I want to verify if they are connected or not are called "TDS210" and "TDS211". You will need to change the constants to match the aliases you have set for your instruments in MAX (in the way described in the document muks provided the link for). If you have any further questions please feel free to post a reply at your own leisure.
Best Regards
David
08-10-2009 11:28 AM - edited 08-10-2009 11:34 AM
Try this. I added an expression to just search for GPIB instruments and the code to verify that the instruments are actually connected. Note that the Find Resources does not verify connection. It verifies that instruments were once connected and their aliases exist. Based on the result of the *IDN? query, it updates a listbox and adds the check mark.
David,
You VI has a bug in that if both instruments are found, it will only show the last one in the list.
08-10-2009 01:50 PM - edited 08-10-2009 01:51 PM
You are right as usual Dennis Converted the code from something else and played around with it a bit, not exactly great coding. Thanks for the great example
Best Regards
David
08-10-2009 11:15 PM
sorry David
I thought Ravi was sarcastically calling me kaza.It was purely misunderstanding.
I'm using version 8.6.Thanks for your help.
08-10-2009 11:23 PM
My motivation was to help you. Sorry if I did hurt! 😞
Ravi Shankar
08-10-2009 11:35 PM
08-10-2009 11:52 PM
Thanks Dennis,
But I'm still getting GPIB addresses only.i want to get the names of the instruments followed by check boxes.
Eg:1. Signal generator (followed by a checkbox)
2. Spectrum Analyser(followed by a checkbox)
08-10-2009 11:56 PM