
Operation,
Remote Operation
1-2-5
RGS-2000NG TCAS Test Set Operation Manual
139187 / Rev. 500
Page 218
Subject to Export Control. See Cover Page for details.
September 2021
//=============================================================================
ViStatus _VI_FUNC RGS_init (ViInt16 RGSGen,
ViChar RGSGenType[],
ViChar RGSGenPartNumber[],
ViChar RGSGenBus[],
ViChar primaryAddr[],
ViChar secondaryAddr[])
{
ViStatus RGS_status = VI_SUCCESS; // reset error status code
ViChar resource[50] = {NULL};
if ((RGSGen <= 0) || (RGSGen > MAX_SESSIONS))
RGS_status = ERR_PARAMETER1; // set error status code
else
{
if (RGSGenSession[(RGSGen-1)] != 0)
{
if ((RGS_status = RGS_close (RGSGen)) < 0)
RGSGenSession[(RGSGen-1)] = 0;
}
RGSGenSession[(RGSGen-1)] = 0; // Zero Session Handle
strcpy (RGSGenDevice[(RGSGen-1)].Type, RGSGenType);
strcpy (RGSGenDevice[(RGSGen-1)].Pn, RGSGenPartNumber);
strcpy (RGSGenDevice[(RGSGen-1)].Bus, RGSGenBus);
strcpy (RGSGenDevice[(RGSGen-1)].PriAddr, primaryAddr);
strcpy (RGSGenDevice[(RGSGen-1)].SecAddr, secondaryAddr);
// check for RGSGen 1 = RGS-2000NG and initialize
if (strcmp(RGSGenDevice[(RGSGen-1)].Type, "SIMULATED") == 0)
{
RGS_status = 0;
}
else if (strcmp (RGSGenDevice[(RGSGen-1)].Type, "RGS-2000NG") == 0)
{
if (strncmp ("GPIB", RGSGenDevice[(RGSGen-1)].Bus, 4) == 0)
{
ViRsrc bus; // communication bus type of device
ViChar busType[10]; // bus type such as GPIB, VXI or MXI
// ADD "GPIB::" TO address string for visa inst
strcpy(busType, RGSGenDevice[(RGSGen-1)].Bus);
bus = strcat(busType, "::");
strcpy(bus, busType);
strcat (bus, RGSGenDevice[(RGSGen-1)].PriAddr);
strcpy (resource, bus);
Example Program (cont)