Method class to access API UserDll
Option API UserDll allows the user to develop user defined dlls.
Each UserDll must be defined in the configuration file config.dat
, see also inq_UserDll_number() and is loaded dynamically when EASY-ROB™ starts.
The UserDll must export the following three
functions (OpenDialog(), ProglineUpdate(), AuxUpdate()), to allow EASY-ROB™ to communicate with the UserDll.
More...
#include <ER_CAPI.H>
|
static ER_DllExport int | inq_UserDll_number () |
| Get number of loaded API UserDlls
Each API UserDll is defined in the configuration file config.dat
LIBRARY_PATH= .\ path of UserDlls
USER_DLL= dll_name dll_start user_name
USER_DLL= ...
dll_name contains the dll file name
The dll_start is 0 is the dll should be startet manually by the user or 1 if the dll starts immediatly with EASY-ROB
user_name contains an explanation string for the dll, appearing in the dialogs. More...
|
|
static ER_DllExport char * | inq_UserDll_dll_name (int userdll_idx) |
| Access dll name for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
See configuration file config.dat . More...
|
|
static ER_DllExport char * | inq_UserDll_user_name (int userdll_idx) |
| Access user name for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
See configuration file config.dat . More...
|
|
static ER_DllExport int | inq_UserDll_dll_status (int userdll_idx) |
| Get dll_status for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
The dll_status is one of DLL_STATUS_INVALID=0, DLL_STATUS_OPEN=1, DLL_STATUS_CLOSE=2, DLL_STATUS_STRT_AUTO=3
. More...
|
|
static ER_DllExport void ** | inq_UserDll_usr_ptr (int userdll_idx) |
| access user pointer for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
More...
|
|
static ER_DllExport int | set_callback_AuxUpdate (int callback_fct_id, int(*callback_AuxUpdate)(int idx, int sub_idx)) |
| Defines callback fct pointer array for AuxUpdate
Parameter callback_fct_id is zero based in [0..USER_DLL_CALLBACK_AUXUPDATE_MAX-1]
Parameter callback_AuxUpdate points to callback function.
Prototype: int MyAuxUpdate_fct (int idx, int sub_idx)
To unset the callback fct, set callback_AuxUpdate = NULL. More...
|
|
static ER_DllExport int | set_callback_ProglineUpdate (int callback_fct_id, int(*callback_ProglineUpdate)(char *progline)) |
| Defines callback fct pointer array for ProglineUpdate
Parameter callback_fct_id is zero based in [0..USER_DLL_CALLBACK_PROGLINEUPDATE_MAX-1]
Parameter callback_ProglineUpdate points to callback function.
Prototype: int MyProglineUpdate_fct (char *progline)
To unset the callback fct, set callback_ProglineUpdate = NULL. More...
|
|
|
static ER_CAPI_SYS_UTILITIES | er_capi_sys_utilities |
| Method class for helping functions, color conversion, etc. More...
|
|
static ER_CAPI_SYS_MATHEMATICS | er_capi_sys_mathematics |
| Method class for mathematical calculations, multiplications of homogeneous matrices, conversion Euler angle, triangle calculations, formula parser, etc. More...
|
|
static ER_CAPI_SYS_VIEW | er_capi_sys_view |
| Method class for graphical update of the 3D scene, refreshing dialogs, etc. More...
|
|
static ER_CAPI_SYS_PREVIEW | er_capi_sys_preview |
| Method class for the CAD-Preview. More...
|
|
static ER_CAPI_SYS_STATUS | er_capi_sys_status |
| Method class for unloading objects (work cells, robots, tools, programs, etc.) simulation status. More...
|
|
static ER_CAPI_SYS_UNITS | er_capi_sys_units |
| Method class for setting and calculating units. More...
|
|
static ER_CAPI_SYS_USERDLL | er_capi_sys_userdll |
| Method class to access API UserDll. More...
|
|
static ER_CAPI_SYS_APIDLL | er_capi_sys_apidll |
| Method class to access API Dll for inverse kinematics, robot trajectory planner and robot dynamics. More...
|
|
static ER_CAPI_USER_IO | er_capi_user_io |
| Method class for interaction with EASY-ROB. More...
|
|
static ER_CAPI_DEVICES | er_capi_devices |
| Method class to create, attach, update devices, for kinematics calculations and for trajectory planning and -execution. More...
|
|
static ER_CAPI_SIM | er_capi_sim |
| Method class for simulation settings. More...
|
|
static ER_CAPI_TARGETS | er_capi_targets |
| Method class for paths and tags. More...
|
|
static ER_CAPI_CAD | er_capi_cad |
| Method class for for 3D CAD Data import and -export, changing attributes and positions. More...
|
|
static ER_CAPI_SYS | er_capi_sys |
| Method class for mathematical calculations, simulation status, units. More...
|
|
Method class to access API UserDll
Option API UserDll allows the user to develop user defined dlls.
Each UserDll must be defined in the configuration file config.dat
, see also inq_UserDll_number() and is loaded dynamically when EASY-ROB™ starts.
The UserDll must export the following three
functions (OpenDialog(), ProglineUpdate(), AuxUpdate()), to allow EASY-ROB™ to communicate with the UserDll.
- EXPORT_C int OpenDialog( CWnd *pParent )
OpenDialog is called once and allows the user to allocate memory and open a non modal dialog inside the EASY-ROB™ window
If the dialog is closed and (re)opened, OpenDialog() is called again.
Even if this function does nothing, it must return 0 for OK.
static CErVadDialog *pDlg=NULL;
#define EXPORT_C extern "C" __declspec( dllexport )
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (pDlg==NULL)
{
pDlg = new CErVadDialog(pParent);
if (pDlg==NULL) {
AfxMessageBox("Cannot open Dialog",MB_OK);
return 1;
}
if (pDlg->Create(pDlg->m_nID,pDlg->m_pParent)==0)
return 1;
return 0;
}
else {
AfxMessageBox("Dialog already opened",MB_OK);
return 1;
}
...
}
- Parameters
-
[in] | pParent | contains the handle from the parent window
|
- Return values
-
- EXPORT_C int ProglineUpdate( char *progline )
ProglineUpdate is called at every new executed program line
EXPORT_C int ProglineUpdate(
char *progline)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (pDlg==NULL) {
_info_line_msg(0,"ProglineUpdate() failed");
return 1;
}
pDlg->SetDlgItemText(IDC_STATIC_PROLINEUPDATE,progline);
return 0;
...
}
- Parameters
-
[in] | progline | contains the current executed program command
|
- Return values
-
- EXPORT_C int AuxUpdate( int idx, int sub_id )
AuxUpdate will be called for different reasons.
static int this_dgl_idx = 0;
EXPORT_C int AuxUpdate(
int idx,
int sub_idx)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (pDlg==NULL) {
_info_line_msg(0,"AuxUpdate() failed");
return 1;
}
static int cnt=0;
switch (idx) {
break;
sprintf(b,"%d AuxUpdate Idx = %d Exit Application",++cnt,idx);
pDlg->SetDlgItemText(IDC_STATIC_AUXUPDATE,b);
break;
break;
break;
sprintf(b,"%d AuxUpdate Idx = %d Dlg Idx %d",++cnt,idx,sub_idx);
this_dgl_idx = sub_idx;
pDlg->SetDlgItemText(IDC_STATIC_AUXUPDATE,b);
break;
break;
break;
default:
sprintf(b,"%d AuxUpdate Idx = %d ?",++cnt,idx);
pDlg->SimUpdateDlg(b);
break;
}
...
return 0;
}
- Parameters
-
- Return values
-
◆ inq_UserDll_dll_name()
static ER_DllExport char* ER_CAPI_SYS_USERDLL::inq_UserDll_dll_name |
( |
int |
userdll_idx | ) |
|
|
static |
Access dll name for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
See configuration file config.dat
.
- Parameters
-
[in] | userdll_idx | UserDll index [1.. number of loaded UserDlls] |
- Return values
-
pointer | to dll file name with path |
NULL | if failed |
◆ inq_UserDll_dll_status()
static ER_DllExport int ER_CAPI_SYS_USERDLL::inq_UserDll_dll_status |
( |
int |
userdll_idx | ) |
|
|
static |
◆ inq_UserDll_number()
static ER_DllExport int ER_CAPI_SYS_USERDLL::inq_UserDll_number |
( |
| ) |
|
|
static |
Get number of loaded API UserDlls
Each API UserDll is defined in the configuration file config.dat
LIBRARY_PATH= .\ path of UserDlls
USER_DLL= dll_name dll_start user_name
USER_DLL= ...
dll_name contains the dll file name
The dll_start is 0 is the dll should be startet manually by the user or 1 if the dll starts immediatly with EASY-ROB
user_name contains an explanation string for the dll, appearing in the dialogs.
- Return values
-
number | of loaded API UserDlls |
◆ inq_UserDll_user_name()
static ER_DllExport char* ER_CAPI_SYS_USERDLL::inq_UserDll_user_name |
( |
int |
userdll_idx | ) |
|
|
static |
Access user name for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
See configuration file config.dat
.
for (i=1;i<=n;i++)
{
MY_STRUCT *udll_usr = (MY_STRUCT *)*udll_usr_ptr;
i,
udll_usr==NULL?"NULL":"not NULL"
);
}
...
- Parameters
-
[in] | userdll_idx | UserDll index [1.. number of loaded UserDlls] |
- Return values
-
pointer | to user_name |
NULL | if failed |
◆ inq_UserDll_usr_ptr()
static ER_DllExport void** ER_CAPI_SYS_USERDLL::inq_UserDll_usr_ptr |
( |
int |
userdll_idx | ) |
|
|
static |
access user pointer for API UserDlls
The number of currently loaded UserDll can be retrieved with inq_UserDll_number()
int userdll_idx = 1;
MY_STRUCT *udll_usr = (MY_STRUCT *)*udll_usr_ptr;
if (udll_usr==NULL)
{
udll_usr = new MY_STRUCT;
*udll_usr_ptr = (void *)udll_usr;
}
else
{
if (udll_usr) {
delete udll_usr;
udll_usr=NULL;
*udll_usr_ptr = (void *)udll_usr;
}
}
...
- Parameters
-
[in] | userdll_idx | UserDll index [1.. number of loaded UserDlls] |
- Return values
-
pointer | to user pointer |
NULL | if failed |
◆ set_callback_AuxUpdate()
static ER_DllExport int ER_CAPI_SYS_USERDLL::set_callback_AuxUpdate |
( |
int |
callback_fct_id, |
|
|
int(*)(int idx, int sub_idx) |
callback_AuxUpdate |
|
) |
| |
|
static |
Defines callback fct pointer array for AuxUpdate
Parameter callback_fct_id
is zero based in [0..USER_DLL_CALLBACK_AUXUPDATE_MAX-1]
Parameter callback_AuxUpdate
points to callback function.
Prototype: int MyAuxUpdate_fct (int idx, int sub_idx)
To unset the callback fct, set callback_AuxUpdate = NULL.
- Parameters
-
- Return values
-
◆ set_callback_ProglineUpdate()
static ER_DllExport int ER_CAPI_SYS_USERDLL::set_callback_ProglineUpdate |
( |
int |
callback_fct_id, |
|
|
int(*)(char *progline) |
callback_ProglineUpdate |
|
) |
| |
|
static |
Defines callback fct pointer array for ProglineUpdate
Parameter callback_fct_id
is zero based in [0..USER_DLL_CALLBACK_PROGLINEUPDATE_MAX-1]
Parameter callback_ProglineUpdate
points to callback function.
Prototype: int MyProglineUpdate_fct (char *progline)
To unset the callback fct, set callback_ProglineUpdate = NULL.
- Parameters
-
- Return values
-
The documentation for this class was generated from the following file: