4 Programming example
4.2 Advanced operation example
106
#endif
}
void main()
{
//initialize network port
bool flag;
char buff[100];
//*
set
**********************************************************
if (!AfxSocketInit())
{
ShowMsg("Initialization Failed!");
}
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); //connect network port
flag = sockClient.Send(":SENS:FREQ:MODE FIX\n",28,0);//set the point frequency to 1 GHz
if(!flag)
{
ShowMsg("Send Failed");
exit(0);
}
sockClient.Close();
//*
read
**********************************************************
if(!AfxSocketInit())
{
ShowMsg("Initialization Failed!")