You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			140 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			C
		
	
			
		
		
	
	
			140 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			C
		
	
////////////////////////////////////////////////////////////////////////////////
 | 
						|
//        File: AdsAPI.h
 | 
						|
// Description: Prototypes and Definitions for non C++ Applications
 | 
						|
//      Author: RamonB
 | 
						|
//     Created: Wed Nov 6 10:00:00 1996
 | 
						|
//
 | 
						|
//
 | 
						|
// BECKHOFF-Industrieelektronik-GmbH
 | 
						|
//
 | 
						|
// Modifications:	
 | 
						|
// KlausBue 11/1999
 | 
						|
// Register Callback for Router notifications
 | 
						|
//
 | 
						|
// ChristophC 16/07/2001
 | 
						|
// Double definition of router callback function removed 
 | 
						|
// 
 | 
						|
////////////////////////////////////////////////////////////////////////////////
 | 
						|
#ifndef __ADSAPI_H__
 | 
						|
#define __ADSAPI_H__
 | 
						|
 | 
						|
#define ADSAPIERR_NOERROR			0x0000
 | 
						|
 | 
						|
////////////////////////////////////////////////////////////////////////////////
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C"
 | 
						|
{
 | 
						|
#endif
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsGetDllVersion( void );
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long	AdsPortOpen( void ); 
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long	AdsPortClose( void );
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long	AdsGetLocalAddress( AmsAddr*	pAddr );
 | 
						|
 
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncWriteReq( AmsAddr*			pServerAddr,	// Ams address of ADS server
 | 
						|
							 unsigned long		indexGroup,		//	index group in ADS server interface
 | 
						|
							 unsigned long		indexOffset,	// index offset in ADS server interface
 | 
						|
							 unsigned long		length,			// count of bytes to write
 | 
						|
							 void*				pData				// pointer to the client buffer
 | 
						|
							 );
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncReadReq( AmsAddr*	pAddr,						// Ams address of ADS server           
 | 
						|
							 unsigned long		indexGroup,		//	index group in ADS server interface
 | 
						|
							 unsigned long		indexOffset,	// index offset in ADS server interface
 | 
						|
							 unsigned long		length,			// count of bytes to read
 | 
						|
							 void*				pData				// pointer to the client buffer
 | 
						|
							);
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncReadReqEx( AmsAddr*	pAddr,						// Ams address of ADS server           
 | 
						|
							 unsigned long		indexGroup,		//	index group in ADS server interface
 | 
						|
							 unsigned long		indexOffset,	// index offset in ADS server interface
 | 
						|
							 unsigned long		length,			// count of bytes to read
 | 
						|
							 void*				pData,			// pointer to the client buffer
 | 
						|
							 unsigned long*	pcbReturn		// count of bytes read
 | 
						|
							);
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncReadWriteReq( AmsAddr* pAddr,					// Ams address of ADS server
 | 
						|
							unsigned long indexGroup,			//	index group in ADS server interface
 | 
						|
							unsigned long indexOffset,			// index offset in ADS server interface
 | 
						|
							unsigned long cbReadLength,		// count of bytes to read
 | 
						|
							void* pReadData,						// pointer to the client buffer
 | 
						|
							unsigned long cbWriteLength, 		// count of bytes to write
 | 
						|
							void* pWriteData						// pointer to the client buffer
 | 
						|
							);											
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncReadWriteReqEx( AmsAddr* pAddr,					// Ams address of ADS server
 | 
						|
							unsigned long indexGroup,			//	index group in ADS server interface
 | 
						|
							unsigned long indexOffset,			// index offset in ADS server interface
 | 
						|
							unsigned long cbReadLength,		// count of bytes to read
 | 
						|
							void* pReadData,						// pointer to the client buffer
 | 
						|
							unsigned long cbWriteLength, 		// count of bytes to write
 | 
						|
							void* pWriteData,						// pointer to the client buffer
 | 
						|
							unsigned long*	pcbReturn			// count of bytes read
 | 
						|
							);											
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncReadDeviceInfoReq( AmsAddr*		pAddr,	// Ams address of ADS server 
 | 
						|
										 char*			pDevName,// fixed length string (16 Byte)
 | 
						|
										 AdsVersion*	pVersion	// client buffer to store server version
 | 
						|
										 );
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncWriteControlReq( AmsAddr*		  pAddr,	   // Ams address of ADS server           
 | 
						|
									  unsigned short adsState, // index group in ADS server interface 
 | 
						|
									  unsigned short deviceState,// index offset in ADS server interface
 | 
						|
									  unsigned long length,	// count of bytes to write
 | 
						|
									  void*			  pData		// pointer to the client buffer        
 | 
						|
									  );
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncReadStateReq( AmsAddr*	pAddr,				// Ams address of ADS server           
 | 
						|
								  unsigned short*	pAdsState,	// pointer to client buffer
 | 
						|
								  unsigned short*	pDeviceState// pointer to the client buffer        
 | 
						|
								  );							          
 | 
						|
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncAddDeviceNotificationReq(	AmsAddr*	pAddr, 	// Ams address of ADS server           
 | 
						|
													unsigned long indexGroup, //	index group in ADS server interface
 | 
						|
													unsigned long indexOffset,//	index offset in ADS server interface
 | 
						|
													AdsNotificationAttrib* pNoteAttrib,	// attributes of notification request
 | 
						|
													PAdsNotificationFunc pNoteFunc,		// address of notification callback
 | 
						|
													unsigned long hUser,						// user handle
 | 
						|
													unsigned long *pNotification			// pointer to notification handle (return value)
 | 
						|
													);
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncDelDeviceNotificationReq(	AmsAddr*	pAddr,// Ams address of ADS server            
 | 
						|
													unsigned long hNotification // notification handle
 | 
						|
													);
 | 
						|
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsSyncSetTimeout(	long nMs ); // Set timeout in ms
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
/// register callback
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsAmsRegisterRouterNotification (PAmsRouterNotificationFunc pNoteFunc );
 | 
						|
 | 
						|
/// unregister callback
 | 
						|
__declspec( dllexport )
 | 
						|
long AdsAmsUnRegisterRouterNotification ();
 | 
						|
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
} // extern "C"
 | 
						|
#endif
 | 
						|
#endif |