Instrument Control Toolbox    
binblockwrite

Write binblock data to the instrument

Syntax

Arguments

obj
An instrument object.
A
The data to be written using the binblock format.
'precision'
The number of bits written for each value, and the interpretation of the bits as character, integer, or floating-point values.

Description

binblockwrite(obj,A) writes the data specified by A to the instrument connected to obj as a binary-block (binblock). The binblock format is defined as #<N><D><A> where

For example, if A is given by [0 5 5 0 5 5 0], the binblock would be defined as [double('#') 1 7 0 5 5 0 5 5 0].

binblockwrite(obj,A,'precision') writes binblock data translating MATLAB values to the precision specified by precision. By default the uchar precision is used. Refer to the fwrite function for a list of supported precisions.

Remarks

Before you can write data to the instrument, it must be connected to obj with the fopen function. A connected instrument object has a Status property value of open. An error is returned if you attempt to perform a write operation while obj is not connected to the instrument.

The ValuesSent property value is increased by the number of values written each time binblockwrite is issued.

An error occurs if the output buffer cannot hold all the data to be written. You can specify the size of the output buffer with the OutputBufferSize property.

Example

Create the GPIB object g associated with a National Instruments GPIB controller with board index 0, and a Tektronix TDS 210 oscilloscope with primary address 2.

Connect g to the instrument, and write string commands that configure the scope to transfer binary waveform data to memory location A.

Create the waveform data.

Write the binblock data to the scope.

See Also

Functions

binblockread, fopen, fwrite, instrhelp

Properties

OutputBufferSize, OutputEmptyFcn, Status, Timeout, TransferStatus, ValuesSent


  binblockread clear