02-21-2013 08:04 AM
04-09-2018 12:45 PM
Hi,
I have as well some issue to connect the spectrum 3495A with a GPIB to USB connector. I would like to try to control a spectrum analyser 4395A with labview and display the front panel and the screen of my spectrum analyser to my laptop.
I have downloaded the drive "Ag4395A" but it doesn't look like yours (see below)
Could you tell me where you got your drive.
I am also a bit confuse, with a connector GPIB to USB should I use the VI serial (because I am using a USB) or should I use the GPIB VI (see picture below)
04-09-2018 03:08 PM
If you open the llb, then select the topmost VI "Ag4395A_Front_Panel.VI" you should be able to control the instrument directly without having to write code yourself.
Once that is working for you, then you can look at the code that you use and if you like you can build your own program.
The driver/program uses GPIB communication call, but you could use VISA but not serial if you are using a USB-GPIB adaptor.
04-10-2018 07:37 AM
Hi everyone,
Thanks for your reply !
I tried the "Ag4395A_Front_Panel.VI" But it is not working, I have the following error message.
I look “measurement and automation” and I press "scan for instruments" and I have the following error message (see below). It is like my laptop detect the cable and not the spectrum analyser.
I looked online but haven’t found a goo answer to this error message. Do you know where is could come from?
I look at the sample code "Ag4395A_Front_Panel.VI" from National instrument to understand a bit more. And I think I need to use the “get data” block and display it after on the two-different graphs channel 1 and 2, But I don’t know what they mean with “bobus” or “what kind of Analyser”. Any idea?
In order to test the connection, I tried to set up a small program to connect to my spectrum analyser (see below) but I have the following error (28) message coming from my “GPIB read” box. My code is probably wrong as well.
Any suggestion ?
04-10-2018 08:50 AM
You'll need to get the connection working before the code will work.
In NI-MAX select the GPIB0, then hit the button "scan for instruments". If your 4395a doesn't come up then you need to make sure its enabled for GPIB communications, and take not of its GPIB address. Then try the scan for instruments again.
To help us help you please report back on ..
1) What is the instrument GPIB address?
2) Have you installed NI-VISA and NI-488? Do they match your version of LabVIEW? What versions are they?
I'm not familiar with the 4395a, so I'd also suggest you read the 4395a manual about GPIB/remote use and make sure all those settings are correct. Make sure the instrument is set to receive command, often refered to as "listener". If its set to "talker" then it will ignore the commands coming from the PC. This can happen when the instrument is used with other "slave" instruments.
04-10-2018 12:09 PM - edited 04-10-2018 12:15 PM
Hi
Thanks !
Indeed I forgot to change some settings in the spectrum analyser.
For those you might be interested :
Pressing "Local" on the front panel than pressing "address able only"
Now the spectrum analyser is recognized by "measurement and automation" (see below print screen)
But I still have the same error message when I am running the "Ag4395A_Front_Panel.VI" (see below the error message).
The code is attached ( HP4396A), I don't really understand how this code works.
I don't know where on the dashboard I should enter the GPIB address.
Any suggestion ?
04-11-2018 06:43 AM
When I sent a "*IDN?" with NI-488.2 communicator it's working (see picture below)
But when I tried the same query in Labview it doesn't work (see below) and I have the following error 28 "GPIB Initialization in Agilent_4395A.vi".
Any suggestions ?
Thanks in advance
04-11-2018 09:26 AM
Can you provide the answers to these?
- Have you installed NI-VISA and NI-488?
- Do they match your version of LabVIEW?
- What versions are they?
NI-MAX "communicate with instruments" is probably using VISA, but good to check what version of all installed software you have to make sure its all playing nicely with LabVIEW.
You could also try the simple instrument I/O code that minions posted a while back. Does the same thing as NI-Max communicator query. Note that it uses a LF termination character...not sure you used one or not in your tests, or what the 4395a requires or has been set to use. That's probably your issue here.
In future attach the code and not pictures of the code so it can be inspected.
04-11-2018 10:12 AM
I just noticed in some of your pictures that the error code is Error #28. Details below.
EPWR (28)
Error Condition: The Interface lost power.
Possible Cause: EPWR results when an interface loses power. This often results when the system goes to and returns from a standby state.
Solutions:
You should probably disable the USB low power option, which turn off the USB port when not in use regularly. Windows uses this on laptops to save battery life, but its often enabled on desktops too. To disable that look here - https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/GPIB-error-28-with-vi-but-no-error-in-MAX-co...
04-12-2018 12:04 PM
Hi Thanks for your reply !
I tried your solutions below
“”
Solutions:
“”
and after I tried you code “LV8_VISA_Simple_IO-minions.vi 14 KB” and it works perfectly see picture below.
I don’t have the error 28 anymore.
But I still have some problem with the code “HP4396A Main Instrument Panel” (see code attached).
“Error 4 occurred at FindLstn in Address Check.vi->HP4396A Main Instrument Panel.vi”
And also “Error 3 occurred at Receive in Receive Data.vi->Address Check.vi->HP4396A Main Instrument Panel.vi”
I am probably not using the code properly, I don’t understand the code, usually with a labview code you have to enter the address of your visa source name, in my case the “GPIB0::17::INSTR” but in this code I don’t see where I should enter it.
Any ideas ?