Vektrex.SpikeSafe.CSharp.Lib
1.2.0
dotnet add package Vektrex.SpikeSafe.CSharp.Lib --version 1.2.0
NuGet\Install-Package Vektrex.SpikeSafe.CSharp.Lib -Version 1.2.0
<PackageReference Include="Vektrex.SpikeSafe.CSharp.Lib" Version="1.2.0" />
paket add Vektrex.SpikeSafe.CSharp.Lib --version 1.2.0
#r "nuget: Vektrex.SpikeSafe.CSharp.Lib, 1.2.0"
// Install Vektrex.SpikeSafe.CSharp.Lib as a Cake Addin
#addin nuget:?package=Vektrex.SpikeSafe.CSharp.Lib&version=1.2.0
// Install Vektrex.SpikeSafe.CSharp.Lib as a Cake Tool
#tool nuget:?package=Vektrex.SpikeSafe.CSharp.Lib&version=1.2.0
Vektrex.SpikeSafe.CSharp.Lib
The official C# driver supporting Vektrex SpikeSafe products:
Vektrex SpikeSafe C# API used for automation of custom instrument control sequences for testing LED, laser, and electronic equipment.
The Vektrex SpikeSafe C# API powers the C# examples published on Github.
GitHub Repository: SpikeSafe C# Samples
About
The Vektrex.SpikeSafe.CSharp.Lib package provides light-weight access C# helper classes and functions to easily communicate with to your SpikeSafe and parse data into easy to use objects.
Vektrex.SpikeSafe.CSharp.Lib supports all operating systems that support the free .NET Framework 4.8 Developer Pack.
Vektrex.SpikeSafe.CSharp.Lib follows NET Framework versions and dependencies for supporting different versions.
Installation
Install the latest stable version of Vektrex.SpikeSafe.CSharp.Lib with NuGet:
PM> Install-Package Vektrex.SpikeSafe.CSharp.Lib
Usage
Easily connect to a SpikeSafe and read its identification:
using System;
using Vektrex.SpikeSafe.CSharp.Lib;
namespace Sample
{
class Program
{
static void Main(string[] args)
{
// instantiate new TcpSocket to connect to SpikeSafe
TcpSocket tcpSocket = new TcpSocket();
tcpSocket.Connect("10.0.0.220", 8282);
// request and read SpikeSafe identification
tcpSocket.SendScpiCommand("*IDN?");
string idn = tcpSocket.ReadData();
Console.WriteLine(idn);
}
}
}
Simply use a SpikeSafe to power on a 3V LED/laser for 10 seconds and read its voltage:
using System;
using Vektrex.SpikeSafe.CSharp.Lib;
namespace Sample
{
class Program
{
static void Main(string[] args)
{
// instantiate new TcpSocket to connect to SpikeSafe
TcpSocket tcpSocket = new TcpSocket();
tcpSocket.Connect("10.0.0.220", 8282);
// set SpikeSafe current to 100 mA, compliance voltage to 10V, and turn it on
tcpSocket.SendScpiCommand("SOUR1:CURR 0.1");
tcpSocket.SendScpiCommand("SOUR1:VOLT 10");
tcpSocket.SendScpiCommand("OUTP1 1");
// wait 10 seconds for LED/laser to power on
Threading.Wait(10);
// read and parse LED/laser data
string data = tcpSocket.ReadData();
MemoryTableReadData memoryTableRead = MemoryTableReadData.Parse(data);
Console.WriteLine(memoryTableRead.ChannelDataList[0].VoltageReading);
}
}
}
Connect to more than one SpikeSafe:
using System;
using Vektrex.SpikeSafe.CSharp.Lib;
namespace Sample
{
class Program
{
static void Main(string[] args)
{
// create socket and connect to SpikeSafe 1
TcpSocket spikeSafe1 = new TcpSocket();
spikeSafe1.Connect("10.0.0.220", 8282);
// create socket and connect to SpikeSafe 2
TcpSocket spikeSafe2 = new TcpSocket();
spikeSafe2.Connect("10.0.0.221", 8282);
}
}
}
Support / Feedback
For further assistance with Vektrex.SpikeSafe.CSharp.Lib please contact Vektrex support at support@vektrex.com. This page is regularly monitored and maintained by Vektrex engineers.
Built With
Versioning
We use SemVer for versioning.
Authors
- Eljay Gemoto - eljayg
License
Vektrex.SpikeSafe.CSharp.Lib is licensed under the MIT license, which allows for non-commercial and commercial use.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.