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

📄 hpibdv.bas

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

'  hpibdv.bas
Sub Main ()
   Dim dvm As Integer
   Dim sw As Integer
   Dim res As Double
   Dim i As Integer
   Dim argcount As Integer

   ' Open the multimete and switch sessions
   dvm = iopen("hpib7,9,3")
   sw = iopen("hpib7,9,14")
   Call itimeout(dvm, 10000)
   Call itimeout(sw, 10000)

   ' Set up trigger
   argcount = ivprintf(sw, "TRIG:SOUR BUS" + Chr$(10)) 

   ' Set up scan list
   argcount = ivprintf(sw, "SCAN (@100:103)" + Chr$(10)) 

   argcount = ivprintf(sw, "INIT" + Chr$(10)) 

   ' Display form1 and print voltage measurements
   form1.Show

   For i = 1 To 4
      ' Take a measurement
      argcount = ivprintf(dvm, "MEAS:VOLT:DC?" + Chr$(10)) 

      ' Read the results
      argcount = ivscanf(dvm, "%lf", res)

      ' Print the results
      form1.Print "Result is " + Format(res)

      ' Trigger to close channel
      argcount = ivprintf(sw, "TRIG" + Chr$(10)) 
   Next i

   ' Close the voltmeter session
   Call iclose(dvm)

   ' Close the switch session
   Call iclose(sw)

   ' Tell SICL to cleanup for this task
   Call siclcleanup

End Sub

⌨️ 快捷键说明

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