/* Test with I-8024 AO Module and I-8017H AI Module at Slot 01 and 02 of LinCon seperately
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    
   File level history (record changes for this file here.)

   v1.0 2017.4.26 by Winson
  
*/

#include<stdio.h>
#include<stdlib.h>
#include "msw.h"
#include "i8024W.h"
	
int main()
{
	int i,j,channel = 0, wRetVal, error = 0,slot = 2;
	char ch = 1;
	float vol = 8;

	wRetVal = Open_Slot(slot);
	if (wRetVal > 0) {
		printf("open Slot failed!\n");
		return (-1);
	}
	
	I8024_Initial(slot);
	
	I8024_VoltageOut(slot, ch, vol);
	Close_Slot(slot);
	
	printf("Channel %d Analog output %.2f\n", ch, vol);
	return 0;
}
