【发布时间】:2021-10-18 12:07:57
【问题描述】:
如何在 Visual Studio 中从 C# 更改 CANoe 中的信号值?我不想制作一个测试模块并从 CANoe 运行它,我只想从 Visual Studio 运行并更改信号值。尝试设置信号值时出现此错误:
Vector.CANoe.Runtime.Internal.DBTypeNotFoundException: '在配置中找不到类型 SignalName。'
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using Vector.PanelControlPlugin;
using NetworkDB;
using Vector.CANoe.Runtime;
using Vector.CANoe.Runtime.Internal;
using Vector.CANoe.Runtime.ValueEntitiesInternal;
using Vector.PostCompiler;
using Vector.CANoe.Sockets;
using Vector.CANoe.VTS;
using Vector.CANoe.VTSInternal;
using Vector.Diagnostics;
using NetworkDB;
namespace Demo
{
public class Class1// : IPanelControlPluginLibrary
{
[OnChange(typeof(NetworkDB.PAAK_WELCOME_LIGHTS))]
public static void OnSignalLockState()
{
double value = 1;
NetworkDB.PAAK_WELCOME_LIGHTS.Instance.GetValue();
}
static void Main(String[] args)
{
OnSignalLockState();
}
}
}
【问题讨论】:
-
请分享您的代码。无法猜测您的设置是什么样的,您正在使用哪些 API,等等。
-
pastebin.com/nqW2CYeW - 这是我的代码,我正在使用来自 CANoe 15 @M.Spiller 的引用
-
将代码添加到问题中。不能作为进入 cmets 的链接...除此之外,Vector.CANoe.Runtime 程序集只能在 CANoe 内部使用,即作为节点或 sn-p 运行时。如果你想改变信号从外部你必须使用COM接口。
-
现在代码被添加到问题中,所以我必须使用COM接口吗?有相关文件吗?
-
您可以在 Technical References -> COM Interface 的 CANoe 文档中找到它。
标签: c# .net vector canoe automotive