EASY-ROB™ Application Programming Interface  v8.008
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Static Public Member Functions | List of all members
ER_CAPI_SYS_USERDLL Class Reference

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>

Inheritance diagram for ER_CAPI_SYS_USERDLL:
ER_CAPI_SYS ER_CAPI

Static Public Member Functions

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...
 

Additional Inherited Members

- Static Public Attributes inherited from ER_CAPI_SYS
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 Public Attributes inherited from ER_CAPI
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...
 

Detailed Description

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.

  1. 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.
    // Example:
    static CErVadDialog *pDlg=NULL; // local UserDll dialog address, needs to be allocated here and destructed when closing the dialog
    #define EXPORT_C extern "C" __declspec( dllexport )
    EXPORT_C int OpenDialog(CWnd *pParent)
    // Return 0 - OK, 1 - failed
    // Note: Make sure, your Dialogs 'visibilty' is enabled
    {
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (pDlg==NULL)
    {
    pDlg = new CErVadDialog(pParent);
    if (pDlg==NULL) {
    AfxMessageBox("Cannot open Dialog",MB_OK);
    return 1; // Fail
    }
    // Start modless Dialog
    if (pDlg->Create(pDlg->m_nID,pDlg->m_pParent)==0)
    return 1; // Fail
    return 0; // Success
    }
    else {
    AfxMessageBox("Dialog already opened",MB_OK);
    return 1; // Fail
    }
    ...
    }
    Parameters
    [in]pParentcontains the handle from the parent window
    Return values
    0- OK
    1- failed
  2. EXPORT_C int ProglineUpdate( char *progline )
    ProglineUpdate is called at every new executed program line
    // Example:
    EXPORT_C int ProglineUpdate(char *progline)
    // Return 0 - OK, 1 - failed
    // ProglineUpdate is called at every new executed program line
    {
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (pDlg==NULL) {
    _info_line_msg(0,"ProglineUpdate() failed");
    return 1; // Fail
    }
    pDlg->SetDlgItemText(IDC_STATIC_PROLINEUPDATE,progline);
    return 0; // Success
    ...
    }
    Parameters
    [in]proglinecontains the current executed program command
    Return values
    0- OK
    1- failed
  3. EXPORT_C int AuxUpdate( int idx, int sub_id )
    AuxUpdate will be called for different reasons.
    // Example:
    static int this_dgl_idx = 0; // local UserDll dialog index [1.. number of loaded UserDlls], AUX_UPDATE_IDX_UDLL_DLG_IDX
    EXPORT_C int AuxUpdate(int idx,int sub_idx)
    // Return 0 - OK, 1 - failed
    // Note: Make sure, your Dialogs 'visibilty' is enabled
    {
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (pDlg==NULL) {
    _info_line_msg(0,"AuxUpdate() failed");
    return 1; // Fail
    }
    static int cnt=0;
    char b[::MAXSTR];
    switch (idx) {
    break;
    sprintf(b,"%d AuxUpdate Idx = %d Exit Application",++cnt,idx);
    pDlg->SetDlgItemText(IDC_STATIC_AUXUPDATE,b);
    break;
    //sprintf(b,"%d AuxUpdate Idx = %d -> SimUpdate",++cnt,idx);
    //pDlg->SetDlgItemText(IDC_STATIC_AUXUPDATE,b);
    break;
    //case AUX_UPDATE_IDX_UDLL_DLG_IDX:
    //case AUX_UPDATE_IDX_CART_SPACE_EXCEEDED:
    //case AUX_UPDATE_IDX_LOAD_GEO_ERROR:
    break;
    sprintf(b,"%d AuxUpdate Idx = %d Dlg Idx %d",++cnt,idx,sub_idx);
    this_dgl_idx = sub_idx; // store this UserDll dialog index [1.. number of loaded UserDlls]
    pDlg->SetDlgItemText(IDC_STATIC_AUXUPDATE,b);
    break;
    break;
    break;
    default:
    sprintf(b,"%d AuxUpdate Idx = %d ?",++cnt,idx);
    pDlg->SimUpdateDlg(b);
    break;
    }
    ...
    return 0; // Success
    }
    Parameters
    [in]idxallows to switch and decide what to do. idx is one of AUX_UPDATE_IDX_EXIT, AUX_UPDATE_IDX_SIMUPDATE, AUX_UPDATE_IDX_LOAD_CELL ... AUX_UPDATE_IDX_UDLL_DLG_IDX
    [in]sub_idxcontains additional information for each idx, in most cases it is 0.
    Return values
    0- OK
    1- failed

Member Function Documentation

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_idxUserDll index [1.. number of loaded UserDlls]
Return values
pointerto dll file name with path
NULLif failed
static ER_DllExport int ER_CAPI_SYS_USERDLL::inq_UserDll_dll_status ( int  userdll_idx)
static

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
.

Parameters
[in]userdll_idxUserDll index [1.. number of loaded UserDlls]
Return values
0- DLL_STATUS_INVALID
1- DLL_STATUS_OPEN
2- DLL_STATUS_CLOSE
3- DLL_STATUS_STRT_AUTO
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
numberof loaded API UserDlls
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.

// Example:
int i,n = er_sys_userdll.inq_UserDll_number(); // get number of loaded API UserDlls
for (i=1;i<=n;i++)
{
void **udll_usr_ptr = er_sys_userdll.inq_UserDll_usr_ptr(i); // access user pointer for UserDll
MY_STRUCT *udll_usr = (MY_STRUCT *)*udll_usr_ptr; // cast void pointer to own data type, to access the content
er_user_io_dialog._info_line_msg(0,"API UserDlls [%d]: dll_name ='%s' user_name ='%s' dll_status %d usr_ptr ='%s'",
i,
er_sys_userdll.inq_UserDll_dll_name(i),
er_sys_userdll.inq_UserDll_user_name(i),
er_sys_userdll.inq_UserDll_dll_status(i),
udll_usr==NULL?"NULL":"not NULL"
);
}
...
Parameters
[in]userdll_idxUserDll index [1.. number of loaded UserDlls]
Return values
pointerto user_name
NULLif failed
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()

// Example:
int userdll_idx = 1;
void **udll_usr_ptr = er_sys_userdll.inq_UserDll_usr_ptr(userdll_idx); // access user pointer for UserDll
MY_STRUCT *udll_usr = (MY_STRUCT *)*udll_usr_ptr; // cast void pointer to own data type, to access the content
if (udll_usr==NULL)
{
udll_usr = new MY_STRUCT;
*udll_usr_ptr = (void *)udll_usr; // copy new address
}
else
{
// use content of udll_usr
// or
// delete memory if done
if (udll_usr) {
delete udll_usr;
udll_usr=NULL;
*udll_usr_ptr = (void *)udll_usr; // copy new address
}
}
...
Parameters
[in]userdll_idxUserDll index [1.. number of loaded UserDlls]
Return values
pointerto user pointer
NULLif failed
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
[in]callback_fct_idin [0..USER_DLL_CALLBACK_AUXUPDATE_MAX-1]
[in]callback_AuxUpdate(int, int) callback function pointer
Return values
0- Ok
1- Error
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
[in]callback_fct_idin [0..USER_DLL_CALLBACK_PROGLINEUPDATE_MAX-1]
[in]callback_ProglineUpdate(char *) callback function pointer
Return values
0- Ok
1- Error

The documentation for this class was generated from the following file: