Download - Siemens

Transcript
04.03
Appendix
// Transfer Output Parameters:
printf("Station name: \"%s\"\r\n", lpszS7StationName);
printf("CPU name: \"%s\"\r\n", lpszS7CpuName);
printf("DB number: %ld\r\n", stepInfo.BlockNumber);
printf("step number: %ld\r\n", stepInfo.StepNumber);
// Fetch step name
result = ProAgentUserGetS7GraphStepInfo(lpszS7StationName,
lpszS7CpuName, &stepInfo);
if(result == 0)
{
// Return value == 0: everything ok
// Read out step name:
printf("step name: \"%s\"\r\n", stepInfo.StepName);
}
else
{
//Return value != 0:
//Error as per table; more than one bit may be set
//Error handling
printf("ProAgentUserGetS7GraphStepInfo supplied error code
0x%lx\r\n", result);
if((result & C7_APIERROR_NOTINITIALIZED) ==
C7_APIERROR_NOTINITIALIZED)
printf("ProAgent Runtime System not initialized as yet!\r\n");
if((result & C7_APIERROR_STATIONOTFOUND) ==
C7_APIERROR_STATIONOTFOUND)
printf("station not found!\r\n");
if((result & C7_APIERROR_CPUNOTFOUND) ==
C7_APIERROR_CPUNOTFOUND)
printf("CPU not found!\r\n");
Printout of the Online Help
193