![Cryo-con 24C Скачать руководство пользователя страница 144](http://html.mh-extra.com/html/cryo-con/24c/24c_user-manual_2691809144.webp)
Cryo-con Model 24C
Remote Programming Guide
Code snippet in C++
The following code opens a Cryo-con instrument at address 192.168.1.5 on the Local
Area Network. It is written in Microsoft Visual C++ and uses the eZNET LAN library
provided on the Cryo-con utility CD.
// ----- Example Ethernet LAN program using C++ -----
// TCPIP declarations
#include
"
TCPIPdrv.h"
TCPIPdrv LAN; //Define global LAN object
char IPA[ ] =
"
192.168.1.5"; //Instrument's IP address on the
LAN
char tempstr[257]; //temporary character string
//Open the instrument.
If(!LAN.open(IPA))
{
//can't connect...
LAN.close();
throw (
"
Can't talk to instrument");
}
;
//read the IDN string
LAN.IO("*IDN?",tempstr,256);
printf("IDN is %s\n",tempstr); //Print IDN
//read the MAC address
LAN.IO("net:mac?",tempstr,256);
printf("MAC is: %s\n",tempstr);
//Start temperature control
LAN.IO(control");
//Stop temperature control
LAN.IO(stop");
//Read channel B input
LAN.IO("input? B",tempstr,256);
printf("Channel B temperature is: %s\n",tempstr);
//send compound command to input channel A and wait for it
to finish.
LAN.IO("INPUT A:UNIT S;SENSOR 33;:*OPC?",tempstr,256);
//close the instrument
LAN.close();
138