USB488 Protocol Stack API Specifications


Revision History
Date        Contents
2003/07/29  1. An explanation about [Possible error] was added to "void Usb
               Finalize (void)" in Section 3, "Initialization and Protocol Stack 
               Management APIs."
@@@@@@2. An explanation about [Return value] was added to DWORD UsbReceiveTextData 
               (USBHANDLE hDev, LPSTR pBuf, DWORD dwCount) in 5.3, "Receive Commands."
@@@@@@3. A message format of "Common Commands" in Section 8, Device Dependent 
               Messages" was corrected.


1. Outline
@The USB488 provides an instrumentation control application with application programming 
  interfaces (APIs) for controlling devices of the USB488 specifications easily by using 
  USB488 device drivers. The USB488 device drivers are for controlling USB devices on a 
  general-purpose personal computer.


2. Protocol Stack Configuration
@The USB488 protocol stack consists of initialization and protocol stack APIs, class 
  request APIs, bulk transfer APIs, service request APIs, class requests, and device 
  dependent messages.

@The initialization and protocol stack management APIs are as follows:
    UsbInitialize     Creates a device map of USB488 equipment.
    UsbFinalize       Discards a device map of USB488 equipment.
    UsbGetDeviceList  Acquires a device list from a device map.
    UsbOpenDevice     Prepares a communication channel and returns the USB488 device handle.
    UsbCloseDevice    Closes the communication channel.
    UsbGetStatus      Returns the protocol stack status.
    UsbGetErrorCode   Returns the last error code.
    UsbGetDataCount   Returns the number of bytes at the last I/O stage.
    UsbSetTimeout     Sets a timeout limit for API other than UsbOPCQuery.
    UsbGetTimeout     Acquires a timeout limit for API other than UsbOPCQuery.

@The class request APIs are as follows:
    UsbControlOUT        Executes control-out transfer.
    UsbControlIN         Executes control-in transfer.
    UsbSetIFC            Clears an interface.
    UsbDevClear          Clears a specified device.
    UsbEnableRemote      Sets a specified device to the remote state.
    UsbEnableLocal       Sets a specified device to the local state.
    UsbSendLLO           Sets a specified device to the local lockout state.
    UsbGetRemoteStatus   Acquires the remote or local state.
    UsbTrigger           Issues a trigger to a USB488 device.
    UsbGetTriggerStatus  Acquires the trigger status.
    UsbSendIOCTL         Sends data as an interface message.
    UsbClearStatusByte   Clears the SRQ and TRIG bits of a USB488 device.
    UsbSet488ID          Sets a 488ID.
    UsbGet488ID          Acquires a 488ID.
    UsbGetCapacity       Acquires function information from the USB488 device side.

@The bulk transfer APIs are as follows:
@@Common Commands
    UsbCLS             Clears the status byte and its related queues excluding an output 
                       one.
    UsbSESE            Writes a value to the standard event status enable register.
    UsbSESEQuery       Reads the value from the standard event status enable register.
    UsbSESRQuery       Reads the value from and clears the standard event status register.
    UsbIDNQuery        Inquires of an equipment ID.
    UsbOPC             When the current operation is finished, sets the LSB of the standard 
                       event status register.
    UsbOPCQuery        Inquires of the end of the current operation.
    UsbReset           Initializes the equipment.
    UsbSRE             Writes a value to the service request enable register.
    UsbSREQuery        Reads the value from the service request enable register.
    UsbSTBQuery        Reads the status byte and the MSS bit.
    UsbSelfTestQuery   Inquires of self-test results.
    UsbWait            Executes the command after UsbWait when the current operation is 
                       finished.

@@Send Commands
    UsbSend                  Sends a message to a device by bulk transfer.
    UsbSendBinaryWithCnt     Sends binary data to a device in a format with transfer data 
                             count.
    UsbSendBinary            Sends binary data to a device in a format with no transfer 
                             data count.
    UsbSendBinaryWithHeader  Sends binary data to a device in a format with no transfer 
                             data count but with ASCII header.
    UsbSendBinaryData        Sends binary data to a device.
    UsbSendTextData          Sends text data to a device.


@@Receive Commands
    UsbReceive               Receives a message from a device by bulk transfer.
    UsbReceiveBinaryData     Receives binary data from a device.
    UsbReceiveTextData       Receives text data from a device.

@The service request APIs are as follows:
    void UsbSetSrqRoutine    Specifies a callback function.

