User Manual 3162A/B
Using The Instrument 3-31
binary block. 2002 is not a multiple of 8, therefore the
generator will generate an error message if this segment
length is used.
The following program fragment shows an example of programming the 3162A
or the 3162B’s channel A.
#include <visa.h>
#include <ansi_c.h>
#include "ri3162.h"
#include <cvirte.h> /* Needed if linking in external compiler; harmless otherwise */
/*=========================================================================*/
/* Function: Load Arbitrary Data
*/
/* Location: ri3162.c
*/
/* Purpose: This function loads arbitrary data into the specified segment */
/*=========================================================================*/
ViStatus _VI_FUNC ri3162_load_arb_data (ViSession vi,
ViInt16 segment_number,
ViInt16 *data_pts,
ViInt32 number_of_points)
{
ViInt32 max_size;
ViStatus error;
ViUInt32 cnt;
ViJobId job;
ViEventType etype;
ViEvent event;
/* range check the parameters */
if (error = ri3162_int_range (segment_number, RI3162_MIN_SEG_NUMBER,
RI3162_MAX_SEG_NUMBER, VI_ERROR_PARAMETER2))
return( error );
max_size = ri3162_get_mem_size(vi);
if (error = ri3162_int32_range (number_of_points, RI3162_MIN_SEGMENT_SIZE,
max_size, VI_ERROR_PARAMETER4))
return( error );
/* select the arbitrary waveform segment */
if ((error = viPrintf(vi, "TRAC:SEL %d\n", segment_number)) < 0)
return( error );
if ((error = viPrintf(vi, ":SMEM:STATE OFF\n")) < 0)
return( error );
/* get the device ready to download via A24 space */
if ((error = viPrintf(vi, ":SMEM:MODE WRITE\n")) < 0)
return( error );
if ((error = viPrintf(vi, ":SMEM:STATE ON\n")) < 0)
return( error );
if ((error = viPrintf(vi, "*OPC?\n")) < 0)
return( error );
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com