Herunterladen Inhalt Inhalt Diese Seite drucken

Mitsubishi Electric MELSEC System Q Bedienungsanleitung Seite 441

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

Werbung

An hang
Programm
/***************************************************************************/
/** Sam ple pro gram (pro gram name: AJSAMP.CPP)
/**
/** This pro gram is a sam ple pro gram to con duct a
/** con nec tion test between the E71 and tar get device.
/** This pro gram accesses the data reg is ter (D) of
/** the PLC CPU installed together 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_INI TIAL
#define ERROR_SOCKET
#define ERROR_BIND
#define ERROR_CON NECT
#define ERROR_SEND
#define ERROR_RECEIVE
#define ERROR_SHUT DOWN
#define ERROR_CLOSE
//Def i ni tions for check ing the receiv ing sizes
//#define RECV_ANS_1 4 // Receiv ing size of response mes sage in reply to device write (1E frame)
#define RECV_ANS_1 22 // Receiv ing size of response mes sage in reply to device write (3E frame)
//#define RECV_ANS_2 24 // Receiv ing size of response mes sage in reply to device read (1E frame)
#define RECV_ANS_2 42 // Receiv ing size of response mes sage in reply to device read (3E frame)
typedef struct sck_inf{
struct in_addr my_addr;
unsigned short my_port;
struct in_addr aj_addr;
unsigned short aj_port;
}sck_inf;
(Fort set zung auf der nächs ten Seite)
MELSEC System Q Ethernet-Module
Programmbeispiel für ein verbundenes Gerät
0
// Com ple tion flag OFF
1
// Com ple tion flag ON
0
// Nor mal com ple tion
-1
// Abnor mal com ple tion
4096
// Receive buffer size
0
// Ini tial error
1
// Socket cre ation error
2
// Bind error
3
// Con nec tion error
4
// Send error
5
// Receive error
6
// Shut down error
7
// Line close error
**/
**/
**/
**/
**/
**/
**/
**/
**/
A - 51

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Qj71e71-b2Qj71e71-b5Qj71e71-100

Inhaltsverzeichnis