@The class requests are as follows:
    Clear Interface          Sets interface clearance.
    Clear Device             Sets device clearance.
    Set Remote/Local         Sets the panel lock.
    Get Remote/Local         Sets the panel lock status.
    Execute Trigger          Sets the group execution trigger.
    Get Trigger Status       Acquires information about completion of the trigger command.
    Set IOCTL                (Reserved)
    Clear SRQ Status         Clears the RQS and TRIG bits of the status byte.
    Set 488ID (Address)      Sets a 488ID set on the measuring instrument side.
    Get 488ID (Address)      Acquires a 488ID set on the measuring instrument side.
    Get Capacity             Acquires function information from the measuring instrument 
                             side.

@The device dependent messages are as follows:
    *CLS   Clears the status byte and its related queues excluding an output one.
    *ESE   Sets the standard event status enable register.
    *ESE?  Reads the value from the standard event status enable register.
    *ESR?  Reads the value from the standard event status register.
    *IDN?  Reads an equipment ID.
    *OPC   Sets the OPC bit of the standard event status register to 1 after the current 
           overlapping command is finished.
    *OPC?  Returns binary 1 after the current overlapping command is finished.
    *RST   Initializes the settings of an electronic measuring instrument. 
    *SRE   Sets the SRE register.
    *SRE?  Reads the value from the SRE register.
    *STB?  Reads the value from the status byte register.
    *TST?  Reads the results of self tests done in advance.
    *WAI   Stops command interpretation until the current overlapping command is finished.


3. Initialization and Protocol Stack Management APIs

Evoid UsbInitialize (void)
@[Explanation] Searching USB488 equipment and creating their device map in the protocol 
                stack
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EDVR: System error
@@USB488_ENOL: Specified device not existing

Evoid UsbFinalize (void)
@[Explanation] Discarding a device map pf USB488 equipment
@@The protocol has a mechanism of finalization as necessary when DLL is released.
@[Possible error]
@@USB488_EINI: UsbInitialize not executed yet
@@@@@@@@This error is not caused by UsbFinalize but by an API call in the 
                UsbFinalize state.

Eint UsbGetDeviceList (int iNth, WORD *pBuffer, int pSize)
@[Explanation] Writing the iNth and later 488IDs from a device map into 
the pBuffer up to pSize and returning the number of written 488IDs
@[Return value] Number of 488IDs written
@[Arguments]
@@int iNth: Specify the device map start index (0 or more) to get 488IDs.
@@WORD *pBuffer: Specify the first pointer of word array where to store 488IDs.
@@int pSize: Specify the pBuffer size.
@[Possible error]
@@USB488_EINI: UsbInitialize not executed yet

EUSBHANDLE UsbOpenDevice (WORD w488ID)
@[Explanation] Preparing a communication channel and returning a USB488 device handle
@[Return value] USB488 device handle
@[Argument]
@@WORD w488ID: Specifying 488ID to get a USB488 device handle
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_ENOL: Specified device not existing

Evoid UsbCloseDevice (USBHANDLE hDev)
@[Explanation] Closing the communication channel
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open

EWORD UsbGetStatus (void)
@[Explanation] Returning the protocol stack status
@@The protocol stack status is allocated to bits and the application installer can get 
    several states simultaneously. The protocol stack status configuration is as follows:

@@@Mnemonic      Bit     Meaning
      USB488_EERR   15      System error
      USB488_TIMO   14      Over time limit
      USB488_SRQI   12      Service request from device

@[Return value] Protocol stack status
@[Possible error]
@@USB488_EINI: UsbInitialize not executed yet

EWORD UsbGetErrorCode (void)
@[Explanation] Returning the last error code
@@The error code configuration is as follows:

      Mnemonic       No.  Meaning
      USB488_ENON     0   Normal termination
      USB488_EDVR     1   System error
      USB488_ENOL     3   Specified device not existing
      USB488_EARG     5   Argument not appropriate
      USB488_EABO     7   I/O operation aborted (timeout)
      USB488_ETAB    21   Table problem
      USB488_EINI   128   UsbInitialize not executed yet
      USB488_ECOM   129   Communication error other than timeout
      USB488_ECOL   130   Duplicate USB488ID
      USB488_EDAT   131   Data communication error
      USB488_ESND   132   Bulk-out error
      USB488_ERCV   133   Bulk-in error
      USB488_EOPN   134   Device not open
      USB488_EHDL   135   USB488 handle not valid

@[Return value] Error code
@[Possible error]
@@USB488_EINI: UsbInitialize not executed yet

Elong UsbGetDataCount (void)
@[Explanation] Returning the byte count at the stage where data was input or output last
@[Return value] Byte count at the I/O data stage
@[Possible error]
@@USB488_EINI: UsbInitialize not executed yet

