BECKHOFF ET9300 User Manual

Page 37

Advertising
background image

Application Note ET9300

35

SyncManager).
NOTE: if one of the values mismatch with the information in the ESI file the slave will abort the
state transition from PreOP to SafeOP with the Error code 0x1E or 0x1D (depending on the wrong
value)

UINT16 APPL_GenerateMapping(UINT16 *pInputSize,UINT16 *pOutputSize)
{

/* 32Bit cyclic counter (0x6000) and 32Bit Result (*0x6010)/

*pInputSize = 8;

/*32Bit Value1 (0x7010.1) and 32Bit Value2 (0x7010.2)*/

*pOutputSize = 8;

return ALSTATUSCODE_NOERROR;
}

6. File: sampleappl.c

Update the input process data mapping function to copy also the new process data.

void APPL_InputMapping(UINT16* pData)
{
MEMCPY(pData,&InputCounter,SIZEOF(InputCounter));


/* Increment the data pointer to write the next process data (pData refers
to the buffer which is copied to the ESC memory controlled by SyncManager 3
(input process data) */

pData +=2;

/* Copy the value the result */

MEMCPY(pData,&ResultObj6010,SIZEOF(ResultObj6010));

}

7. File: sampleappl.c

Update the output process data mapping function to update the variables handling the output
process data.

void APPL_OutputMapping(UINT16* pData)
{

/* Update the variable “Value1” */

MEMCPY(&OutputData.Value1,pData,SIZEOF(OutputData.Value1));

/* Increment the data pointer to write the next process data (pData refers
to the buffer which is copied to the ESC memory controlled by SyncManager 3
(input process data) */

pData += 2;


/* Update the variable “Value2” */

MEMCPY(&OutputData.Value2,pData,SIZEOF(OutputData.Value2));

}

8. File: sampleappl.c

Update the Application.

void APPL_Application(void)
{
/*Hardware independent sample application*/

ResultObj6010 = OutputData.Value1 + OutputData.Value2;


InputCounter++;

}

9. File: ESI file (in xml format)

Update the entries of the RxPdo and TxPdo elements according to step 3.

<RxPdo Mandatory="true" Fixed="true" Sm="2">

Advertising