nonfmt.bas

来自「HP GPIB的VB和C语言库文件,参考范例.」· BAS 代码 · 共 38 行

BAS
38
字号
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'  nonfmt.bas
'  The following subroutine measures AC voltage on a  
'  multimeter and prints out the results.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Main ()
   Dim dvm As Integer
   Dim strres As String * 20
   Dim actual As Long

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

'  Initialize dvm
   Call iwrite(dvm, "*RST" + Chr$(10), 5, 1, 0&)

'  Set up multimeter and take measurements
   Call iwrite(dvm, "CALC:DBM:REF 50" + Chr$(10),16,1, 0&)
   Call iwrite(dvm, "MEAS:VOLT:AC? 1, 0.001" + Chr$(10),23,1, 0&)

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

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

'  Close the multimeter session
   Call iclose(dvm)

'  Tell SICL to cleanup for this task
   Call siclcleanup

   Exit Sub

End Sub

⌨️ 快捷键说明

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