📄 m5.h
字号:
/*******************************************************************************
$Log: m5.h,v $
Revision 1.38 2000/07/04 08:09:51 mir
New commands included:
PCube_moveXXXExtended. They delivers the actual position, state and DIO
back.
The state is a reduced one and is mapped to the well known 32bit state.
The HOME-Flag is not present so check it seperately.
Revision 1.37 2000/04/27 13:14:05 spe
New Functions in m5.h for cubeversions from 3.5.08 and 2.5.13:
Get- and set-functions for incremental values;
define constants ACT_POS 0x5a to ACT_DELTAPOSINC 0x61.
Revision 1.36 2000/04/05 06:14:28 jae
nothing
Revision 1.35 2000/02/14 12:58:16 mir
Smal corrections to support UNIX/LINUX
Revision 1.34 2000/02/09 14:43:54 mir
Minor corrections to adapt to QNX
Revision 1.33 1999/11/25 15:40:26 jae
new TW-functions
Revision 1.32 1999/10/27 05:58:02 jae
New Function for HW3.5xx
PCube_get/sethomeoffset (for all devices)
PCube_moveRampInc,PCube_moveVelInc,PCube_moveStepInc,PCube_moveCurInc
New Parameter-IDs: IRAMP_MODE (0x09),ISTEP_MODE (0x0a),IVEL_MODE (0x0b),ITORQUE_MODE (0x0c)
Revision 1.31 1999/09/17 17:18:57 jae
new function PCube_getBurncount
new function PCube_getSetup
Revision 1.30 1999/09/07 11:10:57 jae
changing parameter-type in function TW_setIO/TW_getIO (val from UInt8 to float)
adding parameter in function assign_CobID
define TW-Moduls (0 to 5)
Revision 1.29 1999/09/01 11:58:55 mir
Device Forwarding implemented
Revision 1.28 1999/08/19 08:58:52 jae
Add new define MAXIO 51 Max account for TW-Modules
Revision 1.27 1999/08/11 05:26:52 jae
implement new drives IO_OUTPUT (0x1000) and IO_INPUT(0x2000) for later implementing of IO-units into moduls
Revision 1.26 1999/08/09 12:20:24 jae
*** empty log message ***
Revision 1.25 1999/08/05 07:39:51 mir
New Function added:
M5dll_AddError(device, level, Errorstring)
The showed debuglevel in the file and debugoutput is set by level=xx in the
initstring.
If you add a debuglevel via the AddError function and set it to 3 then you
are able to see this message only if you set the level=3 in the initstring
(of course you see debugoutput from level 1 and 2 too).
Some minor corrections in the typedefs. Byte is now removed and substituted
by BYTE.
Some Borland-specific corrections added.
Revision 1.24 1999/08/03 14:03:55 jae
add several return-values in prototyps
Revision 1.23 1999/08/03 10:34:23 mir
Commands to change the controller settings
Revision 1.22 1999/07/22 06:46:05 mir
New Command:
PCube_setAckMode(dev, mode): mode=0 normal
mode=1 disabled wait for acknowledge in all set commands
Revision 1.21 1999/07/21 07:12:38 mir
Vector ACPCI Support added
Revision 1.20 1999/07/16 13:14:45 mir
Returncodes added for wrong DeviceHandle and for
IM180 driver
Revision 1.19 1999/07/14 09:10:16 jae
Correction syntax-error
Revision 1.18 1999/07/14 04:53:59 jae
adding new errors (CLERR_STEPMODEUNKNOWN, CLERR_TIMEREVENTNOTCREATED)
Revision 1.17 1999/06/29 12:51:44 mir
GetRevision function added
Revision 1.16 1999/06/29 08:41:37 jae
add network errors (301-303)
describe no used Errors
Revision 1.15 1999/05/20 14:52:48 mir
*** empty log message ***
Revision 1.14 1999/05/12 13:21:51 mir
Changes in m5.h for usability in Visual Basic
Revision 1.13 1999/03/31 09:11:53 mir
Minor changes
Revision 1.12 1999/03/16 10:41:22 mir
*** empty log message ***
Revision 1.11 1999/03/02 07:15:26 mie
PCUBE Status ERR_BEYOND_SOFT ERR_BEYOND_HARD added
Revision 1.10 1999/03/01 10:03:09 mie
*** empty log message ***
Revision 1.9 1999/02/16 08:41:57 mir
*** empty log message ***
Revision 1.8 1999/02/11 15:13:26 mir
Nothing changed
Revision 1.7 1999/01/12 16:48:08 mir
M3 Compatibilty Functions included
Revision 1.6 1999/01/06 16:11:05 mir
*** empty log message ***
Revision 1.5 1999/01/05 16:03:43 mir
*** empty log message ***
Revision 1.4 1999/01/04 08:20:58 mir
Low-Level-Remote implemented
Revision 1.3 1998/12/16 12:39:57 mir
STATE_CPU_OVERLOAD added.
Revision 1.2 1998/12/14 10:45:15 cvs
First real import
(C)opyright 1999 by AMTEC GmbH
All rights reserved.
********************************************************************************/
#ifndef M5header
#define M5header
#ifdef M5DLL_EXPORTS // Only for DLL-generation
#define M5DLL_API __declspec(dllexport)
#else
#ifdef _MSC_VER // dll-import specifications
#if _MSC_VER>=1200 // Visual C++ 6.0
#define M5DLL_API __declspec(dllimport)
#else
#define M5DLL_API extern // Older compilers
#endif
#else
#define M5DLL_API // Older compilers
#endif
#endif
//***************************************************************************
//
// some convinient declarations
//
/*
typedef unsigned char UInt8;
typedef unsigned char Byte;
typedef signed short int Int16;
typedef unsigned short int UInt16;
typedef long Int32;
typedef unsigned long UInt32;
typedef float Float;
typedef signed short int CLDDriveID;
typedef signed short int CLDXtrnlID;
typedef char Bool;
typedef Int16 CLDRet;
*/
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifdef __BORLANDC__
//typedef void *HANDLE;
#define WINAPI __stdcall
#ifndef BYTE
typedef unsigned char BYTE;
#endif
#endif
#ifndef BYTE
typedef unsigned char BYTE;
#endif
#ifndef WINAPI
#define WINAPI __stdcall
#endif
/*
#ifndef HANDLE
typedef void *HANDLE;
#endif
*/
typedef void Void;
//typedef char Char;
//typedef unsigned char Byte;
typedef unsigned char UInt8;
typedef signed short int Int16;
typedef unsigned short int UInt16;
typedef long int Int32;
typedef unsigned long UInt32;
typedef float Float;
typedef char Bool;
typedef UInt16 CLDRet;
typedef Int16 CLDID;
typedef CLDID CLDDriveID;
typedef CLDID CLDXtrnlID;
typedef unsigned long Systime;
#ifdef LINUX
typedef unsigned char BYTE;
#define WINAPI
#define M5DLL_API
typedef long HANDLE;
#endif
typedef union
{
float f;
BYTE byte[4];
unsigned long l;
long sl;
//signed short int ss;
unsigned int i[2];
int si[2];
} XVal;
typedef struct // Just for Backward Compatibility
{ UInt16 romVersion; /* version of CronoCom ROM code */
char pDate[ 9 ]; /* date of compilation */
char pVersion[ 7 ]; /* CronoCom ROM version string */
char pSerNum[ 16 ]; /* CronoCom serial number */
} XtrnlSpec;
#define DIGPOWAMP 500
//***************************************************************************
//
// Movemodes of the modules
//
//enum { RAMP_MODE, POS_MODE, STEP_MODE, VEL_MODE, FRAMP_MODE, FPOS_MODE, FSTEP_MODE, FVEL_MODE,
// FTORQUE_MODE, IRAMP_MODE, IPOS_MODE, ISTEP_MODE, IVEL_MODE,ICUR_MODE };
#define RAMP_MODE 0x00
#define POS_MODE 0x01
#define STEP_MODE 0x02
#define VEL_MODE 0x03
#define FRAMP_MODE 0x04
#define FPOS_MODE 0x05
#define FSTEP_MODE 0x06
#define FVEL_MODE 0x07
#define FTORQUE_MODE 0x08
#define IRAMP_MODE 0x09
#define IPOS_MODE 0x0a
#define ISTEP_MODE 0x0b
#define IVEL_MODE 0x0c
#define ITORQUE_MODE 0x0d
#define FRAMP_ACK 0x0e
#define FPOS_ACK 0x0f
#define FSTEP_ACK 0x10
#define FVEL_ACK 0x11
#define FCUR_ACK 0x12
//***************************************************************************
//
// Function Prototypes
//
#ifdef __cplusplus
extern "C" {
#endif
//M5DLL_API int fnM5dll(void);
M5DLL_API int WINAPI PCube_openDevice( int* pDev, const char* pInitString );
M5DLL_API int WINAPI PCube_closeDevice( int dev);
M5DLL_API int WINAPI PCube_syncModule( int dev,int cube);
M5DLL_API int WINAPI PCube_haltModule( int dev,int cube);
M5DLL_API int WINAPI PCube_resetModule( int dev,int cube);
M5DLL_API int WINAPI PCube_getModulesCount(int dev, int *count);
M5DLL_API int WINAPI PCube_getModulesIdMap(int dev, int *idMap);
M5DLL_API int WINAPI PCube_getDefHomeOffset( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefGearRatio( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefLinearRatio( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMinPos( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMaxPos( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMaxDeltaPos( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMaxDeltaVel( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefTorqueRatio( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefCurRatio( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMinVel( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMaxVel( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMinAcc( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMaxAcc( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMinCur( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefMaxCur( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefHomeVel( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefHomeAcc( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefKpPosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefTnPosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefTvPosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefT1PosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefKpVelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefTnVelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefTvVelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefT1VelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getDefDioSetup( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getDefSerialNo( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getDefConfig( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getDefPulsesPerTurn( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getDefCubeVersion( int dev, int cube, UInt16* pValue );
M5DLL_API int WINAPI PCube_getDefServiceInterval( int dev, int cube, UInt16* pValue );
M5DLL_API int WINAPI PCube_getDefBrakeTimeOut( int dev, int cube, UInt16* pValue );
M5DLL_API int WINAPI PCube_getDefAddress( int dev, int cube, UInt8* pValue );
M5DLL_API int WINAPI PCube_getDefMoveMode( int dev, int cube, UInt8* pValue );
M5DLL_API int WINAPI PCube_getDefPrimaryBaudrate( int dev, int cube, UInt8* pValue );
M5DLL_API int WINAPI PCube_getDefSecondaryBaudrate( int dev, int cube, UInt8* pValue );
M5DLL_API int WINAPI PCube_getPosCountInc( int dev, int cube, Int32* pValue );
M5DLL_API int WINAPI PCube_getRefPosCountInc( int dev, int cube, Int32* pValue );
M5DLL_API int WINAPI PCube_getDioSetup( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getDioData( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getCubeState( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getTargetPos( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getTargetVel( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getTargetAcc( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getStepInc( int dev, int cube, Int32* pValue );
M5DLL_API int WINAPI PCube_getHomeOffsetInc( int dev, int cube, Int32* pValue );
M5DLL_API int WINAPI PCube_getKpPosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getTnPosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getTvPosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getT1PosControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getKpVelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getTnVelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getTvVelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getT1VelControl( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getRawCurrent( int dev, int cube, Int16* pValue );
M5DLL_API int WINAPI PCube_getHomeToZeroInc( int dev, int cube, Int32* pValue );
M5DLL_API int WINAPI PCube_getHourCount( int dev, int cube, UInt16* pValue );
M5DLL_API int WINAPI PCube_getAdeRawDAC( int dev, int cube, Int16* pValue );
M5DLL_API int WINAPI PCube_getConfig( int dev, int cube, UInt32* pValue );
M5DLL_API int WINAPI PCube_getMoveMode( int dev, int cube, UInt8* pValue );
M5DLL_API int WINAPI PCube_getIncRatio( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getActPos( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getActPos_( int dev, int cube, float* pValue );
M5DLL_API int WINAPI PCube_getIPolPos( int dev, int cube, float* pValue );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -