На основе официального руководства я написал свой код:
Код: Выделить всё
using NationalInstruments.VeriStand.ClientAPI;
class Program
{
static void Main(string[] args)
{
string gatewayIp = "localhost";
try
{
// Initialize Factory class instance to access NI VeriStand system
Factory factory = new Factory();
Console.WriteLine("Factory created successfully");
IWorkspace2 workspace = factory.GetIWorkspace2(gatewayIp);
Console.WriteLine("Workspace obtained successfully");
}
catch (Exception ex)
{
Console.WriteLine($"Error type: {ex.GetType()}");
Console.WriteLine($"Error message: {ex.Message}");
Console.WriteLine($"Error stack trace: {ex.StackTrace}");
}
}
}
Код: Выделить всё
Factory created successfully
< /code>
Тип ошибки: system.reflect. p>
Трассировка стека ошибок:
в System.RuntimeType.CreateInstanceOfT()
в System.Activator.CreateInstanceT
в NationalInstruments.VeriStand.ClientAPI.ClientServerManager`1.GetClientServer(строковый адрес)
в NationalInstruments.VeriStand.ClientAPI.ClientServerManagerInstances.GetDataServices(строковый адрес)
в NationalInstruments. VeriStand.ClientAPI.WorkspaceImpl..ctor(строковый адрес)
в NationalInstruments.VeriStand.ClientAPI.WorkspaceAggregator.Create(строковый адрес)
в NationalInstruments.VeriStand.ClientAPI.Factory .GetIWorkspace2(Stringgate_ip_address)
в Program.Main(String[] args) в C:\Users\Hongb\Documents\Git\ConsoleApp1\ConsoleApp1\Program.cs:строка 18
Я могу подтвердить, что использую пользовательский интерфейс VeriStand для развертывания «Engine Demo» на шлюзе на локальном хосте

Будем благодарны за любые инструкции, спасибо!
Подробнее здесь: https://stackoverflow.com/questions/791 ... -an-invoca