EasyManua.ls Logo

ADCMT 6146 - Page 195

ADCMT 6146
260 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
6146/6156 DC Voltage/Current Generators Operation Manual
5.9.1 Common Sub Procedures for Interface Control
5-47
' USB driver stop sub procedure
Sub aUSBEnd()
Dim lngRet As Long ' USB driver return value
lngRet = ausb_end() ' The USB terminates.
If lngRet <> OK Then ' If the USB terminates incorrectly
MsgBox "USB termination error", vbExclamation
End If
End Sub
' Device (instrument) open and handle acquisition sub procedure
Sub aUSBOpn(lngHdl As Long, lngUSBID As Long)
Dim lngRet As Long ' USB driver return value
lngRet = ausb_open(lngHdl, lngUSBID) ' Opens the device.
If lngRet = OK Then
blnUSBComErr = False ' If OK
Else
blnUSBComErr = True ' If not OK
MsgBox "device open error", vbCritical, "ID:" & lngUSBID
End If
End Sub
' Device (instrument) close sub procedure
Sub aUSBCls(lngHdl As Long)
Dim lngRet As Long ' USB driver return value
lngRet = ausb_close(lngHdl) ' Closes the device.
If lngRet <> OK Then ' If not OK
MsgBox "device close error", vbCritical
End If
End Sub
' USB driver data transmission sub procedure
Sub aUSBWrt(lngHdl As Long, strCmd As String)
Dim lngRet As Long ' USB driver return value
lngRet = ausb_write(lngHdl, strCmd) ' Sends data.
Call mSecSleep(10) ' Waits for USB transmission process
If lngRet = OK Then
blnUSBComErr = False ' If OK
Else
blnUSBComErr = True ' If not OK
MsgBox strCmd, vbCritical, "transmission error"
End If
End Sub

Table of Contents

Related product manuals