#include<conio.h>
#include<stdlib.h>
#include"8000.h" //I-8000 Series Function Call Definition
/*
This demo program is writted for I-8054 Module,8 Digital Output & 8 digital Input.
Before Run this program,connect the digital output to the digital input
¡@
*/
void main()
{
unsigned int SlotNo,DOdata;
Print("Please Input DO Module Slot Number(0 to 7) =");//Specific the slot number of I-8054.
SlotNo = ascii_to_hex(Getch());//MiniOS7 read the slot input.
Print(" %d \n\r",SlotNo);//Show the user input.
Scanf("%x",&DOdata);//MiniOS7 read the user keyin the digital output value.
Print("DO data = %x\n\r",DOdata);//Show the user input.
DIOData[SlotNo].data8.do8 = DOdata;//store the data to the internal variable.for later reference
DIO_DO_8(SlotNo,DIOData[SlotNo].data8.do8);//Function call to execute, set digital output
DIOData[SlotNo].data8.di8 = DI_8(SlotNo);//Function call to execute, read digital input
Print("DI data = %X\n\r",DIdata);//Show the digital input value.
}