03-28-2007 12:42 PM
03-30-2007 10:44 AM
Hi,
Thank you for posting to the NI forums. To create a custom scale using the .NET framework, I would recommend referring to the NI-DAQmx .NET Framework 2.0 Help. Here you will find the documentation on creating a custom scale using the Scale class.
In the Contents section, navigate to:
NI Measurement Studio .NET Class Library >>
Reference >>
NationalInstruments.DAQmx >>
Scale Class
After going through this documentation, please feel free to post back with any further questions. Thanks!
Ed W.
Applications Engineer
National Instruments
04-30-2007 05:14 PM - edited 04-30-2007 05:14 PM
I am also trying to use a custom scale in VB.Net, I have looked at the help file that you recommended but I cannot seem to find an example allowing me to load a custom scale when I create the task. Could you please provide a brief example of how to do this?
Thanks,
Charles
Message Edited by Charles_Chickering on 04-30-2007 05:16 PM
05-02-2007 05:32 PM
Hi Charles,
You can specify a scale that you created in MAX by using the overloaded function CreateVoltageChannel, and supplying the name of the scale (as a string) as the last parameter, as follows.
//Create a virtual channel
myTask.AIChannels.CreateVoltageChannel(
physicalChannelComboBox.Text,
"",
(AITerminalConfiguration)(-1), Convert.ToDouble(minimumValueNumeric.Value),
Convert.ToDouble(maximumValueNumeric.Value),
"MyScale_0");
On the other hand, you could programmatically create a scale and, again, supply the scale’s name to the CreateVoltageChannel function.
myScale = new LinearScale("MyLinearScale", 5.0, 0.0);
Besides creating a linear scale, you can also create a polynomial, range map, or table scales. This is all documented in the NI-DAQmx .NET Framework 2.0 Help.
Best regards,
Ed W.
Applications Engineer
National Instruments
10-08-2013 07:13 AM
Ed,
Lets take this one step further. If I have a custom scale, must it apply to all channels I am using? What would the code look like to use one scale for channel 0 and a different scale for channel3?
10-09-2013 06:10 PM
Hello tpVBuser,
This forum thread is over 6 years old. I would suggest that you create a new thread, which will be looked at by more people, and will get you a quicker answer. I do not know the exact code to do what you are asking, but I know it is possible to make custom scales for each channel, similarly to how you would using the NI-DAQmx drivers.