// i8017HW_ReadAI.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "pac_i8017HW.h" #pragma comment(lib,"pac_i8017HW.lib") static int slotIndex=-1; int _tmain(int argc, _TCHAR* argv[]) { //Declaration and default value assignment char GainStr[5][32]={"+/-10V","+/-5V","+/-2.5V","+/-1.25V","+/-20mA"}; char ModeStr[2][32]={"Standard Mode", "Sample and Hold Mode"}; int slot = -1; int channel = 0; int maxCh = 8; short jumper=0; int gain = 0; float fValue = 0; int return_value = 0; for(slot=0;slot<8;slot++) { if(pac_i8017HW_Init(slot)==0) { slotIndex=slot; break; } } if(slotIndex==-1) { printf("There is no i8017HW at Backplane\n"); getchar(); exit(0); } else { printf("There is an i8017HW at slot %d\n",slotIndex); } pac_i8017HW_GetSingleEndJumper(slotIndex, &jumper); if(jumper) { maxCh=16; printf("\t i8017HW Input Mode=Single-End and can have maximum 16 analog input\n\r"); } else { maxCh=8; printf("\t i8017HW Input Mode=Differential and can have maximum 8 analog input\n\r"); } printf("Input gain for i8017HW\n"); for(int i=0;i<5;i++) { printf ("\n\t Select %d : %s",i,GainStr[i]); } printf("\n\r"); scanf_s("%d", &gain); for(channel=0;channel