Herunterladen Inhalt Inhalt Diese Seite drucken

Mitsubishi Electric MELSEC System Q Bedienungsanleitung Seite 450

Speicher programmierbare steuerungen
Vorschau ausblenden Andere Handbücher für MELSEC System Q:
Inhaltsverzeichnis

Werbung

Programmbeispiel für ein verbundenes Gerät
Pro gramm
/**************************************************************************/
/** Sam ple pro gram (pro gram name: QJSAMP.CPP)
/**
/** This pro gram is a sam ple pro gram for test ing the
/** con nec tion of the E71 and exter nal device.
/** This pro gram accesses the data reg is ters (D) of
/** the redun dant CPU (con trol sys tem) mounted with the E71. **/
/**
/** Copy right(C) 2005 Mitsubishi Elec tric Cor po ra tion
/** All Rights Reserved
/**************************************************************************/
#include <stdio.h>
#include <winsock.h>
#define FLAG_OFF
#define FLAG_ON
#define SOCK_OK
#define SOCK_NG
#define BUF_SIZE
#define ERROR_NO_ERROR
#define ERROR_INI TIAL
#define ERROR_SOCKET
#define ERROR_BIND
#define ERROR_CON NECT
#define ERROR_SEND
#define ERROR_SHUT DOWN
#define ERROR_CLOSE
// Defi ni tion for che cking receive size
#define RECV_ANS_1 22 // Response mes sage receive size in reply to device write (3E frame)
typedef struct sck_inf{
struct in_addr my_addr;
unsigned short my_port;
struct in_addr qj_addr;
unsigned short qj_port;
} sck_inf;
int nErrorStatus;
int Dmykeyin;
int ShutdownflagA;
int ShutdownflagB;
(Fort set zung auf der nächs ten Seite)
A - 60
**/
**/
**/
**/
**/
**/
**/
**/
0
// End flag OFF
1
// End flag ON
0
// Nor mal terminationP
-1
// Unsuc cess ful ter mi na tion
4096
// Receive buffer size
0
// No error
1
// Ini tial error
2
// Socket cre ation error
3
// Bind error
4
// Con nect error
5
// Send error
6
// Shut down error
7
// Line close error
// Error infor ma tion stor age vari able
// Dummy key input
// Shut down flag (for Sys tem A con nec tion)
// Shut down flag (for Sys tem B con nec tion)
An hang
MITSUBISHI ELECTRIC

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Qj71e71-b2Qj71e71-b5Qj71e71-100

Inhaltsverzeichnis