Chapter 6 RAPID!
Functions
WCDMA Options Version 6.20
195
FREEFILE
INKEY
Example
The following example labels the softkeys, opens several
communication ports and then waits 5 seconds for an
event to occur.
Depending on the device or task creating the event, event
handling will take place.
SOFTKEYS "OK",,,,,,"EXIT"
OPEN "GPIB0:..." AS #1
scpi = FREEFILE
OPEN "SCPI:" AS #scpi
DO
SELECT CASE EVENTWAIT(5000)
CASE –1: PRINT "Time out"
CASE 0
IF INKEY = 7 THEN END
PRINT "Softkey ‘OK’ was pushed."
CASE 1
INPUT #1, gpib$
PRINT "Received on GPIB:",
gpib$,EVENTSTATUS
CASE SCPI
INPUT #scpi, scpi$
PRINT "Received from SCPI:", scpi$
CASE ELSE
PRINT "Any other event occurred!"
END SELECT
LOOP
Syntax
FREEFILE
Parameters
There are no parameters.
Description
Returns the subsequent available file handle as a positive
integer.
The returned file handle may then be used by an OPEN
(on files) command.
FREEFILE helps to avoid conflicts with file handles.
Example
This example writes a string to a text file.
LET File=FREEFILE
OPEN "STRINGS.TXT" FOR OUTPUT AS
#File
PRINT #File, "Save me"
CLOSE #File
Syntax
INKEY
Parameters
There are no parameters.