是德科技
直播中

王志宏

7年用户 162经验值
私信 关注
[问答]

什么是监控完成操作的好方法?

我们正在使用3458A数字万用表,使用VISA远程编程(C ++)来控制GPIB。
手册指出可以通过发送“TEST”来运行自我文本。
它还指定完成大约需要50秒。
什么是监控完成操作的好方法?
一个编程示例将是方便的.Brian

以上来自于谷歌翻译


     以下为原文

  We're using a 3458A DMM, programmed remotely (C++) using VISA to control through the GPIB. The manual states that self-text can be run by sending "TEST". It also specifies that it takes approximately 50 seconds to complete. What is a good way to monitor the operation for completion? A programming example would be handy.



Brian  

回帖(10)

杨梅

2019-7-9 13:55:59
我的C ++有点生疏,但你需要做的是相当于以前的串行轮询(SPOLL),现在在C ++中执行该命令的命令是viReadSTB。如果你在3458A手册中查找SPOLL你可以看到
如果使用viReadSTB命令,将获得的结果。
我会试着为你举一个例子,但这可能需要一段时间,所以我想我现在会分享这个。
我会尽快发布一个例子。
如果你在签证文件中查找viReadSTB,你可以找到更多。在我的3458A程序中,我通常命名我的vi,Inst_dmm。
我计划命名我将存储结果SPOLL的变量。
因此,我的C ++代码的一小段内容很可能如下所示:short SPOLL; viClear(Inst_dmm);
viPrintf(Inst_dmm, “复位 n”);
viPrintf(Inst_dmm,“结束总是 n”); viPrintf(Inst_dmm,“TEST  n”); //等待45秒,我不记得在C ++中等待你的C ++程序员的正确上下文
ll可能会回想一下如何正确执行此操作(Inst_dmm,& SPOLL);然后检查viReadSTB的结果是否报告3458A的某种IF语句已完成测试。希望这有助于您入门。
你以前用C ++编写过3458A程序吗?

以上来自于谷歌翻译


     以下为原文

  My C++ is a bit rusty, but what you need to do is the equivalent of what used to be a serial poll (SPOLL), the command to do that now in C++ is viReadSTB.

If you look up SPOLL in 3458A manual you can see the results you will get if you use the viReadSTB command.  I'll try to throw an example together for you but that may take awhile so I thought I would share this now.  I'll try and post an example soon.  If you look up the viReadSTB in the visa documentation you can find out a little more.

In my 3458A programs I generally name my vi, Inst_dmm.  I plan on naming the variable that I will store my result SPOLL.  So a small snippet of my C++ code will most likely look like this:

short SPOLL;

viClear(Inst_dmm);
viPrintf(Inst_dmm,"resetn");
viPrintf(Inst_dmm,"end alwaysn");
viPrintf(Inst_dmm,"TESTn");

//wait 45 seconds, I don't remember the correct context to do a wait in C++ if your a C++ programmer you'll probably recall how to do this properly

viReadSTB(Inst_dmm, &SPOLL);

Then some sort of IF statement that checks if the result of the viReadSTB is reporting the 3458A has completed the test.


Hopefully that will help get you started.  Have you ever written a 3458A program in C++ before?
举报

王志宏

2019-7-9 14:09:09
好的,看起来很不错。
看起来你可以使用机顶盒?
查询做类似的事情。这是我工作的第一个3458A程序,但是我已经完成了其他的VISA设备。在C ++中没有标准的“等待”,它总是依赖于实现。
在Windows中,它是:Sleep(t);
// t ==以毫秒为单位的时间感谢信息,Brian

以上来自于谷歌翻译


     以下为原文

  Ok, that looks pretty good. Looks like you can use the STB? query to do something similar.

This is first 3458A program I've worked on, but I have done other VISA devices.

There is no standard "wait" in C++, it's always implementation-dependent. In Windows, it is:

Sleep(t); // t == time in milliseconds


Thanks for the information,

Brian
举报

杨梅

2019-7-9 14:20:03
感谢您的信息.3458A是在SCPI之前开发的STB吗?
不会工作,你必须使用我在上一篇文章中提到的那个命令。

以上来自于谷歌翻译


     以下为原文

  Thanks for the info.

The 3458A was developed pre-SCPI so STB? will not work, you have to use that command I mentioned in the previous post.
举报

王志宏

2019-7-9 14:30:56
哦?
STB?
在手册中,03458-90014:Ch 6 / pg 245.Brian

以上来自于谷歌翻译


     以下为原文

  Oh? STB? is in the manual, 03458-90014: Ch 6 /pg 245.



Brian
举报

更多回帖

发帖
×
20
完善资料,
赚取积分