GPIBInstrument

public final class GPIBInstrument : MessageBasedInstrument, InstrumentProtocol

Undocumented

  • Declaration

    Swift

    public var bufferSize: Int
  • Declaration

    Swift

    public var buffer: UnsafeMutableRawBufferPointer
  • Declaration

    Swift

    public var session: Session
  • Declaration

    Swift

    public var identifier: String
  • Declaration

    Swift

    public var timeout: TimeInterval
  • Declaration

    Swift

    public var delegate: InstrumentDelegate?
  • Declaration

    Swift

    public var dispatchQueue: DispatchQueue
  • Undocumented

    Declaration

    Swift

    public init(session: Session, identifier: String)
  • Sends GPIB command bytes to the device.

    • Return: Amount of written bytes

    Declaration

    Swift

    public func sendCommand(data: ViPByte, length: UInt32) throws -> UInt32

    Parameters

    data

    A buffer of UInt8s specifying GPIB commands

    length

    the length of the data buffer

  • Specifies the state of the ATN line and the local active controller state.

    Throws

    <#throws value description#>

    Declaration

    Swift

    public func controlAtn(mode: AtnMode) throws

    Parameters

    mode

    Specifies the state of the ATN line and optionally the local active controller state.

  • Controls the state of the GPIB Remote Enable (REN) interface line, and optionally the remote/local state of the device.

    Throws

    <#throws value description#>

    Declaration

    Swift

    public func controlRen(mode: RenMode) throws

    Parameters

    mode

    Specifies the state of the REN line and optionally the device remote/local state.

  • Tell the GPIB device at the specified address to become the controller in charge

    Throws

    One of the following VISAError errors:
  • .invalidSession
  • .unsupportedOperation
  • .resourceLocked
  • .timeout
  • .notControllerInCharge
  • .noListeners
  • .ioError
  • Declaration

    Swift

    public func passControl(primaryAddress: UInt16, secondaryAddress: UInt16) throws

    Parameters

    primaryAddress

    Primary address of the device you want to pass control to

    secondaryAddress

    Secondary address of the targeted GPIB device. If the targeted device does not have a secondary address, this parameter should contain the value VI_NO_SEC_ADDR.

  • Pulses the interface clear line for at least 100 microseconds

    Throws

    One of the following VISAError errors:
  • .invalidSession
  • .unsupportedOperation
  • .resourceLocked
  • .notSystemController
  • Declaration

    Swift

    public func sendIfc() throws
  • Waits for a serial request coming from the instrument doesn’t end when another instrument signals for an SRQ Keep in mind that this is a BLOCKING operation Waits for a serial request coming from the instrument Doesn’t end when another instrument signals for an SRQ Keep in mind this is a BLOCKING operation

    Throws

    <#throws value description#>

    Declaration

    Swift

    public func waitForSrq(timeout: UInt? = 25000) throws

    Parameters

    timeout

    Timeout (in milliseconds) for the wait