[etherlab-users] Using EtherCAT EoE and Build Errors
Matthieu Bec
mbec at gmto.org
Tue Aug 14 14:29:11 CEST 2012
Hello Thomas,
it might be a simple network config problem: the IP address of your
virtual interface shouldn't be the same as your field device. Try
assigning it something different on the same subnet, e.g.
192.168.127.1/8 and check your routing table is correct
Regards
On 08/13/12 22:21, Thomas Bitsky, Jr. wrote:
> 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 <http://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
>
>
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>
--
Matthieu Bec GMTO Corp.
cell: +1 626 354 9367 P.O. Box 90933
phone: +1 626 204 0527 Pasadena, CA 91109-0933
More information about the Etherlab-users
mailing list