Operation,
Remote Operation
139187 / Rev. 500
RGS-2000NG TCAS Test Set Operation Manual
1-2-5
September 2021
Subject to Export Control. See Cover Page for details.
Page 219
if ((RGS_status = RGS_initialize (resource, VI_OFF, VI_OFF,
&RGSGenSession[(RGSGen-1)])) < 0)
{
RGSGenSession[(RGSGen-1)] = 0;
}
else {
// Set variable so other driver calls won't bail out
RGSGenConnect[(RGSGen-1)] = ON;
}
}
else if (strcmp ("RS232", RGSGenDevice[(RGSGen-1)].Bus) == 0)
{ // RS-232
if((atoi(RGSGenDevice[(RGSGen-1)].PriAddr)> 0) &&
(atoi(RGSGenDevice[(RGSGen-1)].PriAddr) <256))
{
Fmt (resource, "%s<ASRL%i::INSTR",
atoi (RGSGenDevice[(RGSGen-1)].PriAddr));
if ((RGS_status = RGS_initialize (resource, VI_OFF,
VI_OFF, &RGSGenSession[(RGSGen-1)])) < 0)
{
RGSGenSession[(RGSGen-1)] = 0;
}
else {
RGSGenConfig.baudrate = DEFAULT_BAUD;
RGSGenConfig.databits = DEFAULT_DBITS;
RGSGenConfig.parity = DEFAULT_PARITY;
RGSGenConfig.stopbits = DEFAULT_SBIT;
// Set resource baud rate
if ((RGS_status = viSetAttribute (RGSGenSession[(RGSGen-1)],
VI_ATTR_ASRL_BAUD, RGSGenConfig.baudrate)) < 0)
return RGS_status;
if ((RGS_status = viSetAttribute (RGSGenSession[(RGSGen-1)],
VI_ATTR_ASRL_DATA_BITS, RGSGenConfig.databits)) < 0)
return RGS_status;
if (RGSGenConfig.parity == 0)
{
if ((RGS_status = viSetAttribute (RGSGenSession[(RGSGen-1)],
VI_ATTR_ASRL_PARITY, VI_ASRL_PAR_NONE)) < 0)
return RGS_status;
}
else if (RGSGenConfig.parity == 1)
{
if ((RGS_status = viSetAttribute (RGSGenSession[(RGSGen-1)],
Example Program (cont)