XMC 4800 Relax 이더넷 CAT 키트 ③이더넷 샘플 프로그램 시작(댓글 측 사전 준비)
Infeneon사Download of Example Projects for DAVE™ Apps에서 제공하는 샘플 프로그램 ETHCATSSC_XMC48.zip을 다운로드할 수 있습니다.

그런 다음 Dave 샘플 가져오기 프로그램을 시작합니다.샘플 프로그램 zip의 폴더에서 Getting Startd-XMC4800 확장Relax_EtherCat_APP_Slave_SSC Example_V3.2. pdf를 참조하여 진행한다.


zip 상태에서 샘플 프로그램을 지정합니다.

가져오기 완료

이더넷 SSC(Slave Stack Code) 도구 시작
샘플 프로그램에서 이더넷 CAT의 SSC¥Src 폴더가 비어 있기 때문에 SSC 도구를 이용하여 소스 코드와 ESI 파일을 생성합니다. (주 제어에서 읽는 정보를 기록하는 XML 파일)

샘플 프로그램 zip의 폴더에서 Getting Startd-XMC4800 확장Relax_EtherCat_APP_Slave_SSC Example_V3.2. pdf를 참조하여 진행한다.
새 프로젝트를 만들고 Dave에서 열린 샘플 프로그램의 SSC 폴더에서 구성 파일을 가져옵니다.


이어서 SSC 폴더 아래에 있는 Excel 파일을 가져옵니다.※PC에 Excel이 설치되어 있지 않으면 가져오기 오류가 발생합니다.Open Office나 Libre Office 같은 호환되지 않는 도구에도 오류가 발생하여 가져올 수 없습니다.

소스 코드와 ESI 파일을 생성합니다.

성공하면 SSC\Src 폴더에 이더넷 CAT 스택의 소스 코드(.h,.c)를 생성하고 SSC 폴더에 ESI 파일 XMC를 생성합니다.ESC.xml이 생성되었습니다.Dave에서 복구를 수행하여 오류가 없는지 확인합니다.ESI 파일을 C:\Twin CAT\3.1\Config\Io Ethernet CAT로 복사하여 마스터 제어단에서 종단 정보를 찾습니다.

coeappl.편집기에서 c의 다음 부위를 수정합니다.

소스 코드 수정 및 구축
샘플 프로그램 동작을 위해 생성된 코드의 아래 부분을 수정합니다.
입력
XMC_ESC.c
/////////////////////////////////////////////////////////////////////////////////////////
/**
\param pData pointer to input process data
\brief This function will copies the inputs from the local memory to the ESC memory
to the hardware
*////////////////////////////////////////////////////////////////////////////////////////
void APPL_InputMapping(UINT16* pData)
{
//#if _WIN32
// #pragma message ("Warning: Implement input (Slave -> Master) mapping")
//#else
// #warning "Implement input (Slave -> Master) mapping"
//#endif
memcpy(pData, &(((UINT16 *)&IN_GENERIC0x6000)[1]), SIZEOF(IN_GENERIC0x6000)-2);
}
출력XMC_ESC.c
/////////////////////////////////////////////////////////////////////////////////////////
/**
\param pData pointer to output process data
\brief This function will copies the outputs from the ESC memory to the local memory
to the hardware
*////////////////////////////////////////////////////////////////////////////////////////
void APPL_OutputMapping(UINT16* pData)
{
//#if _WIN32
// #pragma message ("Warning: Implement output (Master -> Slave) mapping")
//#else
// #warning "Implement output (Master -> Slave) mapping"
//#endif
memcpy(&(((UINT16 *)&OUT_GENERIC0x7000)[1]), pData, SIZEOF(OUT_GENERIC0x7000)-2);
}
사용자 응용 프로그램 호출XMC_ESC.c
/////////////////////////////////////////////////////////////////////////////////////////
/**
\brief This function will called from the synchronisation ISR
or from the mainloop if no synchronisation is supported
*////////////////////////////////////////////////////////////////////////////////////////
void process_app(TOBJ7000 *OUT_GENERIC, TOBJ6000 *IN_GENERIC);
void APPL_Application(void)
{
//#if _WIN32
// #pragma message ("Warning: Implement the slave application")
//#else
// #warning "Implement the slave application"
//#endif
process_app(&OUT_GENERIC0x7000, &IN_GENERIC0x6000);
}
Reference
이 문제에 관하여(XMC 4800 Relax 이더넷 CAT 키트 ③이더넷 샘플 프로그램 시작(댓글 측 사전 준비)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/galaxy2galaxy/items/d5ca35e76e0ace767b34텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)