04-05-2023 08:48 PM - edited 04-05-2023 09:47 PM
I can only find .NET API to get/set device channel from this sample: https://www.ni.com/docs/zh-CN/bundle/veristand-net-api-reference/page/vsnetapis/c_exec_deploying.htm... but how to get/set custom device channel value? Could you give me a C# example? like below screenshot:
04-05-2023 09:17 PM
The channels from the custom devices are exposed as the channels just like any other device. In fact, DAQ, XNET or other devices are the custom devices natively shipped by VeriStand. They have the same architecture as the user-defined custom devices.
If you are using TestStand to control VeriStand, you should consider using ASAM XIL Steps for NI TestStand.
04-05-2023 09:49 PM
like the below C# code, it doesn't work for Custom Device Channel.
var factory = new Factory();
var workspace = factory.GetIWorkspace2(gatewayIP);
workspace.ConnectToSystem(sineWavePath, true, timeout);
workspace.GetMultipleChannelValues(names.ToArray(), out double[] values);
workspace.SetSingleChannelValue(names[1], 300);
workspace.GetSingleChannelValue(names[1], out double newCurrentValue);