// ************************************************************** // // Module UmacLib.h // This module contains Delta TAU controller library functions prototypes // It is important to use proper function names at the umac_get_lib_functions() // that can be found in the UMAC software reference manual // Seva Kaplounenko, Stanford Linear Accelerator Center // 6/14/06 // // Switched from Pcomm32.lib (Win XP) to Pcomm32W.lib (Win 7) // A. Madur. Lawrence Berkeley National Laboratory // 04/2014 #ifndef __UMACLIBCVI_H #define __UMACLIBCVI_H //#define DRIVERNAME "c:\\windows\\system32\\Pcomm32.lib" //name of the user-dll driver #define DRIVERNAME "c:\\windows\\system32\\Pcomm32W.lib" //name of the user-dll driver //#define DRIVERNAME "c:\\windows\\SysWOW64\\Pcomm32W.lib" //name of the user-dll driver //+************************************************************************ // COMM Type Defines //************************************************************************ // void( __stdcall *PMACDPRPCITEST ) ( DWORD dwDevice ); BOOL ( __stdcall *OpenPmacDevicePtr) (DWORD dw ); /* long (__stdcall * PmacSelectPtr) ( HWND hwnd ); long (__stdcall *DrvNumberOfDevicesPtr)();*/ BOOL ( __stdcall *ClosePmacDevicePtr) (DWORD d ); /* BOOL (__stdcall *PmacSetLanguagePtr) ( const DWORD dwDevice, char *locale ); BOOL (__stdcall *PMACSETWINDOW) ( DWORD dwDevice, HWND hWnd ); void (__stdcall *PMACLMH) ( HANDLE * hndl ); BOOL (__stdcall *SETLANGUAGEMODULE) ( const char *locale, const HANDLE hProcess, HANDLE * h ); LPSTR( __stdcall *SZLOADSTRINGA ) ( HANDLE hInst, int iID ); PCHAR( __stdcall *SZSTRIPCONTROLCHARA ) ( PCHAR str ); PCHAR (__stdcall *SZSTRIPWHITESPACEA) ( PCHAR str ); int (__stdcall *GETERROR) ( DWORD dwDevice ); ASCIIMODE (__stdcall *GETASCIICOMM) ( DWORD dwDevice ); BOOL (__stdcall *SETASCIICOMM) ( DWORD dwDevice, ASCIIMODE m ); LOCATIONTYPE (__stdcall *GETLOCATION) (DWORD dwDevice); int (__stdcall *GETENUMERATION) (DWORD dwDevice); BOOL (__stdcall *MOTIONBUFOPEN) ( DWORD dwDevice ); BOOL (__stdcall *ROTBUFOPEN) ( DWORD dwDevice ); BOOL (__stdcall *GETVARIABLESTRA) ( DWORD dwDevice, CHAR ch, LPSTR str, UINT num ); short int (__stdcall *GETIVARIABLE) ( DWORD dwDevice, UINT num, short int def ); long (__stdcall *GETVARIABLELONG) ( DWORD dwDevice, TCHAR ch, UINT num, long def ); double (__stdcall *GETVARIABLEDOUBLE) ( DWORD dwDevice, TCHAR ch, UINT num, double def ); long (__stdcall *GETIVARIABLELONG) ( DWORD dwDevice, UINT num, long def ); double (__stdcall *GETIVARIABLEDOUBLE) ( DWORD dwDevice, UINT num, double def ); void (__stdcall *SETIVARIABLE) ( DWORD dwDevice, UINT num, short int val ); void (__stdcall *SETIVARIABLELONG) ( DWORD dwDevice, UINT num, long val ); void (__stdcall *SETIVARIABLEDOUBLE) ( DWORD dwDevice, UINT num, double val ); int (__stdcall *GETPROGRAMINFO) ( DWORD dwDevice, BOOL plc, int num, UINT * sadr, UINT * fadr ); int (__stdcall* GETProgramInfo)(DWORD dwDevice,BOOL plc,int num,UINT *sadr,UINT *fadr); PUSER_HANDLE( __stdcall *GETUSERHANDLE ) ( DWORD dwDevice ); BOOL (__stdcall *CONFIGURE) ( HWND hwnd, DWORD dwDevice ); void (__stdcall *LOCKPMAC) ( DWORD dwDevice ); void (__stdcall *RELEASEPMAC) ( DWORD dwDevice ); BOOL (__stdcall *SETCRITICALIVARS) ( DWORD dwDevice ); BOOL (__stdcall *PMACISTURBO) ( DWORD dwDevice ); BOOL (__stdcall *DOCHECKSUMS) ( DWORD dwDevice, BOOL bVal ); BOOL (__stdcall *SERDOCHECKSUMS) ( DWORD dwDevice, BOOL do_checksums ); BOOL (__stdcall *SERCHECKSENDLINEA) ( DWORD dwDevice, char *outstr, char *command_csum ); int (__stdcall *SERCHECKGETLINEA) ( DWORD dwDevice, PCHAR response, UINT maxchar, PUINT num_char ); int (__stdcall *SERCHECKRESPONSEA) ( DWORD dwDevice, char *response, UINT maxchar, char *outstr ); int (__stdcall *SERCHECKALLWENTWELL)(DWORD dwDevice,int ret,char *cp,char csum) ; DWORD( __stdcall *SERGETPORT ) ( DWORD dwDevice ); BOOL (__stdcall *SERSETPORT) ( DWORD dwDevice, DWORD p ); DWORD (__stdcall *SERGETBAUDRATE) ( DWORD dwDevice ); BOOL (__stdcall *SERSETBAUDRATE) ( DWORD dwDevice, DWORD br ); // ASCII string exported functions PCHAR (__stdcall *GETROMDATEA) ( DWORD dwDevice, LPSTR s, int maxchar ); PCHAR (__stdcall *GETROMVERSIONA) ( DWORD dwDevice, LPSTR s, int maxchar ); int (__stdcall *GETPMACTYPE) ( DWORD dwDevice ); BOOL (__stdcall *GETIVARIABLESTRA) ( DWORD dwDevice, LPSTR str, UINT num ); int (__stdcall *MULTIDOWNLOADA) ( DWORD dwDevice, DOWNLOADMSGPROC msgp, LPCSTR outfile, LPCSTR inifile, LPCSTR szUserId, BOOL macro, BOOL map, BOOL log, BOOL dnld ); int (__stdcall *ADDDOWNLOADFILEA) ( DWORD dwDevice, LPCSTR inifile, LPCSTR szUserId, LPCSTR szDLFile ); int (__stdcall *REMOVEDOWNLOADFILEA) ( DWORD dwDevice, LPCSTR inifile, LPCSTR szUserId, LPCSTR szDLFile ); void (__stdcall *RENUMBERFILESA) ( DWORD dwDevice, int file_num, LPCSTR szIniFile ); int (__stdcall *GETERRORSTRA) ( DWORD dwDevice, LPSTR str, int maxchar ); // Unicode string exported functions BOOL (__stdcall *GETIVARIABLESTRW) ( DWORD dwDevice, LPWSTR str, UINT num ); WORD( __stdcall *GETPLCSTATUS ) ( DWORD dwDevice, TOTAL_PLC_STATUS_STRUCT *plc_stat ); WORD( __stdcall *ISANYPLCRUNNING) (DWORD dwDevice); int (__stdcall *MULTIDOWNLOADW) ( DWORD dwDevice, DOWNLOADMSGPROC msgp, PWCHAR outfile, PWCHAR inifile, PWCHAR szUserId, BOOL macro, BOOL map, BOOL log, BOOL dnld ); int (__stdcall *ADDDOWNLOADFILEW) ( DWORD dwDevice, PWCHAR inifile, PWCHAR szUserId, PWCHAR szDLFile ); int (__stdcall *REMOVEDOWNLOADFILEW) ( DWORD dwDevice, PWCHAR inifile, PWCHAR szUserId, PWCHAR szDLFile ); void (__stdcall *RENUMBERFILESW) ( DWORD dwDevice, int file_num, PWCHAR szIniFile ); int (__stdcall *GETERRORSTRW) ( DWORD dwDevice, PWCHAR str, int maxchar ); BOOL (__stdcall *READREADY) ( DWORD dwDevice ); int (__stdcall *SENDCHARA) ( DWORD dwDevice, CHAR outch ); int (__stdcall *SENDCHARW) ( DWORD dwDevice, WCHAR outch ); int (__stdcall *SENDLINEA) ( DWORD dwDevice, LPCTSTR outstr ); int (__stdcall *SENDLINEW) ( DWORD dwDevice, PWCHAR outstr ); int (__stdcall *GETLINEA) ( DWORD dwDevice, LPTSTR s, UINT maxchar ); int (__stdcall *GETLINEEXA) ( DWORD dwDevice, LPTSTR s, UINT maxchar ); int (__stdcall *WAITGETLINEA) ( DWORD dwDevice, LPTSTR s, UINT maxchar ); int (__stdcall *GETLINEW) ( DWORD dwDevice, PWCHAR s, UINT maxchar );*/ int ( __stdcall *PmacGetResponseAPtr)(DWORD d,char inbuf[], int n, char outbuf[]); /* int (__stdcall *GETRESPONSEW) ( DWORD dwDevice, PWCHAR s, UINT maxchar, PWCHAR outstr ); int (__stdcall *GETCONTROLRESPONSEA) ( DWORD dwDevice, LPTSTR s, UINT maxchar, CHAR outchar ); int (__stdcall *GETCONTROLRESPONSEW) ( DWORD dwDevice, PWCHAR s, UINT maxchar, WCHAR outchar ); int (__stdcall *GETRESPONSEEXA) ( DWORD dwDevice, LPTSTR s, UINT maxchar, LPCTSTR outstr ); int (__stdcall *GETRESPONSEEXW) ( DWORD dwDevice, PWCHAR s, UINT maxchar, PWCHAR outstr ); int (__stdcall *GETCONTROLRESPONSEEXA) ( DWORD dwDevice, LPTSTR s, UINT maxchar, CHAR outchar ); int (__stdcall *GETCONTROLRESPONSEEXW) ( DWORD dwDevice, PWCHAR s, UINT maxchar, WCHAR outchar ); void (__stdcall *FLUSH) ( DWORD dwDevice ); void (__stdcall *SENDCOMMANDA) ( DWORD dwDevice, LPCTSTR outchar ); void (__stdcall *SENDCOMMANDW) ( DWORD dwDevice, PWCHAR outstr ); int (__stdcall *SENDCTRLCHARA) ( DWORD dwDevice, CHAR outstr ); int (__stdcall *SENDCTRLCHARW) ( DWORD dwDevice, WCHAR outstr ); BOOL (__stdcall *INBOOTSTRAP) ( DWORD dwDevice ); int (__stdcall *GETBUFFERA) ( DWORD dwDevice, LPTSTR s, UINT maxchar ); BOOL (__stdcall *PMACCONFIGURE) ( HANDLE hwnd, DWORD dwDevice ); LONG( __stdcall *TESTDPRAM ) ( DWORD dwDevice, DPRTESTMSGPROC msgp, DPRTESTPROGRESS prgp ); void (__stdcall *TESTDPRABORT) ( void ); void (__stdcall *DPRSETHOSTBUSYBIT) ( DWORD dwDevice, int value ); int (__stdcall *DPRGETHOSTBUSYBIT) ( DWORD dwDevice ); int (__stdcall *DPRGETPMACBUSYBIT) ( DWORD dwDevice ); int (__stdcall *DPRGETSERVOTIMER) ( DWORD dwDevice ); void (__stdcall *DPRSETMOTORS) ( DWORD dwDevice, UINT n ); BOOL (__stdcall *DPRAVAILABLE) ( DWORD dwDevice ); PVOID( __stdcall *DPRGETPTR ) ( DWORD dwDevice ); BOOL (__stdcall *RESTORELINKLIST) ( char *buf ); BOOL (__stdcall *GETUSRESPONSE)(DWORD dwDevice, PCHAR buf, UINT maxchar); BOOL (__stdcall *USREADREADY) (DWORD dwDevice); BOOL (__stdcall *STOREUSRESPONSE)(DWORD dwDevice,CHAR * buf, DWORD size); BOOL (__stdcall *CHANGEGET)(DWORD dwDevice, PCHAR buf, UINT maxchar); BOOL (__stdcall *CHANGEREADREADY) (DWORD dwDevice); BOOL (__stdcall *CHANGESTORE)(DWORD dwDevice,CHAR * buf); DWORD (__stdcall *MAPDEVICENUMTOENUANDLOC)(LOCATIONTYPE loc,DWORD dwEnum); DWORD (__stdcall *MAPLOCANDENUMFROMDEVICENUM) (DWORD dwDevNum, LOCATIONTYPE * loc,DWORD * dwEnum); BOOL (__stdcall *DEVICESHUTDOWNPMAC)(DWORD dwDevice,BOOL bForceShutdown); void (__stdcall *DPRROTBUFCLEAR) ( DWORD dwDevice, UINT bufnum ); SHORT( __stdcall *DPRROTBUFPUT ) ( DWORD dwDevice, int num_put, LPDWORD rotdat, int bufnum ); void (__stdcall *SETMAXDOWNLOADERRORS) ( UINT max ); void (__stdcall *ABORTDOWNLOAD) ( DWORD dwDevice ); // Turbo Specific // Turbo Handshaking void (__stdcall *DPRRESETDATAREADYBIT) ( DWORD dwDevice ); long (__stdcall *DPRGETDATAREADYBIT) ( DWORD dwDevice ); // long (__stdcall* DPRUPDATEREALTIME)(DWORD dwDevice); BOOL (__stdcall *DPRUPDATEREALTIME) ( DWORD dwDevice ); // Turbo Initialization // Data Access struct ssTurbo( __stdcall *DPRMOTORSERVOSTATUSTURBO ) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRREALTIME) ( DWORD dwDevice, UINT period, int on ); void (__stdcall *DPRREALTIMESETMOTOR) ( DWORD dwDevice, long mask ); BOOL (__stdcall *DPRBACKGROUND) ( DWORD dwDevice, int on ); BOOL (__stdcall *DPRBACKGROUNDEX) ( DWORD dwDevice, int on, UINT period, UINT crd ); BOOL (__stdcall *DPRBACKGROUNDVAR) ( DWORD dwDevice, int on ); BOOL (__stdcall *DPRREALTIMEEX) ( DWORD dwDevice, long mask, UINT period, int on ); int (__stdcall *DOWNLOADA) ( DWORD dwDevice, DOWNLOADMSGPROC msgp, DOWNLOADGETPROC getp, DOWNLOADPROGRESS ppgr, PCHAR filename, BOOL macro, BOOL map, BOOL log, BOOL dnld ); int (__stdcall *DOWNLOAD_SHOWPROGRESS)(BOOL bDoChecksums,BOOL bAlwaysShow,HWND hWnd, DWORD dwDevice, PCHAR filename, BOOL macro, BOOL map, BOOL log, BOOL dnld ); int (__stdcall *DOWNLOADTHREADA) ( DWORD dwDevice, DOWNLOADMSGPROC msgp, DOWNLOADGETPROC getp, DOWNLOADPROGRESS ppgr, PCHAR filename, BOOL macro, BOOL map, BOOL log, BOOL dnld ); int (__stdcall *DOWNLOADW) ( DWORD dwDevice, DOWNLOADMSGPROC msgp, DOWNLOADGETPROC getp, DOWNLOADPROGRESS ppgr, PWCHAR fname, BOOL macro, BOOL map, BOOL log, BOOL dnld ); void (__stdcall *DOWNLOADFILE) ( DWORD dwDevice, char *fname ); BOOL (__stdcall *COMPILEPLCC) ( DWORD dwDevice, char *plccName, char *outName ); BOOL (__stdcall *WRITEDICTIONARY) ( const char *tblName, PMACRO * root ); BOOL (__stdcall *READDICTIONARY) ( const char *tblName, PMACRO * root ); int (__stdcall *DOWNLOADFIRMWAREFILE) ( DWORD dwDevice, char *cFilename, DOWNLOADMSGPROC msgp ); void (__stdcall *ABORTDOWNLOAD) ( DWORD dwDevice ); void (__stdcall *SETMAXDOWNLOADERRORS) ( UINT max ); void (__stdcall *DPRSTATUS) ( DWORD dwDevice, UINT *comm, UINT *bg, UINT *bgv, UINT *rt, UINT *cp, UINT *rot ); // Lips stuff long (__stdcall *WHYMOTORNOTMOVING) ( DWORD dwDevice, UINT motor ); LPCSTR( __stdcall *WHYMOTORNOTMOVINGSTRING ) ( long err ); long (__stdcall *WHYMOTORNOTMOVINGTURBO) ( DWORD dwDevice, UINT motor ); LPCSTR (__stdcall *WHYMOTORNOTMOVINGSTRINGTURBO) ( long err ); long (__stdcall *WHYCSNOTMOVING) ( DWORD dwDevice, UINT CS ); LPCSTR (__stdcall *WHYCSNOTMOVINGSTRING) ( long err ); LPCSTR (__stdcall *WHYCSNOTMOVINGSTRINGTURBO) ( long err ); long (__stdcall *WHYCSNOTMOVINGTURBO) ( DWORD dwDevice, UINT CS ); int (__stdcall *INITDATAGARHERING) ( DWORD dwDevice, int size ); int (__stdcall *STARTGATHER) ( DWORD dwDevice ); int (__stdcall *STOPGATHER) ( DWORD dwDevice ); int (__stdcall *IGETNUMGATHERSAMPLES) ( DWORD dwDevice ); BOOL (__stdcall *GETBITVALUE) ( char *s, int bit ); long (__stdcall *HEXLONG2) ( char *in_str, int str_ln ); BOOL (__stdcall *INBUFFEREDMODE) ( DWORD dwDevice ); // Numeric read/write functions // Standard PVOID (__stdcall *PMACDPRGETMEM)( DWORD dwDevice, DWORD offset, size_t count, PVOID val ); PVOID (__stdcall *PMACDPRSETMEM)( DWORD dwDevice, DWORD offset, size_t count, PVOID val ); WORD (__stdcall *DPRGETWORD) ( DWORD dwDevice, UINT offset ); void (__stdcall *DPRSETWORD) ( DWORD dwDevice, UINT offset, WORD val ); DWORD (__stdcall *DPRGETDWORD) ( DWORD dwDevice, UINT offset ); void (__stdcall *DPRSETDWORD) ( DWORD dwDevice, UINT offset, DWORD val ); float (__stdcall *DPRGETFLOAT) ( DWORD dwDevice, UINT offset ); void (__stdcall *DPRSETFLOAT) ( DWORD dwDevice, UINT offset, double val ); // Masking BOOL (__stdcall *DPRDWORDBITSET) ( DWORD dwDevice, UINT offset, UINT bit ); void (__stdcall *DPRSETDWORDBIT) ( DWORD dwDevice, UINT offset, UINT bit ); void (__stdcall *DPRRESETDWORDBIT) ( DWORD dwDevice, UINT offset, UINT bit ); void (__stdcall *DPRSETDWORDMASK) ( DWORD dwDevice, UINT offset, DWORD val, BOOL onoff ); DWORD (__stdcall *DPRGETDWORDMASK) ( DWORD dwDevice, UINT offset, DWORD val ); double (__stdcall *DPRFLOAT) ( long d[], double scale ); double (__stdcall *DPRLFIXED) ( long d[], double scale ); long (__stdcall *DPRADDRESSRANGE) ( DWORD dwDevice, BOOL Upper, BOOL PC_offsets ); double (__stdcall *DPRCOMMANDED) ( DWORD dwDevice, int coord, char axchar ); double (__stdcall *DPRVELOCITY) ( DWORD dwDevice, int mtr, double units ); double (__stdcall *DPRVECTORVELOCITY) ( DWORD dwDevice, int num, int mtr[], double units[] ); BOOL (__stdcall *DPRSETBACKGROUND) ( DWORD dwDevice ); // Functions pertaining to coord systems long (__stdcall *DPRPE) ( DWORD dwDevice, int cs ); BOOL (__stdcall *DPRROTBUFFULL) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRSYSINPOSITION) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRSYSWARNFERROR) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRSYSFATALFERROR) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRSYSRUNTIMEERROR) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRSYSCIRCLERADERROR) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRSYSAMPFAULTERROR) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRPROGRUNNING) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRPROGSTEPPING) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRPROGCONTMOTION) ( DWORD dwDevice, int crd ); BOOL (__stdcall *DPRPROGCONTREQUEST) ( DWORD dwDevice, int crd ); int (__stdcall *DPRPROGREMAINING) ( DWORD dwDevice, int crd ); // Functions pertaining to individual motors // Background-Functions pertaining to individual motors BOOL (__stdcall *DPRAMPENABLED) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRWARNFERROR) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRFATALFERROR) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRAMPFAULT) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRONPOSITIONLIMIT) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRHOMECOMPLETE) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRINPOSITION) ( DWORD dwDevice, int mtr ); double (__stdcall *DPRGETTARGETPOS) ( DWORD dwDevice, int motor, double posscale ); double (__stdcall *DPRGETBIASPOS) ( DWORD dwDevice, int motor, double posscale ); long (__stdcall *DPRTIMEREMINMOVE) ( DWORD dwDevice, int cs ); long (__stdcall *DPRTIMEREMINTATS) ( DWORD dwDevice, int cs ); // Logical query functions PROGRAM (__stdcall *DPRGETPROGRAMMODE) ( DWORD dwDevice, int csn ); MOTIONMODE (__stdcall *DPRGETMOTIONMODE) ( DWORD dwDevice, int csn ); //////////////////////////////////////////////////////////////////////////// // DPR Control Panel functions //////////////////////////////////////////////////////////////////////////// BOOL (__stdcall *DPRCONTROLPANEL) ( DWORD dwDevice, long on ); void (__stdcall *DPRSETJOGPOSBIT) ( DWORD dwDevice, long motor, long onoff ); long (__stdcall *DPRGETJOGPOSBIT) ( DWORD dwDevice, long motor ); void (__stdcall *DPRSETJOGNEGBIT) ( DWORD dwDevice, long motor, long onoff ); long (__stdcall *DPRGETJOGNEGBIT) ( DWORD dwDevice, long motor ); void (__stdcall *DPRSETJOGRETURNBIT) ( DWORD dwDevice, long motor, long onoff ); long (__stdcall *DPRGETJOGRETURNBIT) ( DWORD dwDevice, long motor ); void (__stdcall *DPRSETRUNBIT) ( DWORD dwDevice, long cs, long onoff ); long (__stdcall *DPRGETRUNBIT) ( DWORD dwDevice, long cs ); void (__stdcall *DPRSETSTOPBIT) ( DWORD dwDevice, long cs, long onoff ); long (__stdcall *DPRGETSTOPBIT) ( DWORD dwDevice, long cs ); void (__stdcall *DPRSETHOMEBIT) ( DWORD dwDevice, long cs, long onoff ); long (__stdcall *DPRGETHOMEBIT) ( DWORD dwDevice, long cs ); void (__stdcall *DPRSETHOLDBIT) ( DWORD dwDevice, long cs, long onoff ); long (__stdcall *DPRGETHOLDBIT) ( DWORD dwDevice, long cs ); long (__stdcall *DPRGETSTEPBIT) ( DWORD dwDevice, long cs ); void (__stdcall *DPRSETSTEPBIT) ( DWORD dwDevice, long cs, long onoff ); long (__stdcall *DPRGETREQUESTBIT) ( DWORD dwDevice, long mtrcrd ); void (__stdcall *DPRSETREQUESTBIT) ( DWORD dwDevice, long mtrcrd, long onoff ); long (__stdcall *DPRGETFOENABLEBIT) ( DWORD dwDevice, long cs ); void (__stdcall *DPRSETFOENABLEBIT) ( DWORD dwDevice, long cs, long on_off ); void (__stdcall *DPRSETFOVALUE) ( DWORD dwDevice, long cs, long value ); long (__stdcall *DPRGETFOVALUE) ( DWORD dwDevice, long cs ); //////////////////////////////////////////////////////////////////////////// // DPR Real Time Data Buffer functions //////////////////////////////////////////////////////////////////////////// void (__stdcall *DPRSETHOSTBUSYBIT) ( DWORD dwDevice, int value ); int (__stdcall *DPRGETHOSTBUSYBIT) ( DWORD dwDevice ); int (__stdcall *DPRGETPMACBUSYBIT) ( DWORD dwDevice ); int (__stdcall *DPRGETSERVOTIMER) ( DWORD dwDevice ); void (__stdcall *DPRSETMOTORS) ( DWORD dwDevice, UINT n ); double (__stdcall *DPRGETCOMMANDEDPOS) ( DWORD dwDevice, int mtr, double units ); double (__stdcall *DPRPOSITION) ( DWORD dwDevice, int i, double units ); double (__stdcall *DPRNETACTUALPOSITION) ( DWORD dwDevice, int mtr, double units ); double (__stdcall *DPRFOLLOWERROR) ( DWORD dwDevice, int mtr, double units ); double (__stdcall *DPRGETVEL) ( DWORD dwDevice, int mtr, double units ); void (__stdcall *DPRGETMASTERPOS) ( DWORD dwDevice, int mtr, double units, double *the_double ); void (__stdcall *DPRGETCOMPENSATIONPOS) ( DWORD dwDevice, int mtr, double units, double *the_double ); DWORD (__stdcall *DPRGETPREVDAC) ( DWORD dwDevice, int mtr ); DWORD (__stdcall *DPRGETMOVETIME) ( DWORD dwDevice, int mtr ); //Gather Time Buffer-Functions pertaining to individual motors struct ss( __stdcall *DPRMOTORSERVOSTATUS ) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRDATABLOCK) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRPHASEDMOTOR) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRMOTORENABLED) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRHANDWHEELENABLED) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPROPENLOOP) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRONNEGATIVELIMIT) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *DPRONPOSITIVELIMIT) ( DWORD dwDevice, int mtr ); void (__stdcall *DPRSETJOGRETURN) ( DWORD dwDevice, int mtr ); // Logical query functions MOTION (__stdcall *DPRGETMOTORMOTION) ( DWORD dwDevice, int mtr ); // Functions pertaining to coord systems BOOL (__stdcall *DPRMOTIONBUFOPEN) ( DWORD dwDevice ); BOOL (__stdcall *DPRROTBUFOPEN) ( DWORD dwDevice ); double (__stdcall *DPRGETFEEDRATEMODE) ( DWORD dwDevice, int csn, BOOL *mode ); // Function pertaining to global BOOL (__stdcall *DPRSYSSERVOERROR) ( DWORD dwDevice ); BOOL (__stdcall *DPRSYSREENTRYERROR) ( DWORD dwDevice ); BOOL (__stdcall *DPRSYSMEMCHECKSUMERROR) ( DWORD dwDevice ); BOOL (__stdcall *DPRSYSPROMCHECKSUMERROR) ( DWORD dwDevice ); void (__stdcall *DPRGETGLOBALSTATUS ) ( DWORD dwDevice,void *); BOOL (__stdcall *INTRSETUPMASK) (DWORD dwDevice, ULONG ulMask); BOOL (__stdcall *INTRINIT) ( DWORD dwDevice, DWORD dwCallback, DWORD dwFlags, DWORD dwUser, ULONG mask ); BOOL (__stdcall *INTRTERMINATE) ( DWORD dwDevice ); BOOL (__stdcall *INTRWNDMSGINIT) ( DWORD dwDevice, HWND hWnd, UINT msg, ULONG ulMask ); DWORD (__stdcall *INTRTHREADINIT) ( DWORD *dwDev ); BOOL (__stdcall *INTRFUNCCALLINIT) ( DWORD dwDevice, PMACINTRPROC pFunc, DWORD msg, ULONG ulMask ); VOID( __stdcall *INTR__stdcall ) ( DWORD dwDevice ); VOID (__stdcall *INTRQUEUE) ( DWORD dwDevice, DWORD dwEvent ); VOID (__stdcall *INTRCOMPLETE) ( DWORD dwDevice, DWORD dwEvent ); BOOL (__stdcall *INTRPROCESSFUNCTION) ( DWORD dwDevice, MCFUNC Func, DWORD Param, LPDWORD pResult ); */ /*****************************************************************************/ //************************************** // DPR Binary rotary buffer functions // Initialization/shutdown /* SHORT (__stdcall *DPRROTBUFINIT) ( DWORD dwDevice, USHORT bufnum ); SHORT (__stdcall *DPRROTBUFREMOVE) ( DWORD dwDevice, USHORT bufnum ); SHORT (__stdcall *DPRROTBUFCHANGE) ( DWORD dwDevice, USHORT bufnum, USHORT new_size ); void (__stdcall *DPRROTBUFCLR) ( DWORD dwDevice, USHORT bufnum ); SHORT (__stdcall *DPRROTBUF) ( DWORD dwDevice, BOOL on ); int (__stdcall *DPRBUFLAST) ( DWORD dwDevice ); // Transfer functions SHORT (__stdcall *DPRASCIISTRTOROTA) ( DWORD dwDevice, PCHAR inpstr, USHORT bufnum ); SHORT (__stdcall *DPRASCIISTRTOROTEX) ( DWORD dwDevice, PCHAR inpstr, USHORT bufnum, BOOL bSendRemaining ); SHORT (__stdcall *DPRSENDBINARYCOMMANDA) ( DWORD dwDevice, PCHAR inpstr, USHORT bufnum ); SHORT (__stdcall *DPRASCIISTRTOBINARYFILEA) ( PCHAR inpstr, FILE * outfile ); SHORT (__stdcall *DPRASCIISTRTOROTW) ( DWORD dwDevice, PWCHAR inpstr, USHORT bufnum ); SHORT (__stdcall *DPRSSNDBINARYCOMMANDW) ( DWORD dwDevice, PWCHAR inpstr, USHORT bufnum ); SHORT (__stdcall *DPRASCIISTRTOBINARYFILEW) ( PWCHAR inpstr, FILE * outfile ); SHORT (__stdcall *DPRASCIIFILETOROT) ( DWORD dwDevice, FILE * inpfile, USHORT bufnum ); SHORT (__stdcall *DPRBINARYFILETOROT) ( DWORD dwDevice, FILE * inpfile, USHORT bufnum ); SHORT (__stdcall *DPRASCIITOBINARYFILE) ( FILE * inpfile, FILE * outfile ); SHORT (__stdcall *DPRBINARYTOROT) ( DWORD dwDevice, WORD *inpbinptr, WORD **outbinptr, WORD bufnum ); // Variable Background Buffer Functions // Initialization long (__stdcall *DPRVARBUFINIT) ( DWORD dwDevice, long new_num_entries, PLONG addrarray ); long (__stdcall *DPRVARBUFINITEX) ( DWORD dwDevice, long new_num_entries, PLONG addrarray, PUINT addrtype ); BOOL (__stdcall *DPRVARBUFREMOVE) ( DWORD dwDevice, long h ); BOOL (__stdcall *DPRVARBUFCHANGE) ( DWORD dwDevice, long handle, long new_num_entries, long *addrarray ); BOOL (__stdcall *DPRVARBUFCHANGEEX) ( DWORD dwDevice, long handle, long new_num_entries, long *addrarray, PUINT addrtype ); BOOL (__stdcall *DPRVARBUFREAD) ( DWORD dwDevice, long h, long entry_num, PLONG long_2 ); BOOL (__stdcall *DPRVARBUFREADEX) ( DWORD dwDevice, long h, PLONG long_x ); long (__stdcall *DPRGETVBGADDRESS) ( DWORD dwDevice, long h, long entry_num ); long (__stdcall *DPRGETVBGNUMENTRIES) ( DWORD dwDevice, long h ); long (__stdcall *DPRGETVBGDATAOFFSET) ( DWORD dwDevice, long h ); long (__stdcall *DPRGETVBGADDROFFSET) ( DWORD dwDevice, long h ); // Both UINT (__stdcall *DPRGETVBGSERVOTIMER) ( DWORD dwDevice ); UINT (__stdcall *DPRGETVBGSTARTADDR) ( DWORD dwDevice ); int (__stdcall *DPRGETVBGTOTALENTRIES) ( DWORD dwDevice ); int (__stdcall *DPRWRITEBUFFER) ( DWORD dwDevice, int num_entries, struct VBGWFormat * the_data ); int (__stdcall *DPRWRITEBUFFEREX) ( DWORD dwDevice, int num_entries, struct VBGWFormat * the_data, long *addresses, UINT *types ); void (__stdcall *DOWNLOADGANTRYAUTOTUNINGPLC) ( DWORD dwDevice, DWORD dwMotor1, DWORD dwMotor2, BOOL current_loop_used, BOOL bypass_jog, float maxtravel, long lTime ); void (__stdcall *DOWNLOADGANTRYSTEPPLC) ( DWORD dwDevice, DWORD dwMotor1, DWORD dwMotor2 ); void (__stdcall *DOWNLOADGANTRYPARABOLICPLC) ( DWORD dwDevice, DWORD dwMotor1, DWORD dwMotor2 ); //////////////////////////////////////////////////////////////////////////// // Data Gather functions //////////////////////////////////////////////////////////////////////////// UINT (__stdcall *GETGATHERPERIOD) ( DWORD dwDevice ); double (__stdcall *GETGATHERSAMPLETIME) ( DWORD dwDevice ); UINT (__stdcall *GETNUMGATHERSOURCES) ( DWORD dwDevice ); UINT (__stdcall *GETNUMGATHERSAMPLES) ( DWORD dwDevice ); UINT (__stdcall *SETGATHERPERIOD) ( DWORD dwDevice, UINT msec ); double (__stdcall *SETGATHERSAMPLETIME) ( DWORD dwDevice, double msec ); BOOL (__stdcall *SETGATHERENABLE) ( DWORD dwDevice, UINT num, BOOL ena ); BOOL (__stdcall *GETGATHERENABLE) ( DWORD dwDevice, UINT num ); BOOL (__stdcall *SETCURRENTGATHER) ( DWORD dwDevice, UINT mask, BOOL ena ); BOOL (__stdcall *SETGATHER) ( DWORD dwDevice, UINT num, LPSTR str, BOOL ena ); BOOL (__stdcall *SETQUICKGATHER) ( DWORD dwDevice, UINT mask, BOOL ena ); BOOL (__stdcall *SETQUICKGATHEREX) ( DWORD dwDevice, PWTG_EX mask, BOOL ena ); BOOL (__stdcall *SETQGWITHDIRECTCUR) ( DWORD dwDevice, UINT mask, BOOL ena ); BOOL (__stdcall *SETQGWITHDIRECTCUREX) ( DWORD dwDevice, PWTG_EX mask, BOOL ena ); BOOL (__stdcall *GETGATHER) ( DWORD dwDevice, UINT num, LPSTR str, UINT maxchar ); void (__stdcall *CLEARGATHER) ( DWORD dwDevice ); BOOL (__stdcall *INITGATHER) ( DWORD dwDevice, UINT size, double msec ); void (__stdcall *CLEARGATHERDATA) ( DWORD dwDevice ); double * ( __stdcall *COLLECTGATHERDATA ) ( DWORD dwDevice, PUINT sources, PUINT samples ); BOOL (__stdcall *GETGATHERSAMPLES) ( DWORD dwDevice, UINT source, PUINT sample, double *p, UINT max ); BOOL (__stdcall *GETGATHERPOINT) ( DWORD dwDevice, UINT source, UINT sample, double *p ); int (__stdcall *STARTGATHER) ( DWORD dwDevice ); int (__stdcall *STOPGATHER) ( DWORD dwDevice ); // Real time BOOL (__stdcall *INITRTGATHER) ( DWORD dwDevice ); void (__stdcall *CLEARRTGATHER) ( DWORD dwDevice ); BOOL (__stdcall *ADDRTGATHER) ( DWORD dwDevice, ULONG val ); double * ( __stdcall *COLLECTRTGATHERDATA ) ( DWORD dwDevice, PUINT sources ); DWORD (__stdcall *ULTRALIGHTANALYZE)( DWORD dwDevice,ULTRALIGHT_INFO * ui); BOOL (__stdcall *MACROUPLOADCONFIG) ( DWORD dwDevice, DOWNLOADPROGRESS prgp, char *fname ); long (__stdcall *MACROGETIVARIABLELONG) ( DWORD dwDevice, DWORD node, UINT num, long def ); BOOL (__stdcall *MACROSETIVARIABLESTRING)( DWORD dwDevice, DWORD node, UINT num, char *szMIVarValue); PCHAR (__stdcall *MACROGETIVARIABLESTRING)( DWORD dwDevice, DWORD node, UINT num, PCHAR def ); BOOL (__stdcall *AMPENABLED) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *AMPFAULT) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *ONNEGATIVELIMIT) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *ONPOSITIVELIMIT) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *FATALFERROR) ( DWORD dwDevice, int mtr ); double (__stdcall *FOLLOWERROR) ( DWORD dwDevice, int mtr, double units ); BOOL (__stdcall *PHASEDMOTOR) ( DWORD dwDevice, int mtr ); BOOL (__stdcall *GETMOTORSTATUS) (DWORD dwDevice,UINT mtr,DWORD *status); BOOL (__stdcall* VMETESTOPENPMACDEVICE)(DWORD dwDevice,BOOL bMailboxOnly); BOOL (__stdcall* VMETESTCLOSEPMACDEVICE)(DWORD dwDevice); BOOL (__stdcall* VMESETUP)(DWORD SERIALDev, DWORD VMEDev); */ #endif