This is fairly simple to do using the Virtual Channel Wizzard.
You can setup your virtual channel in MAX to have multiple analog inputs and different scales. This is done by selecting "Data Neighborhood" and clicking the "Create New..." button. Follow the menus and setup your channels. When you are done, click the "Save" button.
In Visual Studio, open your solution. From the menu, go to File >> Add New Item... In the box that pops, look in the "Measurement Studio" folder and select "DAQmx Task"
Here you can either select the task you created or make a new one (if you choose to make a new one you will be directed through the exact same steps you did in MAX). The task will be added to your solution. It will probably be called something lik
e "DAQmxTask1.mxb" Select that file in the solution explorer, right click and choose "View Code." This is the autogenerated code that will configure your task.
I tried it out with a two-channel aquisition with different scales. Here is the code it generated:
public class DAQmxTask1 : Task
{
public DAQmxTask1() :
base("DAQmxTask1")
{
this.Configure();
}
public virtual void Configure()
{
this.AIChannels.CreateVoltageChannel("Dev1/ai1", "Voltage", AITerminalConfiguration.Differential, -5, 5, "MyScale0");
this.AIChannels.CreateVoltageChannel("Dev1/ai2", "Voltage0", AITerminalConfiguration.Differential, -5, 5, "MyScale2");
this.Timing.ConfigureSampleClock("", 1000, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 100);
}
-Salvador Santolucito