EasyManua.ls Logo

Microtest 6377 - Example 1

Default Icon
95 pages
Print Icon
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...
638
6.3.1 Example 1
' **************************************************************
'
' Program 1 : Simple GPIB operation check Version 1.0
'
' Platform : QuickBasic 4.5
'
' Description :
'
' This program will ask the instrument to identify itself.
' It assumes the instrument is called 'WK' in the National
' Instruments configuration.
'
' **************************************************************
' $INCLUDE: 'QBDECL.BAS' ' National Instruments include file.
buf$ = SPACE$(200) ' Buffer for GPIB response.
CLS ' Clear the screen
CALL IBFIND("WK", wk%) ' Look for 'WK'
IF wk% < 0 THEN ' Check that the id was found.
PRINT "Identifier 'WK' not found"
PRINT "Please check your configuration."
END
END IF
CALL IBCLR(wk%) ' Clear the device.
IF IBSTA% < 0 THEN ' Check for a problem.
PRINT "Error clearing instrument"
PRINT "Please check you configuration."
END
END IF
CALL IBWRT(wk%, "*IDN?") ' Request identification.
IF IBSTA% < 0 THEN ' Check for a problem.
PRINT "Error writing to instrument"
PRINT "Please check that the instrument"
PRINT "is powered, set to the correct"
PRINT "GPIB address and the cable is"
PRINT "securely connected."
END
END IF
CALL IBRD(wk%, BUF$) ' Read the response.
IF IBSTA% < 0 THEN ' Check for a problem.
PRINT "Error reading from instrument"
PRINT "Please check the device configuration"
END
END IF
PRINT buf$ ' Display the response.
END ' The end.

Table of Contents

Related product manuals