Mitsubishi Electric QJ71E71-100 User Manual page 412

Q corresponding ethernet interface module
Table of Contents

Advertisement

/**************************************************************************/
/** Sample program (program name: QJSAMP.CPP)
/**
/** This program is a sample program for testing the
/** connection of the E71 and external device.
/** This program accesses the data registers (D) of
/** the redundant CPU (control system) mounted with the E71. **/
/**
/** Copyright(C) 2005 Mitsubishi Electric Corporation
/** 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_INITIAL
#define ERROR_SOCKET
#define ERROR_BIND
#define ERROR_CONNECT
#define ERROR_SEND
#define ERROR_SHUTDOWN
#define ERROR_CLOSE
// Definition for checking receive size
#define RECV_ANS_1
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;
(To the next page)
410
0
1
0
-1
4096
0
1
2
3
4
5
6
7
22
// Response message receive size in reply to device write (3E frame)
// Dummy key input
// Shutdown flag (for System A connection)
// Shutdown flag (for System B connection)
**/
**/
**/
**/
**/
**/
**/
**/
// End flag OFF
// End flag ON
// Normal terminationP
// Unsuccessful termination
// Receive buffer size
// No error
// Initial error
// Socket creation error
// Bind error
// Connect error
// Send error
// Shutdown error
// Line close error
// Error information storage variable

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qj71e71-b5Qj71e71-b2

Table of Contents