
Operation,
Remote Operation
1-2-5
RGS-2000NG TCAS Test Set Operation Manual
139187 / Rev. 500
Page 210
Subject to Export Control. See Cover Page for details.
September 2021
// Copyright: VIAVI AvComm. All Rights Reserved.
Example Program (cont)
//=============================================================================
//=============================================================================
// Include files
#include <userint.h>
#include <utility.h>
#include <formatio.h>
#include "RGS_Driver.h"
//=============================================================================
void main(void)
{
ViStatus status = 0;
int bytes = 0;
ViChar readBuff[512] = {0};
ViChar Message[512] = {0};
ViReal64 cmdWait = 0.030;
// Initialize communication using GPIB, Ethernet or Serial (USB Port on front),
// Uncomment the line for the method you desire and set the address.
status = RGS_init (RGSGen1,"RGS-2000NG", "113956", "ETHERNET",
"10.170.170.52", "");
// status = RGS_init (RGSGen1,"RGS-2000NG", "113956", "GPIB", "8", "");
if(status < 0) // failed to initialize
{
// Display error message
Fmt(Message,"%s<The RGS-2000NG failed to initialize. \n Terminating program.");
status = MessagePopup ("Error", Message);
exit(0);
}
// The carrage return is appended by the RGS_writeInstrData function.
// Get Unit Name
status = RGS_writeInstrData (RGSGen1, ":RGS:NAME?", cmdWait);
status = RGS_readInstrData (RGSGen1, 250, readBuff, &bytes);
// readBuffer = RGSSN1000000003
// Get Unit Serial Number
status = RGS_writeInstrData (RGSGen1, ":RGS:SN?", cmdWait);
status = RGS_readInstrData (RGSGen1, 250, readBuff, &bytes);
// readBuffer = 1000000003
// Get Unit Last Calibration Date
Example Program