// i8024W_VoltageOut.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include "pac_i8024W.h" #pragma comment(lib,"pac_i8024W.lib") static int slotIndex=-1; int main(int argc, char* argv[]) { //Declaration and default value assignment char ansistr[32]; int slot = 1; int channel = 0; float fData = 0.0; for(slot=0;slot<8;slot++) { if(pac_i8024W_Initial(slot)==0) { slotIndex=slot; break; } } if(slotIndex==-1) { printf("There is no i8024W at Backplane\n"); getchar(); return -1; } else { printf("There is an i8024W at slot %d\n",slotIndex); } printf("Input Voltage output value -10 ~ +10V :" ) ; scanf("%f", &fData); for(channel=0;channel<4;channel++) { pac_i8024W_VoltageOut(slotIndex, channel, fData); printf("Writing voltage output to channel %d of I-8024W in slot %d\n", channel, slotIndex); } getchar(); return 0; }