![background image](http://html1.mh-extra.com/html/quanmax/keex-1850-series/keex-1850-series_user-manual_3450521057.webp)
Appendix A
57
KEEX-1850 Series User’s Manual
Appendix A
DIO (Digital I/O) Sample Code
//*****************************************************************
//KEEX-1850 DOS DIO sample program
//Please compile with Microsoft(R) Visual C++ Version 1.5 & MASM611
//to utilized the program
//
//Access Method
// 32 bits memory address access
//
//0:Low 1:High
//DI_1: memory address 0xFED8C400 bit0
//DI_2: memory address 0xFED8C418 bit0
//DI_3: memory address 0xFED8C438 bit0
//DI_4: memory address 0xFED8C408 bit0
//
//DO_1: memory address 0xFED8C428 bit1
//DO_2: memory address 0xFED8C420 bit1
//DO_3: memory address 0xFED8C440 bit1
//DO_4: memory address 0xFED8C410 bit1
//
//*****************************************************************
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned long DWORD;
DWORD MEM_BASE_ADDRESS = 0xFED88000;
DWORD addr_offset[8] = {0x4400, //DI_1
0x4418, //DI_2
0x4438, //DI_3