GpibSPollAll


Function

Performs serial poll to specified addresses.

Format

Ret = GpibSPollAll (  Id, AddrArray, StbArray, SrqArray )

Parameter

Id [ VB.NET: Short ][ C, C++: short ][ C#: short ]

Specifies DevID or EqpID.

Whichever it specifies, operation does not change.

 

AddrArray [ VB.NET: Short() ][ C, C++: short * ][ C#: ref short[] ]

Sets addresses of slave devices to be serial polled by array.

 

0 to 30

Address of slave device

-1

Must be used at last of array

 

StbArray [ VB.NET: Short() ][ C, C++: short * ][ C#: ref short[] ]

Retrieves status byte by array.

 

0 to 255

Status byte

 

SrqArray [ VB.NET: Short() ][ C, C++: short * ][ C#: ref short[] ]

Retrieves whether SRQ line is enabled by array.

 

0

SRQ disabled

Except 0

SRQ enabled

Return Value

Ret [ VB.NET: Integer ][ C, C++: long ][ C#: int ]

 

0

Normality completion

10001

Invalid ID was specified

10002

Driver can not be called

12152

The element of AddrArray is outside the designated range

12162

Pointer to AddrArray is NULL

12163

Pointer to StbArray is NULL

12164

Pointer to SrqArray is NULL

22173

When device is used as master (controller), functions for slave (non-controller) are executed

22192

Terminates by forcible termination key

22194

TimeOut

22195

No connected device (GPIB error)

22197

Being used in other process

Initial Value

None

Remarks

 

Example

Performs serial poll to slave devices whose address are 1 and 2. And outputs address at which SRQ is detected and status byte on normal completion.

C

short AddrArray[15], StbArray[15], SrqArray[15], i, k;

AddrArray[0] = 1;

AddrArray[1] = 2;

AddrArray[2] = -1;

Ret = GpibSPollAll ( Id, AddrArray, StbArray, SrqArray );

if ( Ret == 0 ) {

      i = 0;

      k = 0;

      while ( AddrArray[i] != -1 ) {

             if ( SrqArray [i] != 0 ) {

                    Printf ( "%ld\n", AddrArray[i] );

                    Printf ( "%ld\n", StbArray[i] );

                    k++;

                }

                i++;

        }

        if ( k == 0)

         Printf ( "No SRQ\n" );

         }

}

See Also

GpibSPoll