4 Programming example
4.2 Advanced operation example
107
}
else
{
flag = sockClient.Create();
if(flag)
{
ShowMsg("Socket Created Successfully ");
}
else
{
ShowMsg("Socket Creation Failed ");
sockClient.Close();
}
}
flag = sockClient.Connect("172.141.114.254",5000);
flag = sockClient.Send(":SENS:FREQ:FIX?\n",16,0);
if(!flag)
{
ShowMsg("Send Failed");
exit(0);
}
flag = sockClient.Receive(buff,28,0);
float val = float(atof(buff));
if(!flag)
{
ShowMsg("Send Failed");
exit(0);
}
sockClient.Close();
}
4.2.2 Setting VISA Mode for LAN Interface
When the instrument is controlled via the network, it is recommended to use the VISA library as the
underlying I/O library. However, what the network is different from GPIB is that the network is a serial
path and there is no hard-wired connection showing ending; the GPIB is a parallel line and there is a
hard-wired connection showing ending on the bus. Therefore, you must set the end byte enabled when
using the VISA.
viSetAttribute(*instrSession,VI_ATTR_TERMCHAR_EN, VI_TRUE));
This setti
ng enables the network communication to automatically end when it receives „\n‟.
/*************************************************************************
Содержание 3986 Series
Страница 1: ...3986 Series Noise Figure Analyzer Programming Manual...
Страница 4: ......
Страница 8: ...3986 Series noise figure analyzer Table of Contents 4...
Страница 107: ...3 SCPI 3 3 Instrument specific Commands 99...
Страница 119: ...4 Programming example 4 2 Advanced operation example 111...