Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(veristand): add veristand controller #20437

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down Expand Up @@ -86,6 +88,8 @@ data-visualization/metabase/plugins
desktop-qt/CMakeLists.txt.user
embedded/decode-can-data/data
hardware-in-the-loop/national-instruments/hm-tdms/data
hardware-in-the-loop/national-instruments/VeriStandController/VeriStandController/bin
hardware-in-the-loop/national-instruments/VeriStandController/VeriStandController/obj
hm-kafka/kafka-client/kafka-c/*/config.ini
kubernetes/certificates
kubernetes/data/config-loader
Expand Down
2 changes: 2 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// Anywhere
"**/*.aliases",
"**/*.asv",
"**/*.cache",
"**/*.cf",
"**/*.DotSettings.user",
"**/*.ghw",
"**/*.iml",
"**/*.lvlps",
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ AllCops:
# Anywhere (Folder mush have trailing /**/*)
- '**/*.aliases'
- '**/*.asv'
- '**/*.cache'
- '**/*.cf'
- '**/*.DotSettings.user'
- '**/*.ghw'
- '**/*.iml'
- '**/*.lvlps'
Expand Down
2 changes: 2 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ exclude = [
# Anywhere
"**/*.aliases",
"**/*.asv",
"**/*.cache",
"**/*.cf",
"**/*.DotSettings.user",
"**/*.ghw",
"**/*.iml",
"**/*.lvlps",
Expand Down
2 changes: 2 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions .sqlfluffignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ ignore: |
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions api-node/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions ethereum/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VeriStandController", "VeriStandController\VeriStandController.csproj", "{D99D3F07-09BA-49F2-B4A4-D65AAB41C037}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D99D3F07-09BA-49F2-B4A4-D65AAB41C037}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D99D3F07-09BA-49F2-B4A4-D65AAB41C037}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D99D3F07-09BA-49F2-B4A4-D65AAB41C037}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D99D3F07-09BA-49F2-B4A4-D65AAB41C037}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using NationalInstruments.VeriStand.ClientAPI;
using System;
using System.Diagnostics;

namespace VeriStandController
{
internal class Program
{
public static void Main(string[] args)
{
// Create an array of channel names, as defined in the system definition file
string[] names = {
"Aliases/ActualRPM",
"Aliases/DesiredRPM"
};

// An array whose elements are the values of each channel
double[] values = new double[names.Length];

string gatewayIp = "localhost";
string systemDefinitionPath = @"C:\Users\Public\Documents\National Instruments\NI VeriStand 2024\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivssdf";

Factory factory = new Factory();
IWorkspace2 workspace = factory.GetIWorkspace2(gatewayIp);

// Connect to the system and deploy the system definition file
workspace.ConnectToSystem(systemDefinitionPath, true, 60000); // ms

int totalMessages = 100000;
int messageCount = 0;
int messagesLast5Seconds = 0;

Stopwatch totalStopwatch = new Stopwatch();
Stopwatch intervalStopwatch = new Stopwatch();

totalStopwatch.Start();
intervalStopwatch.Start();

while (messageCount < totalMessages)
{
workspace.GetMultipleChannelValues(names, out values);
messageCount++;
messagesLast5Seconds++;

// Check if 5 seconds have passed
if (intervalStopwatch.ElapsedMilliseconds >= 5000)
{
double messagesPerSecond = messagesLast5Seconds / (intervalStopwatch.ElapsedMilliseconds / 1000.0);
Console.WriteLine($"Messages per second (last 5 seconds): {messagesPerSecond:F2}");

// Reset the 5-second counter
messagesLast5Seconds = 0;
intervalStopwatch.Restart();
}
}

totalStopwatch.Stop();
double totalTime = totalStopwatch.ElapsedMilliseconds / 1000.0;
double averageMessagesPerSecond = totalMessages / totalTime;

Console.WriteLine($"\nTotal time: {totalTime:F2} seconds");
Console.WriteLine($"Average messages per second: {averageMessagesPerSecond:F2}");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VeriStandController")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VeriStandController")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("D99D3F07-09BA-49F2-B4A4-D65AAB41C037")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D99D3F07-09BA-49F2-B4A4-D65AAB41C037}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VeriStandController</RootNamespace>
<AssemblyName>VeriStandController</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="NationalInstruments.VeriStand">
<HintPath>..\..\..\..\..\..\Program Files\National Instruments\VeriStand 2024\nivs.lib\Reference Assemblies\NationalInstruments.VeriStand.dll</HintPath>
</Reference>
<Reference Include="NationalInstruments.VeriStand.ClientAPI">
<HintPath>..\..\..\..\..\..\Program Files\National Instruments\VeriStand 2024\nivs.lib\Reference Assemblies\NationalInstruments.VeriStand.ClientAPI.dll</HintPath>
</Reference>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Data"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs"/>
<Compile Include="Properties\AssemblyInfo.cs"/>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
2 changes: 2 additions & 0 deletions mobile/mobile-react-native/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions web-cypress/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
2 changes: 2 additions & 0 deletions web/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Anywhere
**/*.aliases
**/*.asv
**/*.cache
**/*.cf
**/*.DotSettings.user
**/*.ghw
**/*.iml
**/*.lvlps
Expand Down
Loading