Vektrex.SpikeSafe.CSharp.Lib 1.1.1

Install-Package Vektrex.SpikeSafe.CSharp.Lib -Version 1.1.1
dotnet add package Vektrex.SpikeSafe.CSharp.Lib --version 1.1.1
<PackageReference Include="Vektrex.SpikeSafe.CSharp.Lib" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Vektrex.SpikeSafe.CSharp.Lib --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Vektrex.SpikeSafe.CSharp.Lib, 1.1.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Vektrex.SpikeSafe.CSharp.Lib as a Cake Addin
#addin nuget:?package=Vektrex.SpikeSafe.CSharp.Lib&version=1.1.1

// Install Vektrex.SpikeSafe.CSharp.Lib as a Cake Tool
#tool nuget:?package=Vektrex.SpikeSafe.CSharp.Lib&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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

License

Vektrex.SpikeSafe.CSharp.Lib is licensed under the MIT license, which allows for non-commercial and commercial use.

  • .NETFramework 4.7

  • .NETFramework 4.8

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 96 7/14/2021