[etherlab-users] How to use EoE and build program
Thomas Bitsky, Jr.
tbj at automateddesign.com
Tue Aug 14 05:48:39 CEST 2012
Hello! I'm new to using EtherLAB. I've got the master installed as a
service, and it's communicating to the network fine. However, I'm having
trouble getting the EoE feature up and running.
I have an Ethernet device in the field with the IP Address 192.168.127.254
that I need to communicate with through a web browser. I have an EL6601
that the master is able to see fine. When I put the network into Operation,
the RUN light goes steady.
I'm running on Ubuntu 10.04. I have not installed any real-time extensions;
I'm just working with EtherLAB right now.
If I execute:
# ethercat eoe
I get a listing for eoe0s7 as a virtual interface, and that it is down.
So, I created in /etc/network the file ifcg-eoe0s7 with the following
contents:
IPADDRESS=192.168.127.254/8
STARTMODE=auto
I restarted the computer.
To raise the interface, I enter:
# ifconfig eoe0s7 up
The virtual interface goes up, and the LINK light on the EL6601 goes solid
green.
However, I'm unable to ping 192.168.127.254, or get the pages it serves to
pop up. So, I did more reading, and I think I need to do some function
calls in the program. So, I added to my test program:
void send_callback(void *cb_data)
{
ec_master_t *m = (ec_master_t *) cb_data;
sem_wait(&mutex);
ecrt_master_send_ext(m);
sem_post(&mutex);
}
/*****************************************************************************/
void receive_callback(void *cb_data)
{
ec_master_t *m = (ec_master_t *) cb_data;
sem_wait(&mutex);
ecrt_master_receive(m);
sem_post(&mutex);
}
int
main(int argc, char **argv)
{
...
// setup callbacks for EoE
ecrt_master_callbacks(master, send_callback, receive_callback, master);
...
}
However, it won't build:
durability.o: In function `send_callback':
/home/tbj/srcroot/durability/src/durability.c:279: undefined reference to
`ecrt_master_send_ext'
durability.o: In function `main':
/home/tbj/srcroot/durability/src/durability.c:321: undefined reference to
`ecrt_master_callbacks'
This is my makefile:
CC = gcc
ETHERCAT_TOPDIR = /home/tbj/srcroot/ethercat
CFLAGS = -I$(ETHERCAT_TOPDIR)/include -g -O2
LDFLAGS = -L$(ETHERCAT_TOPDIR)/lib/.libs -lethercat -lrt
OBJECTS = durability.o
durability.exe : $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) $(LDFLAGS) -o durability.exe
%.o : %.c
$(CC) $(CFLAGS) -c $<
Can anyone tell me what I'm missing? I feel like I'm one step away from
having this working, but I can't find anything else in any documentation
that would lead me to the answer.
Thanks in advance for any help.
T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20120813/4469d612/attachment-0002.htm>
More information about the Etherlab-users
mailing list