NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use .NET API to get/set custom device channel value on veristand

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:
MicrosoftTeams-image.png

0 Kudos
Message 1 of 3
(768 Views)

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.

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

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);

0 Kudos
Message 3 of 3
(753 Views)