Automated test equipment control and data acquisition skill for hardware validation, with VISA/SCPI instrument communication, test sequence scripting, and measurement uncertainty analysis.
name test-automation description Automated test equipment control and data acquisition skill for hardware validation, with VISA/SCPI instrument communication, test sequence scripting, and measurement uncertainty analysis. allowed-tools Read, Grep, Write, Bash, Edit, Glob category Testing backlog-id SK-018 metadata {"author":"babysitter-sdk","version":"1.0.0"} Test Equipment Automation Skill Automated test equipment control and data acquisition for hardware validation and characterization. Purpose This skill provides comprehensive capabilities for automating electronic test equipment, enabling consistent and repeatable hardware validation workflows. It supports instrument communication, automated test sequences, data logging, and analysis. Capabilities Instrument Communication VISA/SCPI instrument communication protocols Support for GPIB, USB-TMC, LAN/VXI-11, and serial interfaces Instrument discovery and resource management Error handling and timeout management Connection pooling for multi-instrument setups Oscilloscope Automation Keysight, Tektronix, Rohde & Schwarz oscilloscope control Channel configuration and coupling Trigger setup (edge, pulse, pattern, serial) Waveform acquisition and transfer Measurement extraction (rise time, frequency, duty cycle) Screenshot capture and documentation Spectrum Analyzer Control Frequency span and center frequency configuration Resolution and video bandwidth settings Marker operations and peak search Trace capture and data export Limit line testing and pass/fail determination EMC pre-compliance measurements Power Supply and Electronic Load Control Output voltage and current programming Protection limit configuration Sequencing and timing control Load transient generation Efficiency measurement automation DMM and SMU Automation DC/AC voltage and current measurements Resistance and continuity testing Source-measure unit (SMU) operations IV curve characterization Temperature coefficient measurements Data Logging and Analysis Real-time data acquisition Statistical analysis (mean, std, min, max) Data logging to CSV, JSON, HDF5 Time-series trending Alarm and limit monitoring Test Sequence Scripting Sequential and parallel test execution Conditional branching based on results Loop and iteration support Test fixture abstraction Parameterized test cases Measurement Uncertainty Analysis Type A (statistical) uncertainty evaluation Type B (systematic) uncertainty estimation Combined uncertainty calculation Coverage factor and confidence intervals GUM-compliant uncertainty budgets Report Generation Automated test report creation Pass/fail summary tables Measurement data visualization Traceability documentation Export to PDF, HTML, Excel formats Prerequisites Installation pip install pyvisa pyvisa-py numpy pandas matplotlib Optional Dependencies
pip install h5py tables
pip install scipy uncertainties
pip install jinja2 weasyprint Usage Patterns Basic Instrument Communication import pyvisa
rm = pyvisa.ResourceManager()
print (rm.list_resources())
scope = rm.open_resource( 'TCPIP::192.168.1.100::INSTR' ) scope.timeout = 5000
idn = scope.query( '*IDN?' ) print ( f"Connected to: {idn} " )
scope.write( ':CHANnel1:DISPlay ON' ) scope.write( ':CHANnel1:SCALe 1.0' )
scope.write( ':TIMebase:SCALe 0.001' )
scope.write( ':TRIGger:EDGE:SOURce CHANnel1' ) scope.write( ':TRIGger:EDGE:LEVel 0.5' )
vpp = float (scope.query( ':MEASure:VPP? CHANnel1' )) freq = float (scope.query( ':MEASure:FREQuency? CHANnel1' )) print ( f"Vpp: {vpp: .3 f} V, Frequency: {freq: .2 f} Hz" )
scope.close() Automated Test Sequence from dataclasses import dataclass from typing import List , Dict , Any import time @dataclass class TestResult : name: str passed: bool value: float unit: str limit_low: float limit_high: float class TestSequence : def init ( self, instruments: Dict [ str , Any ] ): self .instruments = instruments self .results: List [TestResult] = [] def run_test ( self, name: str , measure_func, limit_low: float , limit_high: float , unit: str ) -> TestResult: value = measure_func() passed = limit_low <= value <= limit_high result = TestResult(name, passed, value, unit, limit_low, limit_high) self .results.append(result) return result def generate_report ( self ) -> Dict : return { 'total_tests' : len ( self .results), 'passed' : sum ( 1 for r in self .results if r.passed), 'failed' : sum ( 1 for r in self .results if not r.passed), 'results' : [ vars (r) for r in self .results] }
def measure_output_voltage (): return float (dmm.query( ':MEASure:VOLTage:DC?' ))
2.0 ):
n = len ( self .measurements) mean = np.mean( self .measurements) std = np.std( self .measurements, ddof= 1 ) type_a = std / np.sqrt(n)
type_b = self .instrument_uncertainty / np.sqrt( 3 )
combined = np.sqrt(type_a** 2
expanded = coverage_factor * combined return { 'mean' : mean, 'type_a_uncertainty' : type_a, 'type_b_uncertainty' : type_b, 'combined_uncertainty' : combined, 'expanded_uncertainty' : expanded, 'coverage_factor' : coverage_factor }
analysis = UncertaintyAnalysis() for _ in range ( 10 ): analysis.add_measurement( float (dmm.query( ':MEASure:VOLTage:DC?' ))) analysis.set_instrument_uncertainty( 0.001 )
result = analysis.calculate_combined_uncertainty() print ( f"Voltage: {result[ 'mean' ]: .4 f} +/- {result[ 'expanded_uncertainty' ]: .4 f} V (k=2)" ) Usage Guidelines When to Use This Skill Automated hardware validation and characterization Production test development Design verification testing Environmental testing with data acquisition EMC pre-compliance measurements Best Practices Always verify instrument connections before starting test sequences Use appropriate timeouts for slow measurements Implement proper error handling for instrument communication failures Document measurement conditions (temperature, humidity, setup) Include calibration verification in test procedures Use statistical analysis for production testing decisions Process Integration ee-hardware-validation (all phases) ee-environmental-testing (data acquisition) ee-emc-design-testing (pre-compliance measurements) Dependencies PyVISA and PyVISA-py for instrument communication NI VISA or Keysight IO Libraries for driver support Instrument-specific drivers as needed References PyVISA Documentation SCPI Standard Reference GUM Uncertainty Guide