12-09-2013 11:25 PM - edited 12-09-2013 11:28 PM
Hi,
I am using NI 9236 card with 3.3V for loadcell.I am having 5 load cells of 10N,20N,50N,200N,1000N. I want to create AI virtual channel with excitation voltage. Below is my code which is giving error at line AITaskForLoadCell.Control(TaskAction.Verify); error -200077 msg=Requested value is not supported value for this property. The property value may be invalid because it conflicts with another property.
public bool CreateAIChannelLoadCell()
{
try
{
//Create a task
AITaskForLoadCell = new Task();
//Find out the Analog Input Channels
if (DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.All, PhysicalChannelAccess.External).Length > 0)
{
ArrayList AIArrChannelsLoadCell;
AIArrChannelsLoadCell = new ArrayList();
AIArrChannelsLoadCell.AddRange(DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.AI, PhysicalChannelAccess.External));
//Create custom scale for each LoadCell
//for 1000N having sensitivity 2.00050 mV/V
customScale_1000 = new RangeMapScale(customScaleName_1000, -0.00200050, 0.00200050, -1000, 1000);
//for 200N having sensitivity 1.99780 mV/V
customScale_200 = new RangeMapScale(customScaleName_200, -0.00199780, 0.00199780, -200, 200);
//for 50N having sensitivity 2.00217 mV/V
customScale_50 = new RangeMapScale(customScaleName_50, -0.00200217, 0.00200217, -50, 50);
//for 20N having sensitivity 1.997780 mV/V
customScale_20 = new RangeMapScale(customScaleName_20, -0.00199778, 0.00199778, -20, 20);
//for 10N having sensitivity 1.99785 mV/V
customScale_10 = new RangeMapScale(customScaleName_10, -0.00199785, 0.00199785, -10, 10);
AIBridgeConfiguration bridgeConfiguration = AIBridgeConfiguration.QuarterBridge;
AIExcitationSource excitationSource = AIExcitationSource.Internal;
//
//Create Analog Input Channels for LoadCell
AIChannel LoadcellChannel5 = AITaskForLoadCell.AIChannels.CreateVoltageChannelWithExcitation(AIArrChannelsLoadCell[0].ToString(), "channel1", AITerminalConfiguration.Differential, -0.01513, 6.551721, bridgeConfiguration, excitationSource, 3.3, false,customScale_10.Name);
AIChannel LoadcellChannel4 = AITaskForLoadCell.AIChannels.CreateVoltageChannelWithExcitation(AIArrChannelsLoadCell[1].ToString(), "channel2", AITerminalConfiguration.Differential, 0.00648, 6.614124, bridgeConfiguration, excitationSource, 3.3, false, customScale_20.Name);
AIChannel LoadcellChannel3 = AITaskForLoadCell.AIChannels.CreateVoltageChannelWithExcitation(AIArrChannelsLoadCell[2].ToString(), "channel3", AITerminalConfiguration.Differential, -0.01311, 6.563898, bridgeConfiguration, excitationSource, 3.3, false, customScale_50.Name);
AIChannel LoadcellChannel1 = AITaskForLoadCell.AIChannels.CreateVoltageChannelWithExcitation(AIArrChannelsLoadCell[3].ToString(), "channel4", AITerminalConfiguration.Differential, -0.01163, 6.554526, bridgeConfiguration, excitationSource, 3.3, false, customScale_1000.Name);
AIChannel LoadcellChannel2 = AITaskForLoadCell.AIChannels.CreateVoltageChannelWithExcitation(AIArrChannelsLoadCell[4].ToString(), "channel5", AITerminalConfiguration.Differential, -0.02233, 5.867086, bridgeConfiguration, excitationSource, 3.3, false, customScale_200.Name);
//Verify the Task
AITaskForLoadCell.Control(TaskAction.Verify);
LoadcellChannel1.PerformBridgeOffsetNullingCalibration();
LoadcellChannel2.PerformBridgeOffsetNullingCalibration();
LoadcellChannel3.PerformBridgeOffsetNullingCalibration();
LoadcellChannel4.PerformBridgeOffsetNullingCalibration();
LoadcellChannel5.PerformBridgeOffsetNullingCalibration();
AIMultichnanelReaderforLoadCell = new AnalogMultiChannelReader(AITaskForLoadCell.Stream);
//AITask.AIChannels.All.AveragingWindowSize = 50;
IsConnected = true;
}
}
catch (DaqException exception)
{
StopTask();
}
return IsConnected;
}
12-10-2013 12:56 AM - edited 12-10-2013 12:58 AM
The feedback forum is wrong for this kind of questions. Maybe one of the hardware or CVI forums.
(sorry, I am not familiar with your device)