MFC control DH1766-3 Dahua program-controlled power supply based on VS2010

Programming requirements:
Connect the DH1766 power supply through the programming network port, and program the upper computer software to control the power supply, which can be realized. Input the voltage and current of the corresponding channel, and let the power supply output as required.
Programming process:
using UDP connection, the upper computer software is the UDP client, after inputting the IP and port number of the power supply, the connection is established, and then the SCPI command is sent to realize the corresponding function.
Insert picture description here

Programming is relatively simple, there is one place that may need to be noted, that is, the sendto function.

CString use="VOLT 8\n"; // 设置选定通道的电压值为8V
sendto(sockClient,(const char*)use.GetBuffer(0),use.GetLength(),0,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR));  
 // 设置CH1的电压值为8V

Postscript: For
SCPI instructions, you can download the programming manual from Dahua Power website; for UDP communication, you can read Sun Xin's "VC++ Explained in Simple".

Guess you like

Origin blog.csdn.net/qq_27538633/article/details/107169122