IVI Compliance Package

Content Type
Programming Language
Current manual
Table of Contents

viWrite

Ivi_viWrite

Usage

ViStatus Ivi_viWrite (ViSession vi, ViByte buffer[], ViInt64 count, ViInt64 *returnCount);

Purpose

This function writes an array of bytes to the device. The function bypasses the attribute state caching mechanism and therefore always invalidates all attribute cache values for the session. Use this function only to implement the PREFIX_viWrite function that your instrument driver exports to the end-user.

The function assumes that the IVI_ATTR_SYSTEM_IO_SESSION attribute for the IVI session you specify holds a valid VISA session for the instrument.

The function calls Ivi_SetNeedToCheckStatus with VI_TRUE.

Parameters

Name Type Description
vi ViSession The ViSession handle that you obtain from Ivi_SpecificDriverNew. The handle identifies a particular IVI session.
buffer ViByte[ ] Specify the array of bytes to write to the device.
count ViInt64 The number of bytes to write to the device. The value of this parameter must be less than or equal to the size of buffer.
returnCount ViInt64* The number of bytes actually written.

Return Value

Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.

Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.

Related Topic

IVI Status Codes

Was this information helpful?