08-23-2011 03:45 PM
Hi,
I have a LabVIEW program that creates a Guided Power Calibration on a PNA.
After initializing everything properly, I have a for loop that loops through all the manual steps that the user must go through (ex: Connect Channel A of Power meter to Port 1" "Connect male Short to port 1" etc).
The problem is, the program displays an error at the first command: sens:corr:coll:guid:acq STAN1
I says there is an error with the GPIB Write function.
Here are the commands I send:
SYST:PRES
DISPlay:WINDow2:STATE ON
CALCulate2:PARameter:DEFine:EXT 'MyMeas',S21
DISPlay:WINDow2:TRACe1:FEED 'MyMeas'
CALC1:PAR:SEL 'CH1_S11_1'
SENS:FREQ:STAR 2e9
SENS:FREQ:STOP 4e9
SENS:SWE:POINTS 3
SENS:CORR:COLL:GUID:CONN:PORT1 'APC 2.4 male'
SENS:CORR:COLL:GUID:CONN:PORT2 'APC 2.4 male'
SENS:CORR:COLL:GUID:CKIT:PORT1 '85056D'
SENS:CORR:COLL:GUID:CKIT:PORT2 '85056D'
SENSe:CORRection:COLLect:GUIDed:PSENsor1 ON
SYSTem:COMMunicate:PSENsor gpib, "13"
SENSe:CORRection:COLLect:GUIDed:PSENsor1:POWer:LEVel -20
sens:corr:coll:guid:init
sens:corr:coll:guid:steps?
//for loop from 1 to total_number_of_steps
sens:corr:coll:guid:desc? <step#>
sens:corr:coll:guid:acq STAN<step#>
The program quits right at the first step, when I send "sens:corr:coll:guid:acq STAN1", although the command is executed.
Also, the VBScript with the same commands works fine.
Can anybody help me? I've been stuck for a while now.
I attached the block diagram of the for loop.
Thanks in advance,
Nicolas
08-23-2011 04:10 PM
Why did you not provide the actual error code/message? That's essential information.
08-23-2011 04:43 PM
Here is the error message: "GPIB Write in Guided Power Cal.vi"
error code: 2
08-23-2011 05:24 PM
And does the instrument show up in MAX when you do a scan for instruments? Is it at the same address that you have specified in your code? I'm assuming you know how to get the complete error message from the code. Typically, a no listener error should also be seen during the scan.
08-23-2011 06:06 PM
I can see my PNA when I scan for instruments, at address 16, which is the address I specified in my program.
All the commands execute correctly, except for the one I mentioned.
I don' t know how to get the complete error message. I looked up code 2, which corresponds to "Memory is full" -
08-24-2011 06:28 PM
...Anybody has an idea where the problem comes from?
I attached the vi, it's quite long but it's just sending the commands mentioned above.
Thanks,
08-25-2011 12:32 PM
Nicolas -
Have you tried to send the command line to your instrument in MAX as opposed to LabVIEW? If so same results?
Also what specific device are you working with? Have you confirmed that the instrument should accept the command you are sending it?
08-25-2011 01:15 PM
Hi Ben,
Here is the error I am getting in MAX:
"iberr = ENOL
ENOL indicates that no instrument was detected at the specified address. Verify that your instrument is powered on and properly connected to your GPIB interface."
This occurs when I attempt to send sens:corr:coll:guid:desc? 2.
So yes I observe the same results, which is nothing works after sens:corr:coll:guid:acq STAN1.
The devices I am using are: Agilent PNA 8364C and Agilent E4419B Power Meter.
They are connected through HP-IB controller port, and the computer is connected to the PNA through the Talker/Listener port.
The instrument should accepte the commands I am sending, since I sent the same commands in a VBScript and it works fine.
Any idea?... I don't know where to look...
08-26-2011 09:24 AM
It sounds like it could be a bug with the Agilent device. You code looks fine, and since you can send all the other commands and communicate with the machine with the other commands I figured you already realized that. I have seen some issues like this before and sometimes adding a "\n" to the end of the command line has fixed the issue. Can you give that a try and see waht it does? So in case you would type in "sens:corr:coll:guid:desc? \n" in the string command. Let me know if this changes anything.
08-26-2011 11:05 AM
Sending SENS:corr:coll:guid:acq STAN1 \n gives me a different error: -101 "Invalid Character".
From my different attempts at figuring this out, I thought the problem would come from LabVIEW, since the vbscript with the same commands works on the PNA.
I also modified the for loop because I thought each iteration should be linked to the previous one with the error wire (see attached).
I still have the same issue, only the first iteration is executed, then the program quits.