Evoid UsbSetTimeout (USBHANDLE hDev, int iTime)
@[Explanation] Setting a timeout limit for API other than UsbOPCQuery
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@int iTime: Timeout limit (Unit: ms)
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open

Eint UsbGetTimeout (USBHANDLE hDev)
@[Explanation] Acquiring a timeout limit for API other than UsbOPCQuery
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open


4. Class Request APIs

EBOOL UsbControlOUT (USBHANDLE hDev, UCHAR bmRequestType, UCHAR bRequest,
    USHORT wValue, USHORT wIndex, USHORT wLength, void* pDataStage)
@[Explanation] Executing control-out transfer
@@For details about the arguments, see 7, "Class Requests."
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@UCHAR bmRequestType: Specify the bmRequestType field.
@@UCHAR bRequest: Specify the bRequest field.
@@USHORT wValue: Specify the wValue field.
@@USHORT wIndex: Specify the wIndex field.
@@USHORT wLength: Specify the wLength field.
@@void* pDataStage: Specifying data to send at the data stage
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

EBOOL UsbControlIN(USBHANDLE hDev, UCHAR bmRequestType, UCHAR bRequest,
    USHORT wValue, USHORT wIndex, USHORT wLength, void* pDataStage)
@[Explanation] Making control-in transfer
@@For details about the arguments, see 7, "Class Requests."
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@UCHAR bmRequestType: Specify the bmRequestType field.
@@UCHAR bRequest: Specify the bRequest field.
@@USHORT wValue: Specify the wValue field.
@@USHORT wIndex: Specify the wIndex field.
@@USHORT wLength: Specify the wLength field.
@@void* pDataStage: Specify an area where to store data acquired at the data stage.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSetIFC(USBHANDLE hDev)
@[Explanation] Clearing intefaces
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbDevClear (USBHANDLE hDev, USHORT wValue)
@[Explanation] Clearing a specified device
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@@USHORT wValue: Specify the wValue field.
@@@The wValue field has the following configuration:

        Bit      Function
        15 - 3   Reserved
         2       Clear send buffer FIFO
         1       Clear receiver buffer FIFO
         0       Clear the interpretations of the *OPC, *OPC?, and *WAI commands

@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbEnableRemote (USBHANDLE *pDevList)
@[Explanation] Setting a specified device to the remote state
@[Argument]
@@USBHANDLE *pDevList: Device handle list terminated with NULL
@[Possible errors]
@@USB488_EARG: Argument not appropriate
@@USB488_ETAB: Table problem
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbEnableLocal (USBHANDLE *pDevList)
@[Explanation] Setting a specified device to the local state
@[Argument]
@@USBHANDLE *pDevList: Device handle list terminated with NULL
@[Possible errors]
@@USB488_EARG: Argument not appropriate
@@USB488_ETAB: Table problem
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error



Evoid UsbSendLLO(USBHANDLE *pDevList)
@[Explanation] Setting a specified device to the local lockout state
@[Argument]
@@USBHANDLE *pDevList: Device handle list terminated with NULL 
@[Possible errors]
@@USB488_EARG: Argument not appropriate
@@USB488_ETAB: Table problem
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbGetRemoteStatus(USBHANDLE hDev, BYTE *pStatus)
@[Explanation] Acquiring the remote/local state
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@BYTE *pStatus: Specify an area where to store the acquired remote/local state 
                   (bit 0: LOCAL, bit 1: REMOTE, bit 2: LOCK).
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbTrigger (USBHANDLE hDev)
@[Explanation] Issuing a trigger to a USB488 device
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbGetTriggerStatus(USBHANDLE hDev, BYTE *pStatus)
@[Explanation] Acquiring the trigger status
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@BYTE *pStatus: Specify an area where to store the acquired trigger status 
                   (0x00: Execution awaited, 0x01: Execution complete).
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSendIOCTL (USBHANDLE hDev, void* pDataStage, WORD wLength)
@[Explanation] Sending data as an interface message
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@void* pDataStage: Specify the pointer to data to send at the data stage.
@@WORD wLength: Specify the byte length of the data stage.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbClearStatusByte (USBHANDLE hDev)
@[Explanation] Clearing the SRQ and TRIG bits of a USB488 device
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSet488ID (USBHANDLE hDev, WORD w488ID)
@[Explanation] Setting a 488ID
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@WORD w488ID: Specify a 488ID to set.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbGet488ID (USBHANDLE hDev, WORD *p488ID)
@[Explanation] Acquiring a 488ID
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@WORD *p488ID: Specify an area where to store an acquired 488ID.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbGetCapacity(USBHANDLE hDev, void *pCapacity, WORD wLength)
@[Explanation] Acquiring function information from the USB488 device side
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@void *pCapacity: Specify an area where to store the acquired function information.
@@WORD wLength: Specify the pCapacity byte length.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EARG: Argument not appropriate


