Macros | Functions | Variables
eoe_test.c File Reference

Example code for Simple Open EtherCAT master EoE. More...

#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "ethercat.h"
Include dependency graph for eoe_test.c:

Go to the source code of this file.

Macros

#define EC_TIMEOUTMON   500
 

Functions

OSAL_THREAD_FUNC ecatcheck (void *ptr)
 
int eoe_hook (ecx_contextt *context, uint16 slave, void *eoembx)
 
OSAL_THREAD_FUNC mailbox_reader (void *lpParam)
 
int main (int argc, char *argv[])
 
void test_eoe (ecx_contextt *context)
 
void teststarter (char *ifname)
 

Variables

uint8 currentgroup = 0
 
int expectedWKC
 
volatile int globalwkc
 
boolean inOP
 
char IOmap [4096]
 
boolean needlf
 
uint8 rxbuf [1024]
 
uint8_t rxfragmentno = 0
 
uint16_t rxframeno = 0
 
uint16_t rxframeoffset = 0
 
uint16_t rxframesize = 0
 
int size_of_rx = sizeof(rxbuf)
 
OSAL_THREAD_HANDLE thread1
 
OSAL_THREAD_HANDLE thread2
 
uint8 txbuf [1024]
 

Detailed Description

Example code for Simple Open EtherCAT master EoE.

This example will run the follwing EoE functions SetIP GetIP

Loop Send fragment data (Layer 2 0x88A4) Receive fragment data (Layer 2 0x88A4)

For this to work, a special slave test code is running that will bounce the sent 0x88A4 back to receive.

Usage : eoe_test [ifname1] ifname is NIC interface, f.e. eth0

This is a minimal test.

(c)Arthur Ketels 2010 - 2011

Definition in file eoe_test.c.

Macro Definition Documentation

◆ EC_TIMEOUTMON

#define EC_TIMEOUTMON   500

Definition at line 29 of file eoe_test.c.

Function Documentation

◆ ecatcheck()

OSAL_THREAD_FUNC ecatcheck ( void *  ptr)

Definition at line 314 of file eoe_test.c.

◆ eoe_hook()

int eoe_hook ( ecx_contextt context,
uint16  slave,
void *  eoembx 
)

registered EoE hook

Definition at line 54 of file eoe_test.c.

◆ mailbox_reader()

OSAL_THREAD_FUNC mailbox_reader ( void *  lpParam)

Definition at line 117 of file eoe_test.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 400 of file eoe_test.c.

◆ test_eoe()

void test_eoe ( ecx_contextt context)

Definition at line 148 of file eoe_test.c.

◆ teststarter()

void teststarter ( char *  ifname)

Definition at line 194 of file eoe_test.c.

Variable Documentation

◆ currentgroup

uint8 currentgroup = 0

Definition at line 37 of file eoe_test.c.

◆ expectedWKC

int expectedWKC

Definition at line 33 of file eoe_test.c.

◆ globalwkc

volatile int globalwkc

Definition at line 35 of file eoe_test.c.

◆ inOP

boolean inOP

Definition at line 36 of file eoe_test.c.

◆ IOmap

char IOmap[4096]

Definition at line 31 of file eoe_test.c.

◆ needlf

boolean needlf

Definition at line 34 of file eoe_test.c.

◆ rxbuf

uint8 rxbuf[1024]

Definition at line 50 of file eoe_test.c.

◆ rxfragmentno

uint8_t rxfragmentno = 0

Current RX fragment number

Definition at line 43 of file eoe_test.c.

◆ rxframeno

uint16_t rxframeno = 0

Current RX frame number

Definition at line 49 of file eoe_test.c.

◆ rxframeoffset

uint16_t rxframeoffset = 0

Current RX data offset in frame

Definition at line 47 of file eoe_test.c.

◆ rxframesize

uint16_t rxframesize = 0

Complete RX frame size of current frame

Definition at line 45 of file eoe_test.c.

◆ size_of_rx

int size_of_rx = sizeof(rxbuf)

Definition at line 51 of file eoe_test.c.

◆ thread1

Definition at line 38 of file eoe_test.c.

◆ thread2

Definition at line 39 of file eoe_test.c.

◆ txbuf

uint8 txbuf[1024]

Definition at line 40 of file eoe_test.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:49