137
of 148
CASE ELSE
AbfrageSRQ = 0
‘Continue waiting for SRQ
END
SELECT
END FUNCTION
FUNCTION CmdEmpfangen (id2329%, antwort$)
‘****************************************************************************************************************************************
‘Receive response from 2329
‘****************************************************************************************************************************************
DIM
help$(100)
CALL IBRD(id2329%, antwort$)
‘Fetch string from IEC-BUS
IF (IBSTA% AND EERR) THEN
CALL gpiberr("ibrd Error")
antwort$ = " "
CmdEmpfangen = 0
‘An error has occurred
ELSE
L = LEN(antwort$)
help$ = MID$(antwort$, 1, L - 1)
‘Discard LF character
antwort$ = help$
CmdEmpfangen = 1
‘Everything OK
END
IF
END FUNCTION
FUNCTION CmdSenden (id2329%, CMD$)
‘****************************************************************************************************************************************
‘Send command to 2329
‘****************************************************************************************************************************************
DIM
msg$(100)
REM LF$ = CHR$(10)
msg$ = CMD$ + CHR$(10)
‘Formulate command
CALL IBWRT(id2329%, msg$)
‘Send command via IEC bus
IF (IBSTA% AND EERR) THEN
CALL gpiberr("ibwrt Error")
CmdSenden = 0
‘Error during transmission
ELSE
CmdSenden = 1
‘Transmission OK
END
IF
END FUNCTION
REM DEFDBL A-Z
SUB gpiberr (msg$) STATIC
‘This function is taken from the Basic example accompanying the National Instruments card
‘================================================================================
Subroutine
GPIBERR
‘This subroutine will notify you that a NI-488 function failed by printing
‘an error message. The status variable IBSTA% will also be printed
‘in hexadecimal along with the mnemonic meaning of the bit position.
‘The status variable IBERR% will be printed in decimal along with the
‘mnemonic meaning of the decimal value. The status variable IBCNT% will
‘be printed in decimal.
‘The NI-488 function IBONL is called to disable the hardware and software.
‘
‘The STOP command will terminate this program.
‘================================================================================