Python GPIB 命令
我已经安装并运行了一个可用的 GPIB 接口和 Linux-GPIB 软件包。
我目前只知道两个命令,x.write 和 x.find。我对Python了解不多,但我认识点运算符,并意识到导入gpib后,我应该可以使用一些函数。
我无法找到 GPIB 功能列表。
I have a working GPIB interface and Linux-GPIB package installed and working.
I only know two commands at the moment, x.write and x.find. I don't know much about Python, but I recognize the dot operator and realize that after importing gpib, I should get some functions at my disposal.
I have not been able to locate the list of GPIB functions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它们位于
gpib
库中。您可以像这样引用它们:gpib.foo()
。将此行添加到您的代码中:
并浏览函数/类。
They are in the
gpib
library. You reference them like so:gpib.foo()
.Add this line into your code:
And browse through the functions/classes.
如果您使用 Python 工作,我认为
pyvisa
就是您正在寻找的。它提供了许多有用的高级功能,可以帮助您向您的设备发送一系列 SCPI 命令通过GPIB,如write
、read
、ask
等。至于 SCPI 命令本身,通常不同供应商的命令会有所不同。因此,对于应该向设备发送什么样的SCPI,您应该阅读相应的数据表。但在其他情况下,您可以安装供应商提供的驱动程序。在这种情况下,您可以发送一些更高的命令。例如,如果您想控制电压源,他们可能已经获得了函数
setVoltage(双电压)
。事情对你来说会容易得多。If you are working in Python, I think the
pyvisa
is what you are looking for. It provides lots of useful high level functions which helps you to send a series of SCPI commands to your equipment via GPIB, such aswrite
,read
,ask
and so on.As for SCPI commands themselves, usually they will differ from the different vendors. So in terms of what kind of SCPI you should send to the equipment, you should read the corresponding datasheet. But in the other case, you could have installed the drivers which were provided by the vendor. In this case you can send some even higher commands. For instance, if you would like to control a voltage source, they have probably already got the function
setvoltage(double voltage)
. Things will be much more easier for you.实际上有很多命令可用。除了你提到的这两个之外,还有
x.read
、x.ask
、x.ask_for_value
等等。但我建议您阅读那些
帮助文件
,我认为这会让您更好地理解。Actually there are many commands available. Except those two you mentioned, there are
x.read
,x.ask
,x.ask_for_value
and so on.But I recommend your to read those
help file
, I think that will give you a better understanding.