嗨,我是新来的。
我目前正在准备使用N6700准备C#应用程序。
对于我有N6784模块的通道,我想在当前优先级模式下设置电流限制。
下面我放了部分代码。
设置正电压和负电压看起来工作正常,但我无法设置电流限制。
我还要补充一点,电压prority模式工作正常。
如果有人知道如何在当前优先级模式下设置当前限制,我将很高兴告诉我?
如果您希望我上传整个visual studio项目,请告诉我。
这是我的代码:// Globals Agilent.AgilentN67xx.Interop.AgilentN67xx driver = null;
IAgilentN67xxProtec
tion2 protectionPtr_ch2;
IAgilentN67xxMeasurement measurementPtr_ch2;
IAgilentN67xxOutput5 outputPtr_ch2;
public void Init(){// init driver.Initialize(“GPIB0 :: 7 :: INSTR”;, true,true,“”);
outputPtr_ch2 =(IAgilentN67xxOutput5)driver.Outputs.get_Item(driver.Outputs.get_Name(2));
protectionPtr_ch2 = driver.Protections.get_Item(driver.Protections.get_Name(2));
measurementPtr_ch2 = driver.Measurements.get_Item(driver.Measurements.get_Name(2));
} public void PSU2_SetCurrentPrio(double dCurrent,double dVoltPos,double dVoltNeg){//设置当前优先级outputPtr_ch2.SourceRegulationMode = AgilentN67xxSourceRegulationEnum.AgilentN67xxSourceRegulationCurrent;
outputPtr_ch2.CurrentLimit(dCurrent,dCurrent);
// outputPtr_ch2.NegComplicanceVoltage = dVoltNeg;
outputPtr_ch2.PosComplianceVoltage = dVoltPos;
} public void PSU2_SetVoltagePrio(双dVoltage,双dCurrPos,双dCurrNeg)//看起来效果正常{//设置电压优先级outputPtr_ch2.SourceRegulationMode = AgilentN67xxSourceRegulationEnum.AgilentN67xxSourceRegulationVoltage;
outputPtr_ch2.NegComplianceCurrent = dCurrNeg;
outputPtr_ch2.PosComplianceCurrent = dCurrPos;
outputPtr_ch2.VoltageLevel(dVoltage,dVoltage);
问候,Dawid
以上来自于谷歌翻译
以下为原文
Hi,
I'm new here. I'm currently working on preparing C# application with N6700. For channel where I have N6784 module I'd like to set current limit in the current priority mode. Below I put part of my code. Setting the positive voltage and negative voltage looks that works fine, but I can't set the current limit. I must add also that the voltage prority mode works fine.
If somebody know how to set the current limit in current priority mode I will appreciate to let me know? If you want me to upload the whole visual studio project please let me know too.
Here is my code:
//Globals
Agilent.AgilentN67xx.Interop.AgilentN67xx driver = null;
IAgilentN67xxProtection2 protectionPtr_ch2;
IAgilentN67xxMeasurement measurementPtr_ch2;
IAgilentN67xxOutput5 outputPtr_ch2;
public void Init()
{
//init
driver.Initialize("GPIB0::7::INSTR";, true, true, "");
outputPtr_ch2 = (IAgilentN67xxOutput5)driver.Outputs.get_Item(driver.Outputs.get_Name(2));
protectionPtr_ch2 = driver.Protections.get_Item(driver.Protections.get_Name(2));
measurementPtr_ch2 = driver.Measurements.get_Item(driver.Measurements.get_Name(2));
}
public void PSU2_SetCurrentPrio(double dCurrent, double dVoltPos, double dVoltNeg)
{
//Set Current Priority
outputPtr_ch2.SourceRegulationMode = AgilentN67xxSourceRegulationEnum.AgilentN67xxSourceRegulationCurrent;
outputPtr_ch2.CurrentLimit(dCurrent, dCurrent); // <- I use this to set current limit but it looks that does't work ???
outputPtr_ch2.NegComplicanceVoltage = dVoltNeg;
outputPtr_ch2.PosComplianceVoltage = dVoltPos;
}
public void PSU2_SetVoltagePrio(double dVoltage, double dCurrPos, double dCurrNeg) // That one looks that works fine
{
//Set Voltage Priority
outputPtr_ch2.SourceRegulationMode = AgilentN67xxSourceRegulationEnum.AgilentN67xxSourceRegulationVoltage;
outputPtr_ch2.NegComplianceCurrent = dCurrNeg;
outputPtr_ch2.PosComplianceCurrent = dCurrPos;
outputPtr_ch2.VoltageLevel(dVoltage, dVoltage);
}
Regards,
Dawid