⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locking.bas

📁 HP GPIB的VB和C语言库文件,参考范例.
💻 BAS
字号:

'  locking.bas
Sub Main ()
   Dim dvm As Integer
   Dim strres As String * 20
   Dim actual As Long

'  Install an error handler
   On Error GoTo ErrorHandler

'  Open the multimeter session
   dvm = iopen("hpib7,16")
   Call itimeout(dvm, 10000)

'  Lock the multimeter device to prevent access from other applications
   Call ilock(dvm)

'  Take a measurement
   Call iwrite(dvm, "MEAS:VOLT:DC?" + Chr$(10), 14, 1, 0&)

'  Read the results
   Call iread(dvm, strres, 20, 0&, actual)

'  Release the multimeter device for use by others
   Call iunlock(dvm)

'  Display the results
   MsgBox "Result is " + Left$(strres, actual)

'  Close the multimeter session
   Call iclose(dvm)

'  Tell SICL to cleanup for this task
   Call siclcleanup

   End

ErrorHandler:
   '  Display the error message.
      MsgBox "*** Error : " + Error$
   '  Tell SICL to cleanup for this task
      Call siclcleanup

   End

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -