GpibSpl Procedure

Performs a Serial Poll of a specified GPIB device.

Syntax

[ lSpl = ] GpibSpl ( lDevice )

The GpibSpl procedure syntax has the following parts:

 

Name

Type

Description

lSpl

Long

Serial Poll byte

lDevice

Val Long

Device address

Comments

This function reads the Serial Poll byte of a device and the byte is assigned to the return value lSpl. Some devices are not capable of responding to a Serial Poll.

Serial Poll is usually the user-programmed response to a device Service ReQuest (SRQ).

The hexadecimal format of lDevice parameter is as follows:

lDevice = 0xBBPPSS

Where:

 

BB

Board address (1 - 9)

PP

Device Primary address (0 - 31) - 0 if not used (bus address), 31 used for Primary address of 0

SS

Device Secondary address (0 - 31) - 0 if not used (bus address or device without Secondary address), 31 used for Secondary address of 0      

The value of lDevice may be obtained using the GetDriverAddress function.

A return value of -1 indicates that an error occurred during execution.

Example

The following example waits until bit # 6 in the Serial Poll byte is 1 (SRQ). Then it receives a string.

lScope=GetDriverAddress("SCOPE")

i=0

While (GpibSpl(lScope) and 64) = 0 and i < 20000

i=i+1

Endwhile

If i < 20000 Then

GpibReceive(lDevice, "\r\n", 1, 150, 0, sData, 20)

Else

print "Scope Error: Timeout"

Endif

See Also

GpibStatus