Download Function Generator

Transcript
 Error Messages
Command Error
SCPI Error Code/
/Explanation
Error Code
-100
-102
Command error
Syntax error
Execution Error
SCPI Error Code/
/Explanation
Error Code
-220
-221
-222
Parameter error
Settings conflict
Data out of range
6.23 The Examples of the Communication Interface Software
/*
************************************************************************
* Microsoft Visual C++ 6.0 for RS-232
*
* This programming example shows how to communicate
* PC and instrument via RS232.
*
*
"*IDN?\n"
: Ask the Manufacturer, model number
*
and firmware
* ":FREQuency 1000.0\n" : Set Frequency=1000Hz
*
**************************************************************************
*/
#include <stdio.h>
#include <windows.h>
HANDLE InitCom (int Error_Value);
char *Error_Message[6]={
"Error Create File\n",
"Error SetCommTimeous\n",
"Error SetCommState\n",
"Error SetupComm\n",
"Error GetCommState\n",
"Error EscapeCommFunction\n"
};
void main()
{
char
char
char
DWORD
int
HANDLE
p. 44
GFG-3015
command_line[100];
Receive_Data[100];
Read_Machine_Number[10] ={"*IDN?\n"};
dwcommand_len=0,dwWritten=0,dwRead=0;
i,error_value=0;
hComm;