#ifdef __cplusplus    // If used by C++ code, 
extern "C" {          // we need to export the C interface
#endif


/*
	Initialize Digitial I/O
	
	param:
		None  :		
				
	Return value:
		HANDLE:			return digital I/O handle
*/
HANDLE mxdgio_open(int index);

/*
	get digital input
	
	param:
		(in)HANDLE hDIO  :	Handle of digital I/O		
				
	Return value:
		int:			return digital input data 
*/
int mxdgio_get_input_signal(HANDLE fd, int port);

/*
	set digital output
	
	param:
		(in)HANDLE fd  :	Handle of digital I/O		
		(in)int port	 :	index of digital output bit		
	
	Return value:
		BOOL:			TRUE indicates success, FALSE indicates failure.
*/
int mxdgio_set_output_signal_high(HANDLE fd, unsigned int port);

/*
	set digital output
	
	param:
		(in)HANDLE fd  :	Handle of digital I/O		
		(in)int port	 :	index of digital output bit		
		
	Return value:
		BOOL:			TRUE indicates success, FALSE indicates failure.
*/
int mxdgio_set_output_signal_low(HANDLE fd, unsigned int port);

/*
	get digital output
	
	param:
		(in)HANDLE hDIO  :	Handle of digital I/O		
		(in)int port	 :	index of digital output			
	Return value:
		int:			return digital output data 
*/
int mxdgio_get_output_signal(HANDLE fd, int port);

/*
	close digital I/O
	
	param:
		(in)HANDLE hDIO  :	Handle of digital I/O		
				
	Return value:
		BOOL:			TRUE indicates success, FALSE indicates failure. 
*/
void mxdgio_close(HANDLE fd);

int mxdgio_get_counter(HANDLE fd);
int mxdgio_clear_counter(HANDLE fd);

int mxdgio_set_all_output_signal_high(HANDLE hndFile);
int mxdgio_set_all_output_signal_low(HANDLE hndFile);

#ifdef __cplusplus    // If used by C++ code, 
}
#endif
