iusbgetcapabilities

  • Supported sessions: device

C Syntax

#include <sicl.h>
int iusbgetcapabilities (id, capinfo);
INST id;
struct usbcapinfo *capinfo;

Visual Basic Syntax

Function iusbgetcapabilities (ByVal id As Integer, capinfo As usbcapinfo)

Description

The iusbgetcapabilities function returns capabilities information about a USB device. The id is the INST for any open USB device session. The capinfo parameter points to a structure of type struct usbcapinfo. The function fills in the structure with the relevant data. The structure struct usbcapinfo (defined in the file sicl.h) is listed below.

usbcapinfo structure (C Programs)

For C programs, the usbcapinfo structure has the following syntax:

typedef struct {
   /* From USBTMC Specification Table 37 - GET_CAPABILITIES */
   unsigned char  status;
   unsigned char  reserved1;
   unsigned short bcdUSBTMC;
   unsigned char  intfCapabilities;
   unsigned char  devCapabilities;
   unsigned char  reservedTMC[6];
   /* From USBTMC USB488 Subclass Specification Table 8 */
   unsigned short bcdUSB488;
   unsigned char  intf488Capabilities;
   unsigned char  dev488Capabilities;
   unsigned char  reservedSUB[8];
} usbcapinfo;

/* Masks for intfCapabilities */
#define I_USB_INTFCAP_LISTENONLY_MASK 0x1
#define I_USB_INTFCAP_TALKONLY_MASK   0x2
#define I_USB_INTFCAP_IPULSE_MASK     0x4

/* Mask for devCapabilities */
#define I_USB_DEVCAP_BULK_IN_MASK     0x1

/* Masks for intf488Capabilities */
#define I_USB_INTF488CAP_TRIG_MASK    0x1
#define I_USB_INTF488CAP_REN_MASK     0x2
#define I_USB_INTF488CAP_4882_MASK    0x4

/* Mask for dev488Capabilities */
#define I_USB_DEV488CAP_DT1_MASK      0x1
#define I_USB_DEV488CAP_RL1_MASK      0x2
#define I_USB_DEV488CAP_SR1_MASK      0x4
#define I_USB_DEV488CAP_SCPI_MASK     0x8

usbcapinfo structure (Visual Basic Programs)

For Visual Basic programs, the usbcapinfo structure is defined in sicl32.bas as:

Type usbcapinfo
   status As Byte
   reserved1 As Byte
   bcdUSBTMC As Integer
   intfCapabilities As Byte
   devCapabilities As Byte
   reservedTMC(0 To 5) As Byte
   bcdUSB488 As Integer
   intf488Capabilities As Byte
   dev488Capabilities As Byte
   reservedSUB(0 To 7) As Byte
End Type

' Masks for usbcapinfo intfCapabilities
Global Const I_USB_INTFCAP_LISTENONLY_MASK = &H1
Global Const I_USB_INTFCAP_TALKONLY_MASK = &H2
Global Const I_USB_INTFCAP_IPULSE_MASK = &H4

' Mask for usbcapinfo devCapabilities
Global Const I_USB_DEVCAP_BULK_IN_MASK = &H1

' Masks for usbcapinfo intf488Capabilities
Global Const I_USB_INTF488CAP_TRIG_MASK = &H1
Global Const I_USB_INTF488CAP_REN_MASK = &H2
Global Const I_USB_INTF488CAP_4882_MASK = &H4

' Masks for usbcapinfo dev488Capabilities
Global Const I_USB_DEV488CAP_DT1_MASK = &H1
Global Const I_USB_DEV488CAP_RL1_MASK = &H2
Global Const I_USB_DEV488CAP_SR1_MASK = &H4
Global Const I_USB_DEV488CAP_SCPI_MASK = &H8End Type

Return Value

For C programs, this function returns zero (0) if successful or a non-zero error number if an error occurs. For Visual Basic programs, no error number is returned. Instead, the global Err variable is set if an error occurs.

See Also

iusbgetinfo