Hi All,

Back at this. My program now compiles. I think I am loading all the correct
libraries to do just NIC, UDP and TCP with RTNET:
> insmod /usr/realtime/modules/rtai_hal.ko
> insmod /usr/realtime/modules/rtai_lxrt.ko
> insmod /usr/realtime/modules/rtai_sem.ko
> insmod /usr/realtime/modules/rtai_rtdm.ko
> rmmod e1000e
> insmod /usr/rtnet/modules/rtnet.ko
> insmod /usr/rtnet/modules/rtipv4.ko
> insmod /usr/rtnet/modules/rtpacket.ko
> insmod /usr/rtnet/modules/rt_loopback.ko
> insmod /usr/rtnet/modules/rt_e1000.ko
> /usr/src/rtnet-0.9.12/tools/./rtifconfig rteth1 up 192.168.0.2
> /usr/src/rtnet-0.9.12/tools/./rtifconfig rtlo up 127.0.0.1
> insmod /usr/rtnet/modules/rtudp.ko
> insmod /usr/rtnet/modules/rttcp.ko
> ./opener 192.168.0.2 255.255.255.0 192.168.0.1 test.com testdevice 00 0E 8C 9F
> 16 09

I current am not connected to a host but am just trying to debug as far as a
I can with this just this side. This all works until the last function:

>  /* create a new TCP socket */
>   if ((nTCPListener = rt_dev_socket(PF_INET, SOCK_STREAM, 0)) == -1)
>     {
>       OPENER_TRACE_ERR("error allocating socket stream listener, %d\n",
> errno);
>       return EIP_ERROR;
>     }
> 
>   /* create a new UDP socket */
>   if ((nUDPListener = rt_dev_socket(PF_INET, SOCK_DGRAM, 0)) == -1)
>     {
>       OPENER_TRACE_ERR("error allocating udp listener socket, %d\n", errno);
>       return EIP_ERROR;
>     }
> 
>   my_addr.sin_family = AF_INET;
>   my_addr.sin_port = htons(OPENER_ETHERNET_PORT);
>   my_addr.sin_addr.s_addr = htonl(INADDR_ANY);
>   memset(&my_addr.sin_zero, 0, sizeof(my_addr.sin_zero));
> 
>   /* bind the new socket to port 0xAF12 (CIP) */
>   if ((rt_dev_bind(nTCPListener, (struct sockaddr *) &my_addr, sizeof(struct
> sockaddr)))
>       == -1)
>     {
>       OPENER_TRACE_ERR("error with bind: %d %s", errno, strerror(errno));
>       return EIP_ERROR;
>     }
> 
>   /* enable the udp socket to receive broadcast messages*/
>   y = 1;
>   if (0 > rt_dev_setsockopt(nUDPListener, SOL_SOCKET, SO_BROADCAST, &y,
> sizeof(int)))
>     {
>       OPENER_TRACE_ERR("error with setting broadcast receive for udp socket:
> %d %s", errno, strerror(errno));
>       return EIP_ERROR;
>     }

The above function returns ³38  function not implemented²

Do I need to be connected for this to work?

Are my load modules right?

Is this function really not implemented or am I doing something wrong?

If it is not implemented, is there a work around?

Glen






On 9/28/10 5:35 PM, "Jan Kiszka" <[email protected]> wrote:

> Am 28.09.2010 23:17, Glen Wernersbach wrote:
>> Jan,
>> 
>> My basic concern was to keep the data flowing from the NIC to my program as
>> close to hard real time as possible. I know doing Linux calls can break hard
>> real time especially when I want to receive a UDP packet every 1ms.
> 
> Is that UDP packet part of your control loop? Why do you need the whole
> opener stack then? Or is there more?
> 
>> 
>> The only thing Ethernet IP really gives you real time is optional support
>> for the Ethernet 1588 timing standard so you know what the jitter was in
>> receiving the packet over the Ethernet line. The 1588 support is not yet
>> implemented in opener. The rest is just a protocol for handling critical
>> data over TCP and UDP. Unfortunately, I have a device that needs to work on
>> Allen Bradley controllers which only support this real time protocol.
>> 
>> All I want to do is replace the Linux calls in networkhandler.c
>> (socket,bind,listen...) with RTAI real time calls.
> 
> Additionally, you will have to configure the socket resources, namely
> how many buffers each socket should pre-allocate for its real-time
> operation (that's the major difference to normal networking stack that
> do on-demand allocations). See the examples.
> 
> Jan
> 

-- 
Glen Wernersbach
President & CTO

Jetsoft Development Co.
629 Old St Rt. 74 ­ Suite 210
Cincinnati, Oh 45244
Custom Programming Web Site: www.jetsoftdev.com
Retail Products Web Site: www.scanhelp.com
Phone:   513-528-6660
Fax: 513-528-3470
----
"Support Dyslexia Research"

<<image.png>>

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to