Discover Packages
github.com/haigecnpeng/pgzz
package
module
Version:
v0.0.0-...-14ff998
Opens a new window with list of versions in this module.
Published: Oct 9, 2021
License: GPL-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
pgzz
golang通过VISA32.dll实现仪表搜索、仪表设置和数据读取(GPIB/TCPIP),在是德科技的USB2GPIB卡测试有效。包含包和使用示例。
Expand ▾
Collapse ▴
Documentation
¶
开发者:海格通信---廖晓鹏
仪表查询与读写示例:
实际仪表操作中,查询与读写已可满足99%的业务需求。
实现方式很多,该示例采用调用VISA32.DLL动态函数库方式实现,应该是目前比较简单易用的实现方案。虽简单,但实际功效应该是一样的。
之前使用C.CString来传递参数(详见visa.go.bak),总感觉不太舒服,后更改为目前的方式。
API说明详见IO Libraries Suite自带文档Visa.chm
查找仪表清单,并打印输出。
有时候刷新到旧的数据,看IO Libraries Suite也是一样的,断开后仍然有上一次的数据,只不过是错的。
关闭了仍然有信息。有可能需要调用viClear(ViSession vi); ----> Clear a device. This operation performs an IEEE 488.1-style clear of the device.
错误代码详见Visa.chm
ret如果不为0,则连接失败,ret为缺陷代码。
打开设备管理器。类似初始化。
发送信息给仪表
addr为仪器地址,m为需要发送的信息,如GPIB0::15::INSTR,send:DISP TX
新建类型,代替C.CString
C.CString使用会产生拷贝,而且内存不会自动释放,需要进行free。
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.