Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Automate PA1000 with Python

PA1000, PA3000, PA4000
Post Reply
[email protected]
Posts: 1
Joined: February 23rd, 2018, 5:01 pm
Country: United States

Automate PA1000 with Python

Post by [email protected] » February 23rd, 2018, 5:12 pm

Hello,

I am having an issue with reading data from PA1000.

I have done the following:
1. Installed NI VISA
2. Installed Python 2.7
3. Installed PyVISA Library Version 1.5
4. Wrote the following test program

Code: Select all

import visa
rm = visa.ResourceManager()
print rm.list_resources()
inst = rm.get_instrument('GPIB0::6::INSTR')
inst.write("*IDN?"+"\n")
print inst.read(":FRD?"+"\n")
I am seeing the following error every time I execute the above commands

Code: Select all

pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
Executing *IDN? on VISA Test Panel gives the Following

Code: Select all

Write Operation (*IDN?)

Return Count: 5 bytes

2: Read Operation
Return Count: 36 bytes
Tektronix,PA1000,B010273,Ver.1.3.15\n

GUSTAVO
Posts: 1
Joined: April 20th, 2018, 10:08 am
Country: Brazil

Re: Automate PA1000 with Python

Post by GUSTAVO » April 20th, 2018, 10:14 am

Hello,

You should insert those lines in your code when working with PA1000:

analyzer.read_termination = '\n'
analyzer.write_termination = '\n'

inst.write("*IDN?"+"\n") doesn't work in this case.

NI MAX write/read the messages of that instrument with those terminations automatically (*IDN?\n).

Post Reply

Return to “Power Analyzers”

Who is online

Users browsing this forum: No registered users and 2 guests