Add project files.
This commit is contained in:
63
HTOLHAST/Form1.cs
Normal file
63
HTOLHAST/Form1.cs
Normal 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();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user