This repository contains getting started guides, examples, and reference documentation for the SystemLink Client NuGet packages. These packages support .NET Standard 2.0. Therefore, they support both .NET Core 2.0 and .NET Framework 4.6.1 with Visual Studio 2017 or later.
Each client API has its own NuGet package for interacting with a specific SystemLink service or collection of related services:
Service | Package name | Package |
---|---|---|
Asset Management | NationalInstruments.SystemLink.Clients.AssetManagement | |
File Ingestion | NationalInstruments.SystemLink.Clients.File | |
Message | NationalInstruments.SystemLink.Clients.Message | |
Tag | NationalInstruments.SystemLink.Clients.Tag | |
Test Monitor | NationalInstruments.SystemLink.Clients.TestMonitor |
To use a SystemLink client in your application, add a reference to the NuGet package for the service or services you want to interact with.
dotnet add package NationalInstruments.SystemLink.Clients.Tag
Use the NuGet Package Manager or the NuGet console to add a reference to the package:
Install-Package NationalInstruments.SystemLink.Clients.Tag
The below getting started example creates a double tag on SystemLink Cloud, writes two values to it, then reads back and outputs the current value. The tag is deleted at the end of the example. See the examples directory to browse additional code examples.
using System;
using NationalInstruments.SystemLink.Clients.Core;
using NationalInstruments.SystemLink.Clients.Tag;
using NationalInstruments.SystemLink.Clients.Tag.Values;
namespace GettingStarted
{
class Program
{
static void Main(string[] args)
{
var apiKey = args[0]; // Not a secure way to load an API key.
var config = new CloudHttpConfiguration(apiKey);
using (var manager = new TagManager(config))
using (var writer = manager.CreateWriter(maxBufferTime: TimeSpan.FromSeconds(1)))
{
var tag = manager.Open("example.gettingstarted.double", DataType.Double);
var tagReader = new DoubleTagValueReader(manager, tag);
var tagWriter = new DoubleTagValueWriter(writer, tag);
tagWriter.Write(Math.E);
tagWriter.Write(Math.PI);
writer.SendBufferedWrites();
Console.WriteLine(tagReader.Read());
manager.Delete(new[] { tag });
}
}
}
}
See the Wiki for each client APIs' documentation.