Add project files.

This commit is contained in:
Wesley Hofman
2025-08-29 18:17:48 +02:00
parent 31eaf9e5f7
commit a0d5f3b21b
23 changed files with 2144 additions and 0 deletions

63
HTOLHAST/Form1.cs Normal file
View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
namespace HTOLHAST
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void HamegValidationOfMethods()
{
string resourceString = "ASRL4::INSTR"; // Replace with your instrument's resource string
HMP4040 hameg = new HMP4040(resourceString);
hameg.GetID();
string voltageResponse = hameg.MeasureVolt(1);
Console.WriteLine($"Measured Voltage: {voltageResponse} V");
string currentResponse = hameg.MeasureCurrent(1);
Console.WriteLine($"Measured Current: {currentResponse} A");
string voltageSetpoint = hameg.SetVoltage(1.1, 1);
Console.WriteLine($"Voltage Setpoint: {currentResponse} V");
string currentSetpoint = hameg.SetCurrent(0.1, 1);
Console.WriteLine($"Current Setpoint: {currentResponse} A");
hameg.PowerUpSequence(hameg.GenerateSimulationPowerUpSequence());
hameg.PowerDownSequence(hameg.GenerateSimulationPowerUpSequence());
}
public void KeithleyValidationOfMethods()
{
// Example usage
string resourceString = "ASRL3::INSTR"; // Replace with your instrument's resource string
Keithley6485 keithley = new Keithley6485(resourceString);
// Query the instrument ID
keithley.Reset();
string idnResponse = keithley.GetID();
Console.WriteLine($"Instrument ID: {idnResponse}");
// Measure DC current
keithley.PerformZeroCheck();
string currentResponse = keithley.MeasureDCCurrent();
Console.WriteLine($"Measured Current: {currentResponse}");
// Close the instrument connection
keithley.Close();
}
}
}