ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ .NET CreateVoltageChannel CustomScaleName

Solved!
Go to solution

I am developing DAQ using. NET (C #). I want to read the voltage data of DAQ device, get the result through linear conversion, and then store it into Tdms file (note: store it after linear conversion).
I saw the official case, but did not provide the case related to Linear Conversion. I learned that there is a string parameter CustomScaleName in myTask. AIChannels. CreateVoltageChannel(), but I cannot understand how to define linear conversion and use this linear conversion.
Who can provide relevant cases.
thank you.

0 Kudos
Message 1 of 3
(2,153 Views)

See if this article helps - https://www.ni.com/en-us/support/documentation/supplemental/18/ni-daqmx-custom-scales-and-usage-expl...

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
0 Kudos
Message 2 of 3
(2,135 Views)
Solution
Accepted by topic author TyroneChong

Although they are written for LabVIEW:

Create an NI-DAQ™mx Custom Scale Programmatically in LabVIEW

Create Multiple Scales for One Task Using LabVIEW with DAQmx

 

In C#, you could possibly do:

// Create a linear scale

myScale = new LinearScale(name="myScale", slope=10, yIntercept=5);

 

// Create a new task
myTask = new Task();

 

// Create a virtual channel

myTask.AIChannels.CreateVoltageChannel(physicalChannelName="Dev1/ai0",
nameToAssignChannel="", terminalConfiguration=-1, minimumValue=-10, maximumValue=10, customScaleName="myScale");

https://github.com/ZhiYang-Ong
Message 3 of 3
(2,117 Views)