Examples in CVI



NOTE:   These examples are minimal code examples to demonstrate how to

            perform the stated tasks.



Simple Generate



#include "PI620.h"

#include <stdio.h>

#include <ansi_c.h>


void main(void)

{

       ViSession vi;

       ViStatus status;

       ViUInt32 channel, signalshape;

       float voltage, attenuation, frequency, symmetry;

       

       status = pi620_init("PXI2::14::INSTR", VI_FALSE, VI_FALSE, &vi);


       // select the channel        

       channel = 1;

       status = pi620_SetActiveChannel(vi, channel);

       

       // before configuring channel turn it off

       status = pi620_OutputOff(vi);



       // set trigger mode to continuous (e.g. no trigger) mode for now

       status = pi620_SetTriggerMode(vi, PI620_TS_FRONT, PI620_TM_CONT);

       

       voltage = 0.0;

       status = pi620_SetOutputOffsetVoltage(vi, voltage, PI620_DO_DISCONNECT);

               

       //attenuation affects signal amplitude


       frequency = 10.0;

       signalshape = PI620_SS_SINE;

       symmetry = 50.0;

       status = pi620_GenerateSignal(vi, frequency, signalshape, symmetry);

       

       //close card. This won't stop channel from generating though

       status = pi620_close(vi);


}