3 Star 3 Fork 2

RedGuy / PIMTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Z44.cls 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
RedGuy 提交于 2014-08-07 11:49 . first commit
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Z44"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private OpenDone As Boolean '是否已打开仪器2
Dim instrumentHandle As Long
Private Sub Class_Initialize()
OpenDone = False
End Sub
Sub SetFlag(ByVal Val As Boolean)
OpenDone = Val
End Sub
Function OpenFlag() As Boolean
OpenFlag = OpenDone
End Function
'open instrument and close RF
Function OpenZ44() As Boolean
On Error Resume Next
staute = rsnrtz_init("ASRL1::INSTR", 1, 1, instrumentHandle)
If staute <> 0 Then
MsgBox "初始化失败!", vbCritical, "功率计Z44"
OpenDone = False
OpenZ44 = False
Else
OpenDone = True
OpenZ44 = True
rsnrtz_configMeas instrumentHandle, 0, 1, 0, 0
End If
End Function
Function GetVal()
On Error GoTo Err
rsnrtz_actstatMeas instrumentHandle, 0, F, R
GetVal = 10 * Log(Abs(F) * 1000) / Log(10)
Exit Function
Err:
MsgBox "读取失败!请修复NI、配置COM1!", vbCritical, "功率计Z44"
GetVal = False
End Function
Visual Basic
1
https://gitee.com/fangguanlin/PIMTest.git
git@gitee.com:fangguanlin/PIMTest.git
fangguanlin
PIMTest
PIMTest
master

搜索帮助