EtherCAT Slave
 
Loading...
Searching...
No Matches
ecSlvCiA402.h

CiA402 Application interface.

CiA402 Application interface.

Author
KUNBUS GmbH

Copyright (c) 2024 KUNBUS GmbH.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer./
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#if !(defined PROTECT_ECSLVCIA402_H)
#define PROTECT_ECSLVCIA402_H 1
#include <osal.h>
#include <ecSlvApi.h>
#include <ESL_os.h>
/*-----------------------------------------------------------------------------------------
------
------ Includes
------
-----------------------------------------------------------------------------------------*/
#define AXES_NUMBER (3u)
typedef struct EC_SLV_APP_sCIA_object
{
uint16_t objectIndex;
uint32_t pdoObjectOffset;
uint32_t pdoOffset;
{
uint16_t objectIndex;
uint8_t objectSubIndex;
{
/*EC_SLV_APP_sCIA_object_t abortConnectionOptionCodeIndex; not used */
/* EC_SLV_APP_sCIA_object_t haltOptionCodeIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionDemandValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionActualInternalValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t followingErrorWindowIndex; not used */
/* EC_SLV_APP_sCIA_object_t followingErrorTimeoutIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionWindowIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionWindowTimeIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocitySensorActualValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityDemandValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityWindowIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityWindowTimeIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityThresholdIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityThresholdTimeIndex; not used */
/* EC_SLV_APP_sCIA_object_t maxTorqueIndex; not used */
/* EC_SLV_APP_sCIA_object_t torqueDemandIndex; not used */
/* EC_SLV_APP_sCIA_object_t currentActualValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionRangeLimitIndex; not used */
/* EC_SLV_APP_sCIA_object_t homeOffsetIndex; not used */
/* EC_SLV_APP_sCIA_object_t polarityIndex; not used */
/* EC_SLV_APP_sCIA_object_t maxMotorSpeedIndex; not used */
/* EC_SLV_APP_sCIA_object_t profileVelocityIndex; not used */
/* EC_SLV_APP_sCIA_object_t profileAccelerationIndex; not used */
/* EC_SLV_APP_sCIA_object_t profileDecelerationIndex; not used */
/* EC_SLV_APP_sCIA_object_t quickStopDecelerationIndex; not used */
/* EC_SLV_APP_sCIA_object_t motionProfileTypeIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionEncoderResolutionIndex; not used */
/* EC_SLV_APP_sCIA_object_t gearRatioIndex; not used */
/* EC_SLV_APP_sCIA_object_t feedConstantIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityFactorIndex; not used */
/* EC_SLV_APP_sCIA_object_t homingMethodIndex; not used */
/* EC_SLV_APP_sCIA_object_t homingSpeedsIndex; not used */
/* EC_SLV_APP_sCIA_object_t homingAccelerationIndex; not used */
/* EC_SLV_APP_sCIA_object_t positionOffsetIndex; not used */
/* EC_SLV_APP_sCIA_object_t velocityOffsetIndex; not used */
/* EC_SLV_APP_sCIA_object_t torqueOffsetIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbeFunctionIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbeStatusIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe1PosEdgeIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe1NegEdgeIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe2PosEdgeIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe2NegEdgeIndex; not used */
/* EC_SLV_APP_sCIA_object_t interpolationTimePeriodIndex; not used */
/* EC_SLV_APP_sCIA_object_t maxAccelerationIndex; not used */
/* EC_SLV_APP_sCIA_object_t maxDecelerationIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe1PosEdgeCntIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe1NegEdgeCntIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe2PosEdgeCntIndex; not used */
/* EC_SLV_APP_sCIA_object_t touchProbe2NegEdgeCntIndex; not used */
/* EC_SLV_APP_sCIA_object_t positiveTorqueLimitValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t negativeTorqueLimitValueIndex; not used */
/* EC_SLV_APP_sCIA_object_t followingErrorActualValueIndex; not used */
uint32_t posLimitMax;
uint32_t posLimitMin;
{
/* Threads */
#if (defined OSAL_FREERTOS) /* hard to resolve this OS dependency, keep it here */
TaskP_Object mainThreadHandle;
TaskP_Params mainThreadParam;
#elif (defined OSAL_FREERTOS_JACINTO) /* hard to resolve this OS dependency, keep it here */
TaskP_Handle mainThreadHandle;
TaskP_Params mainThreadParam;
#else
#endif
/* Resources */
void* gpioHandle;
void* remoteHandle;
#if (defined OSAL_LINUX)
struct stat buffer;
uint8_t foeValue;
#endif
int32_t msec;
int32_t trigger;
uint8_t state;
uint8_t rsvd[3]; /* better be uint32_t aligned */
clock_t prev;
clock_t diff;
uint32_t pdoOutLen;
uint32_t pdoInLen;
uint8_t* pdRxBuffer;
uint8_t* pdTxBuffer;
uint16_t realPdoOutLen;
uint16_t realPdoInLen;
#if (defined __cplusplus)
extern "C" {
#endif
extern void EC_SLV_APP_CIA_initBoardFunctions (EC_SLV_APP_CIA_Application_t* pAppInstance_p);
extern void EC_SLV_APP_CIA_registerStacklessBoardFunctions(EC_SLV_APP_CIA_Application_t* pAppInstance_p);
#if (defined __cplusplus)
}
#endif
#endif /* PROTECT_ECSLVCIA402_H */
void EC_SLV_APP_CIA_applicationInit(EC_SLV_APP_CIA_Application_t *pAppInstance_p)
Initialize slave application example.
Definition ecSlvCiA402.c:958
Definition ecSlvApiInternal.h:130
Definition ecSlvApiInternal.h:144
Definition ecSlvApiInternal.h:329
Definition ecSlvApiInternal.h:173
uint8_t state
Definition ecSlvCiA402.h:185
EC_API_SLV_SCoE_Object_t * pt200FRecObj
Definition ecSlvCiA402.h:193
clock_t diff
Definition ecSlvCiA402.h:188
uint16_t realPdoOutLen
Definition ecSlvCiA402.h:207
uint8_t * pdRxBuffer
Definition ecSlvCiA402.h:204
void * loopThreadHandle
Definition ecSlvCiA402.h:171
EC_API_SLV_Pdo_t * ptRxPdo1600
Definition ecSlvCiA402.h:195
EC_API_SLV_SCoE_Object_t * pt2007RecObj
Definition ecSlvCiA402.h:192
void * mainThreadHandle
Definition ecSlvCiA402.h:169
EC_API_SLV_Pdo_t * ptRxPdo1601
Definition ecSlvCiA402.h:196
void * gpioHandle
Definition ecSlvCiA402.h:174
uint8_t * pdTxBuffer
Definition ecSlvCiA402.h:205
int32_t trigger
Definition ecSlvCiA402.h:183
EC_API_SLV_Pdo_t * ptTxPdo1A01
Definition ecSlvCiA402.h:199
uint8_t rsvd[3]
Definition ecSlvCiA402.h:186
void * ioexpLedHandle
Definition ecSlvCiA402.h:176
EC_API_SLV_SCoE_Object_t * pt2002RecObj
Definition ecSlvCiA402.h:191
uint16_t realPdoInLen
Definition ecSlvCiA402.h:208
uint32_t pdoInLen
Definition ecSlvCiA402.h:203
EC_API_SLV_Pdo_t * ptTxPdo1A02
Definition ecSlvCiA402.h:200
uint32_t selectedPruInstance
Definition ecSlvCiA402.h:159
EC_API_SLV_Pdo_t * ptTxPdo1A00
Definition ecSlvCiA402.h:198
EC_API_SLV_SHandle_t * ptEcSlvApi
Definition ecSlvCiA402.h:211
void * remoteHandle
Definition ecSlvCiA402.h:175
EC_API_SLV_SCoE_Object_t * ptRecObjOut
Definition ecSlvCiA402.h:190
int32_t msec
Definition ecSlvCiA402.h:182
EC_API_SLV_Pdo_t * ptRxPdo1602
Definition ecSlvCiA402.h:197
uint32_t pdoOutLen
Definition ecSlvCiA402.h:202
clock_t prev
Definition ecSlvCiA402.h:187
EC_SLV_APP_sCIA_axisData_t CiA402_axisData[AXES_NUMBER]
Definition ecSlvCiA402.h:209
Definition ecSlvCiA402.h:158
EC_SLV_APP_sCIA_object_t statusWordIndex
Definition ecSlvCiA402.h:82
uint32_t posLimitMin
Definition ecSlvCiA402.h:153
EC_SLV_APP_sCIA_object_t targetTorqueIndex
Definition ecSlvCiA402.h:104
EC_SLV_APP_sCIA_object_t targetVelocityIndex
Definition ecSlvCiA402.h:114
EC_SLV_APP_sCIA_object_t faultReactionIndex
Definition ecSlvCiA402.h:87
EC_SLV_APP_sCIA_object_t modesOfOperationDisplayIndex
Definition ecSlvCiA402.h:89
EC_SLV_APP_sCIA_object_t targetPositionIndex
Definition ecSlvCiA402.h:109
EC_SLV_APP_sCIA_object_t modesOfOperationIndex
Definition ecSlvCiA402.h:88
EC_SLV_APP_sCIA_object_t velocityActualValueIndex
Definition ecSlvCiA402.h:99
EC_SLV_APP_sCIA_object_t quickStopIndex
Definition ecSlvCiA402.h:83
uint32_t posLimitMax
Definition ecSlvCiA402.h:152
EC_SLV_APP_sCIA_objectEntry_t positionLimitMin
Definition ecSlvCiA402.h:150
EC_SLV_APP_sCIA_object_t disableOperationIndex
Definition ecSlvCiA402.h:85
EC_SLV_APP_sCIA_object_t controlWordIndex
Definition ecSlvCiA402.h:81
EC_SLV_APP_sCIA_object_t supportedDriveModesIndex
Definition ecSlvCiA402.h:147
EC_SLV_APP_sCIA_object_t torqueActualValueIndex
Definition ecSlvCiA402.h:107
EC_SLV_APP_sCIA_object_t positionActualValueIndex
Definition ecSlvCiA402.h:92
EC_SLV_APP_sCIA_objectEntry_t positionLimitMax
Definition ecSlvCiA402.h:149
EC_SLV_APP_sCIA_object_t shutdownIndex
Definition ecSlvCiA402.h:84
EC_SLV_APP_sCIA_object_t swPositionLimitIndex
Definition ecSlvCiA402.h:112
Definition ecSlvCiA402.h:79
uint32_t pdoOffset
Definition ecSlvCiA402.h:66
EC_API_SLV_SCoE_Object_t * pSdo
Definition ecSlvCiA402.h:62
uint32_t pdoObjectOffset
Definition ecSlvCiA402.h:65
EC_API_SLV_Pdo_t * pdoObject
Definition ecSlvCiA402.h:64
uint16_t objectIndex
Definition ecSlvCiA402.h:61
EC_API_SLV_SCoE_ObjEntry_t * pObjetEntry
Definition ecSlvCiA402.h:75
EC_API_SLV_SCoE_Object_t * pSdo
Definition ecSlvCiA402.h:73
uint16_t objectIndex
Definition ecSlvCiA402.h:71
uint8_t objectSubIndex
Definition ecSlvCiA402.h:72
Definition ecSlvCiA402.h:70
Definition ecSlvCiA402.h:60