5. Bulk Transfer APIs

5.1@Common Commands

Evoid UsbCLS(USBHANDLE hDev)
@[Explanation] Clearing the status byte and its related queues excluding an output 
                one (*CLS)
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSESE(USBHANDLE hDev, DWORD dwSESE)
@[Explanation] Writing a value to the standard event status enable register (*ESE)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD dwSESE: Specify the standard event status enable register to set.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSESEQuery(USBHANDLE hDev, DWORD *pResult)
@[Explanation] Reading the value from standard event status enable register (*ESE?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD *pResult: Specify an area where to store the acquired standard event status 
                    enable register value.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbSESRQuery(USBHANDLE hDev, DWORD *pResult)
@[Explanation] Reading the value from and clearing the standard event status register 
                (*ESR?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD *pResult: Specify an area where to store the acquired standard event status 
                    register value.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbIDNQuery(USBHANDLE hDev, char *pResult, int iBufSize)
@[Explanation] Inquiring of an equipment ID (*IDN?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@char *pResult: Specify an area where to store the acquired equipment ID.
@@int iBufSize: Specify the pResult byte length.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbOPC(USBHANDLE hDev)
@[Explanation] Setting the LSB of the standard event status register when the current 
                operation is finished (*OPC)
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbOPCQuery(USBHANDLE hDev, DWORD *pResult, DWORD dwTimeout)
@[Explanation] Inquiring of the end of the current execution (*OPC?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD *pResult: Specify an area where to store the acquire data.
@@DWORD dwTimeout: Specify a timeout limit (unit: ms) for this function.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbReset (USBHANDLE hDev)
@[Explanation] Initializing the equipment (*RST)
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSRE(USBHANDLE hDev, DWORD dwData)
@[Explanation] Writing a value to the service request enable register (*SRE)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD dwData: Specify a service request enable register value to set.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSREQuery(USBHANDLE hDev, DWORD *pResult)
@[Explanation] Reading the value from the service request enable register (*SRE?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD *pResult: Specify an area where to store the acquired service request 
                    enable register value.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbSTBQuery(USBHANDLE hDev, DWORD *pResult)
@[Explanation] Reading the status byte and the MSS bit (*STB?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD *pResult: Specify an area where to store the acquired status value.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbSelfTestQuery(USBHANDLE hDev, DWORD *pResult)
@[Explanation] Inquiring of self-test results (*TST?)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@DWORD *pResult: Specify an area where to store the acquired self-test results.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

Evoid UsbWait (USBHANDLE hDev)
@[Explanation] Executing the command after UsbWait when the current operation is 
                finished (*WAI)
@[Argument]
@@USBHANDLE hDev: Specify a device handle.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error


5.2@Send Commands

Evoid UsbSend (USBHANDLE hDev, const void* pBuf, DWORD dwCount, DWORD dwMode)
@[Explanation] Sending a message to a device by bulk transfer
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@const void* pBuf: Specify an area of data to send to a device.
@@DWORD dwCount: Specify the number of data items to send to a device.
@@DWORD dwMode: Set whether or not to send null packets 
          (0: Do not send null packet, 1: Send null packet).
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSendBinaryWithCnt (USBHANDLE hDev, const void *pBuffer, DWORD dwCount
    , int iWidth)
@[Explanation] Sending binary data to a device after endian conversion
                (Format with transfer data count)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@const void *pBuffer: Specify an area of data to send to a device.
@@DWORD dwCount: Specify the number of data items to send to a device.
@@int iWidth: Specify the byte length of one data item.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSendBinary(USBHANDLE hDev, const void *pBuffer, DWORD dwCount, int
    iWidth)
@[Explanation] Sending binary data to a device after endian conversion 
                (Format with no transfer data count)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@const void *pBuffer: Specify an area of data to send to a device.
@@DWORD dwCount: Specify the number of data items to send to a device.
@@int iWidth: Specify the byte length of one data item.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSendBinaryWithHeader (USBHANDLE hDev, const char *pHeader, const
    void *pBuffer, DWORD dwCount, int iWidth)
@[Explanation] Sending binary data to a device after endian conversion
                (Format without transfer data count but with ASCII header)
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@const char *pHeader: Specify an area to send an ASCII header to a device.
@@const void *pBuffer: Specify an area of data to send to a device.
@@DWORD dwCount: Specify the number of data items to send to a device.
@@int iWidth: Specify the byte length of one data item.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EARG: Argument not appropriate

Evoid UsbSendBinaryData (USBHANDLE hDev, const char *pHeader, const void
    *pBuffer, DWORD dwCount, int iWidth, int iFuncID)
@[Explanation] Sending binary data to a device after endian conversion
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@const char *pHeader: Specify an area of an ASCII header to send to a device.
@@const void *pBuffer: Specify an area of data to send to a device.
@@DWORD dwCount: Specify the number of data items to send to a device.
@@int iWidth: Specify the byte length of one data item.
@@int iFuncID: Specify a packet type for data transfer.
@@@The packet types are as follows:

      Packet type value  Packet type
        0x01             Transfer data count specified (Format without ASCII header)
        0x02             Transfer data count omitted (Format without ASCII header)
        0x82             Transfer data count omitted (Format with ASCII header)

@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbSendTextData (USBHANDLE hDev, const char *pBuffer)
@[Explanation] Sending text data to a device
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@const char *pBuffer: Specify an area of data to send to a device.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error


5.3@Receive Commands

Evoid UsbReceive (USBHANDLE hDev, void* pBuf, DWORD dwCount, DWORD *pMode)
@[Explanation] Receiving a message from a device by bulk transfer
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@void* pBuf: Specify a receive data storage area.
@@DWORD dwCount: Specify the requesting size of receive data (byte count).
@@DWORD *pMode: Specify a null packet detection status storage area 
                  (0: Null packet not detected, 1: Null packet detected)
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error

Evoid UsbReceiveBinaryData (USBHANDLE hDev, char* pText, void* pData, DWORD
    dwCount, int* pWidth, int* pFuncID)
@[Explanation] Receiving binary data from a device and returning it after endian 
                conversion
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@char* pText: Specify an area to store an ASCII header received from a device.
@@void* pData: Specify an area to store binary data received from a device.
@@DWORD dwCount: Specify the requesting size of received binary data (byte count).
@@int* pWidth: Specify an area to store the byte length of received binary data.
@@int* pFuncID: Specify an area to store the packet type of received data.
@@@The packet types are as follows:

      Packet type value  Packet type
        0x01             Transfer data count specified (Format without ASCII header)
        0x02             Transfer data count omitted (Format without ASCII header)
        0x82             Transfer data count omitted (Format with ASCII header)

@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error
@@USB488_EDAT: Data communication error

EDWORD UsbReceiveTextData (USBHANDLE hDev, LPSTR pBuf, DWORD dwCount)
@[Explanation] Receiving text data from a device
@[Return value] 0: Null packet not received, 1: Null packet received
@@@@@The value becomes 1 when the USB488 device has received all sent data.
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@LPSTR pBuf: Specify a received data storage area.
@@DWORD dwCount: Specify the requesting size of received data (byte count).
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open
@@USB488_EARG: Argument not appropriate
@@USB488_EABO: I/O operation aborted (timeout)
@@USB488_EDVR: System error


6. Service Request APIs

Evoid UsbSetSrqRoutine(USBHANDLE hDev, USB_ONSRQROUTINE lpfnSrq, LPARAM,
    lParam)
@[Explanation] Specifying a callback function
@@Here is an example of callback function description on a user application.
@@void _stdcall MySrqProc(USBHANDLE hDev, WORD wStb, LPARAM lParam);
@@@hDev: Return a device handle where callback was executed.
@@@wStb: Return a status byte at SRQ occurrence.
@@@lParam: Return a 32-bit variable specified arbitrarily by the user.
@@For a callback stop, specify null to the callback function like 
    UsbSetSrqRoutine(hDev, NULL, 0).
@[Arguments]
@@USBHANDLE hDev: Specify a device handle.
@@USB_ONSRQROUTINE lpfnSrq: Specify the address of an SrqProc callback function 
                              prepared by an application for processing callback 
                              when an SRQ is generated.
@@LPARAM lParam: Specify a 32-bit variable for arbitrary use by the user.
@[Possible errors]
@@USB488_EINI: UsbInitialize not executed yet
@@USB488_EHDL: USB488 handle not valid
@@USB488_EOPN: Device not open


7. Class Requests

@The USB488 standard necessitates 11 kinds of the class requests below. 
  The class requests are mainly used to transfer IEEE-488 interface messages.

    Function                bRequest value  Data stage
    Clear Interface             0x01        No
    Clear Device                0x02        No
    Set Remote/Local            0x03        No
    Get Remote/Local            0x04        Yes (One byte)
    Execute Trigger             0x05        No
    Get Trigger Status          0x06        Yes (One byte)
    Set IOCTL (Reserved)        0x07        Yes
    Clear SRQ Status            0x08        No
    Set 488ID (Address)         0x09        No
    Get 488ID (Address)         0x0A        Yes (Two bytes)
    Get Capacity                0x0B        Yes (n bytes)

@A class request consists of 8 bytes and is transferred within the setup transaction.

    bmRequestType bRequest wValue  wIndex  wLength
    1 byte        1 byte   2 bytes 2 bytes 2 bytes

@The class request packet format is as follows:
    Name           Definition
    bmRequestType  Object and direction (20HEA0H)
    bRequest       Type and item
    wValue         Set value (Little endian)
    wIndex         Index value (Little endian)
    wLength        Data stage byte length (Little endian)

@If wLength is not 0, the next packet is handled as an object of IN/OUT transaction 
  and the data is transferred.

EClear Interface
@This command issues a Clear Interface request to a measuring instrument to perform 
  the same function as IFC of IEEE-488.2.

    bmRequestType  bRequest  wValue  wIndex  wLength
    00100000b      Set_IFC   0x0000  0x0000  0x0000

@For USB, this function is reserved and not set because the standard request can be used.

EClear Device
@This command issues a Clear Device request to a measuring instrument for the same 
  function as SDC of IEEE-488.2. This request clears the response message queue buffer 
  and the command buffer and also clears command analysis and command execution.

    bmRequestType  bRequest  wValue  wIndex  wLength
    00100000b      Set_SDC   SDC     0x0000  0x0000

@The SDC bit allocations are as follows:

    Bit      Function
    15 - 3   Reserved
     2       Clears device send buffer FIFO
     1       Clears device receive buffer FIFO
     0       Clears command interpretation
             Clears status byte interrupt transfer
             Clears *OPC, *OPC?, and *WAI command execution

ESet Remote/Local
@This command sets IEEE-488.2 Remote/Local (enable or disable panel switches) at 
  the panel lock setting of a measuring instrument.

    bmRequestType  bRequest  wValue  wIndex  wLength
    00100000b      Set_REN   REN     0x0000  0x0000

@The wValue setting data (1 byte) is as follows:

    REN     Status   Operation
    0x0000  LOCAL   Panel operation valid
    0x0001  REMOTE  Panel operation not valid (Local key enabled)
    0x0002  LOCK    Panel operation not valid (Local key disabled)

EGet Remote/Local
@This command acquires the panel lock status of a measuring instrument.

    bmRequestType  bRequest  wValue  wIndex  wLength
    10100000b      Get_REN   0x0000  0x0000  0x0001

@Response data (1 byte) at the data stage is as follows:

    REN     Status  Operation
    0x0000  LOCAL   Panel operation valid
    0x0001  REMOTE  Panel operation not valid (Local key enabled)
    0x0002  LOCK    Panel operation not valid (Local key disabled) 

@The remote/local status of IEEE-488.2 is acquired. The panel switch enable/disable 
  setting is actually acquired.

EExecute Trigger
@This command sets Group Execution Trigger (GET) to a measuring instrument.

    bmRequestType  bRequest  wValue  wIndex  wLength
    00100000b      Set_TRG   0x0001  0x0000  0x0000

@This command executes the same processing as the GET command (0x08) of IEEE-488.2. 
  A completion flag is prepared on the measuring instrument side to verify the 
  completion of execution. Note that a slight delay may occur because this command 
  is sent to each measuring instrument sequentially.

EGet Trigger Status
@This command acquires information about whether a measuring instrument has completed 
  a trigger command.

    bmRequestType  bRequest  wValue  wIndex  wLength
    10100000b      Get_TRG   0x0000  0x0000  0x0001

@Response data (1 byte) about the data stage

    Data  Status
    0x00    Execution awaited
    0x01    Execution completed

@A measuring instrument has and sends a trigger completion flag. Although there 
  is also an independent command for status read, a read bit may be prepared for the 
  SRQ status.

ESet IOCTL (Reserved)
@This command sends data to a measuring instrument as an interface message.

    bmRequestType  bRequest   wValue  wIndex  wLength
    00100000b      Set_IOCTL  0x0000  0x0000  Data byte count

@Data is sent to the data stage for an interface message.
@Now only a bRequest code reservation is accepted.

EClear SRQ Status
@This command clears the RQS and TRIG bits of the status byte of a measuring instrument.

    bmRequestType  bRequest  wValue  wIndex  wlength
    00100000b      Cls_STB   0x0000  0x0000  0x0000

@Other bits of the status byte are not affected.

ESet 488ID (Address)
@This command sets an ID corresponding to a GPIB address set on the measuring instrument 
  side. This address is different from the USB address and basically set on the measuring 
  instrument side for identifying an individual.

    bmRequestType  bRequest   wValue  wIndex  wlength
    00100000b      Set_488ID  488ID   0x0000  0x0000

@The wValue value is from 0x0000 to 0x0ffff and called 488ID.
@This command ID changes the setting of every 488ID-connected measuring instrument to 
  prevent duplicate setting. The ID enables easy setting even when a measuring instrument 
  is replaced. 0x0000 and 0xffff are used for reservations.

EGet 488ID (Address)
@This command acquires an ID corresponding to a GPIB address set on the measuring 
  instrument side. This address is different from the USB address and basically set 
  on the measuring instrument side for identifying an individual.

    bmRequestType  bRequest   wValue  wIndex  wLength
    10100000b      Get_488ID  0x0000  0x0000  0x0002

@Response data (2 bytes) of the data stage is as follows:

    DATA      2 bytes
    Contents  488ID

@Response data of the data stage represents 488ID by two byte.
@This command changes the setting of every 488ID-connected measuring instrument to 
  prevent duplicate setting. The ID enables easy setting even when a measuring instrument 
  is replaced. This response shall be a little endian, including the 488ID set wValue 
  even for equipment of a different endian.

EGet Capacity
@This command acquires function information from the measuring instrument side.
  The information is about interrupt transfer support, IEEE-488.2 status support, 
  and endian. The structure is prescribed for the first and second bytes of the 
  data stage only and free for the third and later bytes. Up to 255 bytes can be used.

    bmRequestType  bRequest  wValue  wIndex  wLength
    10100000b      Get_CAPA  0x0000  0x0000  (Variable)

@Response data (first byte) of the data stage is as follows:

    DATA      1 byte
    Contents  Data stage data length (2 - 255)

@Response data (second byte) of the data stage is as follows:

    DATA     Bit7  Bit6  Bit5  Bit4   Bit3   Bit2  Bit1  Bit0
    Contents EP3   0     0     488.2  ASCII  0     0     Endian

@@@Bit 7 (EP3)
        0  No interrupt transfer
        1  Interrupt transfer
@@@Bit 4 (488.2)
        0  488.1 status
        1  488.2 status
@@@Bit 3 (ASCII)
        0  No ASCII common command
        1  ASCII common command
@@@Bit 0 (endian)
        0  Big endian
        1  Little endian


8. Device Dependent Messages

@This section explains how to set the device dependent messages prescribed in the 
  IEEE-488 standard. Of the device dependent messages, common ones related to status 
  report operation, internal operation, and synchronous operation are defined as common 
  commands and the remaining ones are defined as vendor commands of character strings 
  dependent on equipment. For control, device dependent messages are sent to Endpoint 
  2 of electronic measuring equipment. If a response request (query) message is sent, 
  a response message is prepared at Endpoint 1. The status byte indicates whether there 
  is a message at Endpoint 1.

EMessage format
@A device dependent message is split and transferred as 64-byte packets. At Byte 1 of 
  the first packet, a message ID is specified to prescribe the message transfer mode of 
  the device dependent message. The transfer mode of the device dependent message supports 
  binary data, ASCII data, or common command defined in IEEE-488.2. For the classification 
  of essential and optional common commands defined in IEEE-488.2, the IEEE-488.2 standard 
  is applied as it is. IEEE-488.2 common commands related to controller and parallel port 
  are not actually used but only their IDs are secured.
@A message of binary data with the header of an ASCII character string is handled as 
  binary data. For a message of ASCII data, a character string is transferred with the 
  first character string as a message ID. Valid data is 0x20 to 0x7f (alphanumeric), 
  0x0A, and 0x0D (line feed).
@At the end of a device dependent message, a null packet of data length 0 is transferred.

@  Message ID    Contents
    0x00          IEEE-488.2 common command
    0x01          Binary data
    0x02 - 0x1F   Reserved (for extension)
    0x20 - 0x7F   ASCII data

@A message of binary data with a character-string header is handled as binary data. 
  ASCII data shall be 0x20 - 0x7F, 0x0D, and 0x0A only.

ECommon commands
@The IEEE-488.2 standard defines 13 essential commands and 26 optional (OP) commands. 
  The USB488 standard shall always support the essential common commands of the IEEE-
  488.2 standard. Of the optional commands, six commands (*AAD, *DLF, *IST?, *PCB, *PRE, 
  and *PRE?) related to controller and parallel port are reserved and only command IDs 
  are secured. For details about each command, see the IEEE-488.2 standard.

    Essential command    OP command (1)    OP command (2)
    ID  Command          ID   Command     ID   Command
     1  *CLS             129  *AAD        142  *PCB
     2  *ESE             130  *CAL?       143  *PMC
     3  *ESE?            131  *DDT        144  *PRE
     4  *ESR?            132  *DDT?       145  *PRE?
     5  *IDN?            133  *DLF        146  *PSC
     6  *OPC             134  *DMC        147  *PSC?
     7  *OPC?            135  *EMC        148  *PUD
     8  *RST             136  *EMC?       149  *PUD?
     9  *SRE             137  *GMC?       150  *RCL
    10  *SRE?            138  *IST?       151  *RDT
    11  *STB?            139  *LMC?       152  *RDT?
    12  *TST?            140  *LRN?       153  *SAV
    13  *WAI             141  *OPT?       154  *TRG

@For a common command message, a command ID is specified to the second byte.
    Byte 1     MSG_ID=488.2 common command (0x00)
    Byte 2     Command_ID (Command number)
    Byte 3     First byte of the argument
    Byte 4     Second byte of the argument
    cc        cc
    Last byte  Final argument

@A common command with numeric arguments is specified in a 32-bit (4-byte) binary format. 
  For a binary endian, the endian of the electronic measuring instrument is specified.
  The endian information can be acquired by the Get Capacity class request.
@After the execution of a query command, response data is prepared at Endpoint 1.
@A binary format is basically used. For a macro-related common command, however, 
  an ASCII character string format shall also be supported. The command then should 
  be transferred as a vendor command.

E*CLS command
@*The CLS command clears the status byte and its queues excluding an output queue.
@If the command is used alone, the output queue is also cleared.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x01        None

      Response data
      None

E*ESE command
  The *ESE command sets the standard event status enable register. A 32-bit binary 
  value from 0 to 255 is specified. The setting conforms to IEEE-488.2.

      Output data (6 bytes)
      Message ID   Command ID  Argument (4 bytes)
      0x00          0x02        0x00000000 - 0x000000FF

      Response data
      None

@If the logical product (AND) of the standard event status enable register and the 
  standard event status register is 1, the ESB bit of the status byte register becomes 1.

E*ESE? command
@The *ESE? command is used to read the value from the standard event status enable 
  register.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x03        None

      Response data (4 bytes)
      0x00000000 - 0x000000FF

E*ESR? command
@The *ESR? command is used to read the value from the standard event status register.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x04        None

      Response data (4 bytes)
      0x00000000 - 0x000000FF

@When the *ESR? command is finished, the standard event status register is cleared.

E*IDN? command
  The *IDN? command is used to read an equipment ID.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x05        None

      Response data (N bytes)
      ASCII character string

@Response data is an ASCII character string (0x20 - 0x7F) of a manufacturer name, 
  a product name, a serial number, and a firmware version each delimited wit a comma. 
  For a character string other than the firmware version, a USB descriptor (uni-code) 
  is always converted into an ASCII character string.
@Enter 0 for not using any firmware version.

E*OPC command
@The *OPC command sets the OPC bit of the standard event status register to 1 after 
  the current overlapping command is finished. If there is no overlapping command, 
  the bit is set to 1 after command interpretation.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x06        None

      Response data
      None

E*OPC? command
@The *OPC? command sends binary 1 after the current overlapping command is finished. 
  If there is no overlapping command, binary 1 is sent after command interpretation.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x07        None

      Response data (4 bytes)
      0x00000001

E*RST command
@The *RST command initializes the settings of an electronic measuring instrument.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x08        None

      Response data
      None

@The initial settings are stated in the command explanations. This command should not 
  affect the 488ID settings, queues, or communication registers.

E*SRE command
@The *SRE command sets the SRE register. Specify a value from 0 to 255 in a 32-bit 
  binary format. The setting conforms to IEEE-488.2.

      Output data (6 bytes)
      Message ID   Command ID  Argument (4 bytes)
      0x00          0x09        0x00000000 - 0x000000FF

      Response data
      None

E*SRE? command
@The *SRE? command is used to read the value from the SRE register.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x0A        None

      Response data (4 bytes)
      0x00000000 - 0x000000FF

E*STB? command
@The *STB? command is used to read the value from the status byte register.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x0B        None

      Response data (4 bytes)
      0x00000000 - 0x000000FF

E*TST? command
@The *TST? command is used to read the results of self tests performed in advance.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x0C        None

      Response data (4 bytes)
      0x00000000 - 0xFFFFFFFF

@If there is no error or test function, 0x00000000 is sent. In case of an error, 
  the value will be different. The instruction manual should explain the error code.

E*WAI command
@The *WAI command disables command interpretation until the current overlapping command 
  is finished. Nothing is done if there is no overlapping command.

      Output data (2 bytes)
      Message ID   Command ID  Argument
      0x00          0x0D        None

      Response data
      None

