question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[COM] Communication issue with Tektronix MDO4054C using for loop

See original GitHub issue

Instrument details

  • Model: Tektronix MDO4054C Mixed Domain Oscilloscope
  • Communication: TCPIP
  • Link to the documentation (if available):

Output of pyvisa-info

C:\Users\englocal>pyvisa-info Machine Details: Platform ID: Windows-10-10.0.10586-SP0 Processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel

Python: Implementation: CPython Executable: c:\users\englocal\appdata\local\programs\python\python38-32\python.exe Version: 3.8.5 Compiler: MSC v.1926 32 bit (Intel) Bits: 32bit Build: Jul 20 2020 15:43:08 (#tags/v3.8.5:580fbb0) Unicode: UCS4

PyVISA Version: 1.10.1

Backends: ni: Version: 1.10.1 (bundled with PyVISA) #1: C:\windows\system32\visa32.dll: found by: auto bitness: 32 Vendor: Tektronix Impl. Version: 4194816 Spec. Version: 4194304

Hi, I am trying to write a program that will take the measurement of the current every minute over 48 hours. However, after a certain amount of time (anywhere between 4 to 60 minutes) the program stops and I get a miscellaneous error. In the code you will notice that I open and close the resource every loop, this is because when I didn’t I would get an I/O error. I appreciate any help I can get. The code:

import pyvisa
import time
import pandas as pd
visa
visa.ResourceManager
from visa import ResourceManager
rm = visa.ResourceManager()
ip_address = "TCPIP0::169.254.4.23::inst0::instr"
test_time = 1
for i in range(172800):
	tek = rm.get_instrument(ip_address)
	current = tek.query('measurement:meas1:value?')
	data = {
		'Time': [test_time],
		'Current': [current]
		}
	time.sleep(60)
	test_time = test_time + 1
	results = pd.DataFrame(data)
	results
	results.to_csv(r'C:\Users\englocal\Documents\LUNAR\Results.csv', index = False, header = False, mode = 'a')
	tek.close

I would like to reiterate that the code works fine but only for a limited amount of time. I should note I have tried modifying the read and write terminations in the get_instrument command but it did not seem to help.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mimirotimicommented, Sep 8, 2020

@IntegralWorks @MatthieuDartiailh hi all, right before leaving work on friday I set the IP address to a permanent address and let it run over the long weekend, and it worked! Thanks for the help, @IntegralWorks I think we caught it at about the same time.

0reactions
MatthieuDartiailhcommented, Sep 5, 2020

Thanks for sharing @IntegralWorks . Honestly I never use DHCP with instruments only a local network. But indeed a randomly changing IP could make sense in the context of DHCP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MDO4000C Series Oscilloscope User Manual - Tektronix
MDO4054C. MDO4104C. Key features. MDO4000C Mixed Domain Oscilloscopes ... Use e*Scope to communicate with your oscilloscope through a Web browser, such as.
Read more >
MDO4000, MSO4000B and DPO4000B Series Oscilloscopes
This manual explains the use of commands for remotely controlling your oscilloscope. With this information, you can write computer programs to.
Read more >
Fundamentals of the MDO4000C Series Mixed Domain ...
The Tektronix MDO4000 Series Mixed Domain Oscilloscope. (MDO) is the first tool to effectively address all of these measurement challenges for the embedded...
Read more >
MDO4000C, MDO4000B, MDO4000, MSO4000B ... - Tektronix
This manual explains the use of commands for remotely controlling your oscilloscope. With this information, you can write computer programs to.
Read more >
I am trying to use RS232 communication to my scope and it is ...
If you are connecting two devices of the same type, like a modern Tektronix oscilloscope and a modern PC, you need a null...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found