嗨!几年前我为53132A计数器制作了一个DLL。
有了这个DLL,53132A计数器,NI GPIB和40mSec的门控时间,我们可以在~60mSec内进行单频测量。我们使用水晶音叉生产中的机器上的计数器,速度可靠性是绝对必须的!
星期一我得到了第一个53210A计数器,我无法让它工作:-(似乎无法构建完整的编程字符串并将此字符串发送到计数器。所以我尝试了以下编程序列:MC_METHOD_IMP
THP53210A ::复位(){BOOL解析度= FALSE;尝试{解析度= mGpib-> DeviceClear(mDevice);如果(RES)解析度= mGpib->发送(mDevice,“* RST; * CLS; * SRE 0; * ESE
0;:STAT:PRES“); if(!res)gError-> DoSetError(ErrorStr()。c_str(),”Counter :: Reset“); res = mGpib-> Local(mDevice); CloseGpib();}
catch(...){return false;} return res;} OpenGpib(); mGpib-> Send(mDevice,“CALC:STATE OFF”); mGpib-> Send(mDevice,“CONF:FREQ 3.276800e + 004,
DEF“); //取决于用户参数mGpib->发送(mDevice,”INP:PROB 1; IMP 50; COUP AC; FILT:LPASS:STATE OFF“); // depe
nds on user set
tingmGpib-> Send(mDevice,“SENSE:FREQ:GATE:POL POS; TIME 4.000e-002”);
//取决于用户settingmGpib-> Send(mDevice,“SENS:ROSC:SOUR INT”);
//取决于用户settingmGpib-> Send(mDevice,“FORM:DATA ASCii”); mGpib-> Send(mDevice,“DISP:WIND:STAT ON”);
//取决于用户设置mGpib->发送(mDevice,“TRIG:SOUR BUS”);
// automatic:BUS,manual:IMMmGpib-> Send(mDevice,“* SRE 16; * ESE 0; * OPC”);
//自动:“* SRE 16; * ESE 0; * OPC”,手册:“* SRE 0; * ESE 0; * OPC”此代码后计数器报告没有错误。有时重置功能无法重置
计数器。
我必须关闭和打开计数器(这是不可接受的)。似乎命令必须严格按顺序排列.ex。
如果我在“CALC:STATE OFF”之后发送“TRIG:SOUR BUS”命令然后问题“TRIG:SOUR?”
在上面的代码返回“IMM”之后。我首先尝试使用GPIB GET命令(ibtrg)触发测量 - >“触发忽略”。然后我做了“INIT; * TRG; FETC?”
然后我可以做一个测量。
但它太慢而且无法使用。因为我无法相信安捷伦生产的计数器无法使用,我必须做一些完全错误的事情。可以请某人或其他人帮助我让这件事情起作用吗?最好的问候沃尔特
以上来自于谷歌翻译
以下为原文
Hi!
Some years ago I made a DLL for the 53132A Counter. With this DLL, the 53132A Counter, the NI GPIB and a gate time of 40mSec we can make a single frequency measurement within ~60mSec.
We use the counters on the machines in our crystal tuning fork production, speed an reliability are a absolute must!
On Monday I got the first 53210A Counter and I'm not able to get it to work :-(
It seems not possible to build up the complete programming string and send this string to the counter.
So I tried the following programming sequence:
MC_METHOD_IMP THP53210A::Reset ()
{
bool res = false;
try
{
res = mGpib->DeviceClear (mDevice);
if (res)
res = mGpib->Send (mDevice, "*RST;*CLS;*SRE 0;*ESE 0;:STAT:PRES");
if (!res)
gError->DoSetError (ErrorStr().c_str(), "Counter::Reset");
res = mGpib->Local (mDevice);
CloseGpib ();
}
catch (...)
{
return false;
}
return res;
}
OpenGpib ();
mGpib->Send (mDevice, "CALC:STATE OFF");
mGpib->Send (mDevice, "CONF:FREQ 3.276800e+004,DEF"); // depends on user parameter
mGpib->Send (mDevice, "INP:PROB 1;IMP 50;COUP AC;FILT:LPASS:STATE OFF"); // depends on user setting
mGpib->Send (mDevice, "SENSE:FREQ:GATE:POL POS;TIME 4.000e-002"); // depends on user setting
mGpib->Send (mDevice, "SENS:ROSC:SOUR INT"); // depends on user setting
mGpib->Send (mDevice, "FORM:DATA ASCii");
mGpib->Send (mDevice, "DISP:WIND:STAT ON"); // depends on user setting
mGpib->Send (mDevice, "TRIG:SOUR BUS"); // automatic: BUS, manual: IMM
mGpib->Send (mDevice, "*SRE 16;*ESE 0;*OPC"); // automatic: "*SRE 16;*ESE 0;*OPC", manual: "*SRE 0;*ESE 0;*OPC"
The counter reports no error after this code.
Sometimes the Reset Function is not able to reset the counter. I have to switch off and on the counter (that is NOT acceptable).
It seems that the commands must be in a strict order.
ex. If I send the "TRIG:SOUR BUS" command after "CALC:STATE OFF" then the question "TRIG:SOUR?" after the above code returns "IMM".
My first try to trigger a measurement was with the GPIB GET command (ibtrg) -> "trigger ignored".
Then I did "INIT;*TRG;FETC?" then I could make a measurement. But it's so slow that it's unusable.
Since I can not believe that Agilent produces a Counter which is unusable, I must do something completly wrong.
Can please somebody or other help me to get this thing to work?
Best regards
Walter
0