VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem deploying system definition from command line and through .NET API

I would like to interact with a system definition programmatically. As a first step, I am trying to deploy a system definition from the command line as follows:

> veristand-server.exe start

> veristand-server.exe deploy "test.nivssdf"

This deployment fails.

However, when I deploy the same system definition from VeriStand and from the command line, do

> veristand-server.exe status

Also, when I do

> veristand-server.exe undeploy

it successfully undeploys. Any ideas on why it is not able to deploy, but can undeploy?

 

When I try to deploy using the .NET API, I get the following error:

Unhandled Exception: System.Exception: FFFB4D55: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi

 

But when I undeploy using the .NET API, that works.

 

So, deploy doesn't work from the command line or from the .NET API, but undeploy works both ways.

 

Further, when I deploy through VeriStand, and connect using the .NET API to the deployed system definition, I get the following error.

 

Unhandled Exception: System.Exception: FFFB4E36: DataServices.lvlib:ERunConfiguration.vi.ProxyCaller >> DataServices.lvlib:ERunConfiguration.vi:3090002

 

Any suggestions? Thanks.

 

 

0 Kudos
Message 1 of 6
(111 Views)

Try Running VeriStand Operations Using the Command Line

Start with the Engine Demo example.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 2 of 6
(78 Views)

Running VeriStand from the command line like so

> VeriStand.exe /deploy "system definition"

simply starts VeriStand. It only deploys that system definition from the command line if it is already open in VeriStand. This is not the behavior documented in the link you had referred to. I wonder what might be going on.

0 Kudos
Message 3 of 6
(71 Views)

@mvsiva wrote:

Running VeriStand from the command line like so

> VeriStand.exe /deploy "system definition"

simply starts VeriStand. It only deploys that system definition from the command line if it is already open in VeriStand. This is not the behavior documented in the link you had referred to. I wonder what might be going on.


I noticed this as well.  The procedure in the help documentation for running VeriStand headless doesn't make any sense.

 

Trying to run VeriStand headless just opens the GUI.

 

veristand-server.exe doesn't provide the capability to deploy a system definition file to both the gateway (host) and the engine (real-time target).

 

This is an issue with VeriStand software.

 

I don't think NI has actually walked through their own procedure or followed any of their own instructions. Because  if they did, they would immediately find out their procedure and software doesn't work as described.

0 Kudos
Message 4 of 6
(59 Views)

I have been able to make some progress.

 

First, from here, change security so that multiple hosts can connect to the same target. I am interpreting this as the VeriStand GUI is one host and the program calling the .NET API is the other host. When I do this, the program calling the .NET API is able to connect to the target system definition and interact with it.

 

I adapted the example code from here as below, and it does the job.

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NationalInstruments.VeriStand.ClientAPI;
using NationalInstruments.VeriStand;

namespace MyNamespace
{
    class Program
    {
        static void Main(string[] args)
        {
            String logTriggerCmd = "Aliases/EDLTrigger";
            String logCommandCmd = "Aliases/EDLCommand";

            uint timeout = 60000; // connection timeout

            //path to the system definition file.
            String sysdefPath = "C:\\Users\\me\\mysystemdef.nivssdf";
            String gatewayIP = "localhost"; //IP address of veristand gateway the system definition will be deployed to.

            //make new workspace object
            Factory FacRef = new Factory();
            IWorkspace2 Workspace = FacRef.GetIWorkspace2(gatewayIP);

            // Connect to the system definition 
            Workspace.ConnectToSystem(sysdefPath, false, timeout);
            Console.WriteLine("Connected successfully");
            Console.WriteLine("");

            // Start logging 
            Workspace.SetSingleChannelValue(logTriggerCmd, 1.0);
            Console.WriteLine("EDL triggered");
            Console.WriteLine("");

            System.Threading.Thread.Sleep(10000); // Wait 10 seconds

            // Stop logging and close file
            Workspace.SetSingleChannelValue(logTriggerCmd, 0.0);
            Workspace.SetSingleChannelValue(logCommandCmd, 2.0);
            Console.WriteLine("EDL closed");
            Console.WriteLine("");

            // Disconnect from system 
            Workspace.DisconnectFromSystem("", false);
            Console.WriteLine("Disonnected from system");
            Console.WriteLine("");
        }
    }
}

 

 

There are few remaining issues.

1. Still not able to deploy from the command line using veristand-server.exe, or programmatically using the ,NET API call - however, this is not a major issue for me, I can deploy from the VeriStand GUI and doesn't affect my workflow

2. My main remaining issue is calling 

 

Workspace.DisconnectFromSystem("", false);

 

should simply disconnect without undeploying, but is undeploys. Any suggestions?

0 Kudos
Message 5 of 6
(47 Views)

Hi BigApple0, mvsiva,

 


@BigApple0 wrote:

 

Trying to run VeriStand headless just opens the GUI.

 


To run VeriStand headlessly, follow the documentation at "Running the VeriStand Gateway Silently". This brings up the Gateway and lets you connect to it via APIs without bringing up the VeriStand application.

 

To run/operate VeriStand application from command line, follow the documentation at "Running VeriStand Operations Using the Command Line". This is not the headless mode of operation.

 

However, I acknowledge there is scope for improving our user manuals 🙂 we are working on it.

 


@mvsiva wrote:

 

2. My main remaining issue is calling 

 

Workspace.DisconnectFromSystem("", false);

 

should simply disconnect without undeploying, but is undeploys. Any suggestions?


If you are using a windows target, DisconnectFromSystem will undeploy regardless of the undeploy parameter.

If you are using a NI Linux RT target, DisconnectFromSystem only disconnects if you specify undeploy as false.

Calling VeriStand-server.exe status at this point will say "Nothing Deployed" because we just disconnected the gateway from the target. This is accurate as the gateway is now free and not connected to any active deployment. But the target will still continue to execute the system.

To verify this, try calling ConnectToSystem with deploy set to false and it should work.

Let me know if this is not the case with you.

 

0 Kudos
Message 6 of 6
(8 Views)