Vmedemo.cpp, Appendix a – Rockwell Automation 1785-Vx0B, D17856.5.9 PLC-5 VME VMEbus Programmable Controllers User Manual User Manual

Page 124

Advertising
background image

Appendix A

Sample Applications

A-2

/***************************************************************************/
/****************************** INCLUDE FILES ******************************/
/***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <conio.h>
#include <dos.h>

#include ”epc_obm.h”

// Radisys API Definitions

#include ”epc_err.h”

// Radisys API Error Definitions

#include ”busmgr.h”

// Radisys’s VME Driver Definitions

#include ”p40vcco.h”

// AB Continuous Copy Command Definitions

#include ”p40vihas.h”

// AB PCCC Id Host and Status Definitions

#include ”p40vspcc.h”

// AB Send PCCC Command Definitions

#include ”common.h”

// Common AB Definitions

/***************************************************************************/
/************************* PRIVATE TYPE DEFINITIONS ************************/
/***************************************************************************/
// A record which contains information concerning what continuous copy
// operation has been enabled. By using this record to store the data
// when the user enters it during the enable continuous copy menu choice,
// we can use this data to halt the continuous copy operation rather than
// asking the user for it...
typedef struct
{
BOOL isInitialized;
ULONG vmeCmdBlkAddr;
UWORD baseAddr;
UWORD fileNumber;
UWORD elementNumber;
UWORD wordCount;
ULONG vmeDataAddr;
} CC_TYPE;

// A record which contains information concerning which PLC–5/VME has had
// its onboard VME enabled and where that memory has been placed in VME
// A24 address space. We can use this data when we want to disable the
// memory rather than asking the user for it...
typedef struct
{
BOOL isInitialized;
ULONG vmeSlaveAddr;
UWORD baseAddr;
} MEM_TYPE;

/***************************************************************************/
/************************* PRIVATE DEFINITIONS ****************************/
/***************************************************************************/

// Global to this file. It contains the continuous copy to information.
static CC_TYPE cc_to;

// Global to this file. It contains the continous copy from information.
static CC_TYPE cc_from;

// Global to this file. It contains the enabled PLC–5/VME memory info.
static MEM_TYPE mem;

VMEDEMO.CPP

Advertising