In summary, I can write commands successfully to an instrument (the Agilent E4438C signal generator with ARB), but I can’t read them back. I’m using PyVISA and have installed the Agilent IO libraries.
I have attached a script I created that illustrates the issue and a screenshot from the Agilent IO Monitor, which I will reference in the following paragraphs.
You can see in lines 9-31 above that Python is being used to access the instrument. You should also be able to see in lines 9-19 that the command “RAD:ARB:STAT ON.\n” (note the trailing period before the new line string) is written and a success is returned. I can also verify that the requested action is performed on the instrument. Lines 20-31 show what happens when I try to read back the status. The command “RAD:ARB:STAT?.\n” is written, but the read times out as indicated in line 29.
Lines 1-8 show the same sequence of actions using the interactive command utility provided with the Agilent Connection Manager. Note that these commands do not have the trailing period before the new line string, and both the write and read commands are executed successfully, and the read command returns the proper value “1\n” indicating the status as “on.”
It seems like the PyVISA implementation adds this trailing period before the new line string, which does not seem to affect write commands but might be affecting read commands.
I’d appreciate any help or insight anyone might be able to provide.
I have attached a script I created that illustrates the issue and a screenshot from the Agilent IO Monitor, which I will reference in the following paragraphs.
You can see in lines 9-31 above that Python is being used to access the instrument. You should also be able to see in lines 9-19 that the command “RAD:ARB:STAT ON.\n” (note the trailing period before the new line string) is written and a success is returned. I can also verify that the requested action is performed on the instrument. Lines 20-31 show what happens when I try to read back the status. The command “RAD:ARB:STAT?.\n” is written, but the read times out as indicated in line 29.
Lines 1-8 show the same sequence of actions using the interactive command utility provided with the Agilent Connection Manager. Note that these commands do not have the trailing period before the new line string, and both the write and read commands are executed successfully, and the read command returns the proper value “1\n” indicating the status as “on.”
It seems like the PyVISA implementation adds this trailing period before the new line string, which does not seem to affect write commands but might be affecting read commands.
I’d appreciate any help or insight anyone might be able to provide.
I’m not certain why it was not able to communicate, but here’s what you can try. It was successfully run here with a E4438C and f/w 5.83. You may need to check the instrument / PyVisa setting again then try the following:-
Turn on the Arb then only query the Arb state.
Send:
RAD:ARB:STAT ON.\n
RAD:ARB:STAT?.\n
Regards -