08-11-2009 01:12 AM
Also, How do you know the byte count is 500 before hand
08-12-2009 08:32 AM
Hi gpsrt
The error code -1073807339 means " Timeout expired before operation completed.". You can find the definitions of error codes in "Explain Error" under the Help menu in LabVIEW.
If you are still just getting GPIB addresses with the code Dennis provided make sure you have set a Alias for the instrument in MAX(see the link muks provided). You need to do this first.
Best Regards
David
08-12-2009 09:36 AM - edited 08-12-2009 09:38 AM
And a basic way to find the meaning of any error code is to paste the code into an error indicator. Right click on it and select 'Explain ...'
The whole point of the *IDN? is that there will be no response if the instrument is not there and there will be a timeout error. This is what you asked for.
As far as the 500 bytes is concerned, I would have no idea how many bytes are available and don't care. It's just an arbitrary number. The VISA Read will automatically terminate when the GPIB EOI is detected so you can specify any large number.
08-13-2009 01:08 AM
Thanx dennis and David.
I'm learning so many things from you people.
08-13-2009 01:51 AM
Dennis,You said
Note that the Find Resources does not verify connection. It verifies that instruments were once connected and their aliases exist.
08-13-2009 03:15 AM
"Note that the Find Resources does not verify connection. It verifies that instruments were once connected and their aliases exist."
The explanation to this is : MAX remebers the istruments that were connected to the PC.
I dont have GPIB instruments connected to my PC, so I used the DAQ card instead to demonstrate. In the devices and interfaces >> NI DAQmx devices; pci cards have different colors(in figure below). In that, white color (with a cross mark) indicates that the device was connected in the past and is not present now. Green indicats that the device is connected now, yellow is a simulated device.
Similarly, MAX remembers GPIB instruments and its aliases also. Now when you use the "VISA Find Resource" vi it gets all the instrument resources from MAX. So, the extra part of the code is to verify if the instrument is actually connected or not.
(Dennis and David please correct me if I'm wrong)
And regarding "alias" names:
As the help says if there's no user defined alias name to the instrument, the vi returns "VISA Canonical spec-defined" resource format. So please make sure you have given all the instruments alias as you want.
thanx
Ravi
08-13-2009 04:55 AM
MUKs,
I've connected NRT power meter and I want to give alias to Power meter.But in MAX I'm getting 'No Visa resources found' under Devices and Interfaces tab.plz see the attached jpg.
08-13-2009 05:50 AM
Dear gpsrt,
Are you able to use VISA/NI 488.2 in LabVIEW? Which version of LabVIEW? If you are able to use these drivers without any problem in LabVIEW then there seems to be some problem with MAX. Repair it.
Otherwise VISA and NI 488.2 needs to be reinstalled.
Since this post is sooo long i am assuming that the very first question you had asked must have been installed.
08-13-2009 06:13 AM
Yes BOT.I'm able to use VISA/NI 488.2 in LabVIEW.
Version labVIEW 8.6
Since this post is sooo long i am assuming that the very first question you had asked must have been installed.
I dnt understand this.It is not that the post is too long.More importantly I'm learning so many things on this forum.
08-13-2009 06:31 AM
Did you have this problem in MAX, from the beginning of the post?? It answers so many questions.
If you can't detect your instruments in MAX, you can't give an alias, you can't show them on your front panel.
Probably its an installation problem.
Alternate: Give an alias name without using MAX.
Way to do it: Modify the "visaconf.ini" file where the aliases are saved. For this navigate to C:\Documents and Settings\All Users\Application Data\National Instruments\NIvisa folder for windows xp. then run the "VI Find Resource" vi with "aliases only" as "search mode".
thanx
Ravi