Signal delay due to CAN/ENET Gateway

CAN to LAN gateway in DIN rail plastic casing
Post Reply
turnrod
Posts: 4
Joined: Tue 1. Mar 2016, 13:52

Signal delay due to CAN/ENET Gateway

Post by turnrod » Tue 1. Mar 2016, 14:29

I am using the PCAN-Ethernet Gateway DR to communicate with a CAN device that is connected to a LAN. I need to both transmit and receive data using TCP protocol to/from the CAN device with minimum delay.

Linux TCP Client (transmit data to Gateway)
Linux TCP Server (receive data from Gateway)

Based on what I have measured, the Gateway device (excluding other delays) is adding a delay on the order of 200 msec. The Gateway documentation I have read does indicate that there will be a signal delay due to the conversion between tcp/can, but does not specify any values. Is a 200 msec delay expected or can the Gateway device be configured to significantly reduce this delay? Thanks!

G.Lang
Support
Support
Posts: 174
Joined: Wed 22. Sep 2010, 14:58

Re: Signal delay due to CAN/ENET Gateway

Post by G.Lang » Tue 1. Mar 2016, 15:00

Hello,

the gateway itself has an internal delay <1ms, but if you are using the TCP protocol there is a additional delay called "tcpdelay" active (=default)

You can´t switch off this "tcpdelay" in the GUI, please export the configuration, open the "poi_config.ini" with a text editor and set "tcpdelay" to "FALSE" for every desired route and import the configuration again.

Code: Select all

[rt_3]
rtinfo                         = 
active                         = FALSE
type                           = LAN2CAN
interface1                     = can0
protocol2                      = TCP
destination2                   = 0.0.0.0:7002
fpp                            = 15
tcpdelay                       = FALSE
dispidx                        = 0
sndudelay                      = 50
sndmax                         = 6
noctrl                         = FALSE
unifyfilters                   = FALSE
joinfilters                    = FALSE


[rt_4]
rtinfo                         = 
active                         = TRUE
type                           = CAN2LAN
interface1                     = can0
protocol2                      = TCP
destination2                   = 192.168.1.51:5001
fpp                            = 15
tcpdelay                       = TRUE
dispidx                        = 0
sndudelay                      = 50
sndmax                         = 6
noctrl                         = FALSE
unifyfilters                   = FALSE
joinfilters                    = FALSE
best regards
Gunther

turnrod
Posts: 4
Joined: Tue 1. Mar 2016, 13:52

Re: Signal delay due to CAN/ENET Gateway

Post by turnrod » Tue 1. Mar 2016, 17:00

Hi Gunther,

I tried your recommendation and updated the ini file, but I am still seeing a 200 ms delay. I have attached the ini file that I imported. The software version that I have is 2.3.13. Any other suggestions??? Thanks!
Attachments
poi_config.pdf
(7.66 KiB) Downloaded 609 times

G.Lang
Support
Support
Posts: 174
Joined: Wed 22. Sep 2010, 14:58

Re: Signal delay due to CAN/ENET Gateway

Post by G.Lang » Wed 2. Mar 2016, 14:41

Hi,

please update the firmware to version 2.5.1

Below some screenshots with disabled "tcpdelay", in this configuration i use a PCAN-PCI card connected to the PCAN-Ethernet-Gateways CAN channel 1 at the one side and a PCAN-Virtual Gateway on the other side (see "Communication between Gateway and PC via the Virtual PCAN-Gateway" at page 5 from the PCAN-Gateways_Developer-Documentation.pdf)

PCAN-View@PCAN-PC
pci_can-0.JPG
pci_can-0.JPG (56.02 KiB) Viewed 10420 times
pci_can-1.JPG
pci_can-1.JPG (66.09 KiB) Viewed 10420 times
PCAN-View@Virtual PCAN-Gateway
virtual_can_0.JPG
virtual_can_0.JPG (59.63 KiB) Viewed 10420 times
virtual_can_1.JPG
virtual_can_1.JPG (71.18 KiB) Viewed 10420 times
and here are the gateways config

Code: Select all

#########################################
# PoI configuration file
# Format version 1.3.0
######################################### 
[general]
username                       = Default User
description                    = CAN to LAN Gateway in DIN Rail Plastic Casing
lighttpdport                   = 80
kl15pwdn                       = 0


[host]
devicename                     = PCAN-Ethernet Gateway DR


[lan_0]
usedhcp                        = 0
ipv4                           = 192.168.1.5
subnetmask                     = 255.255.255.0
ipv6                           = ::
netbitsv6                      = 64
ifname                         = eth0
ipv4gw                         = 0.0.0.0
ipv6gw                         = ::


[wlan_0]
mode                           = 1
ssid                           = PEAK Wireless AdHoc
encryptiontype                 = 0
usedhcp                        = FALSE
ipv4                           = 192.168.1.10
subnetmask                     = 255.255.255.0


[can_0]
ifname                         = First CAN interface
active                         = 1
baudrate                       = 250000
listenonly                     = 0
autoresume                     = 1
loopback                       = 0
oneshot                        = 0
triplesampling                 = 0
manbr                          = 0
br_register                    = -
samplepoint                    = 800


[can_1]
ifname                         = Second CAN interface
active                         = 1
baudrate                       = 250000
listenonly                     = 0
autoresume                     = 1
loopback                       = 0
oneshot                        = 0
triplesampling                 = 0
manbr                          = 0
br_register                    = -
samplepoint                    = 800


[gui]
show_device_info               = 1
show_can_info                  = 0
show_lan_info                  = 0
show_wlan_info                 = 0
show_bt_info                   = 0
show_routing_info              = 0
show_contact_info              = 1
show_support_info              = 1
show_filter_info               = 1


[fwd_gen]
count                          = 4
canoipdport                    = 45321


[rt_0]
rtname                         = Route from can0 to module A
active                         = TRUE
type                           = CAN2LAN
interface1                     = can0
protocol2                      = TCP
destination2                   = 192.168.1.30:4002
fpp                            = 15
tcpdelay                       = FALSE
rtinfo                         = Route n
dispidx                        = 0
sndudelay                      = 250
sndmax                         = 15
noctrl                         = FALSE
unifyfilters                   = TRUE
joinfilters                    = FALSE


[rt_1]
rtinfo                         = 
active                         = TRUE
type                           = LAN2CAN
interface1                     = can0
protocol2                      = TCP
destination2                   = 0.0.0.0:5000
fpp                            = 15
tcpdelay                       = FALSE
dispidx                        = 0
sndudelay                      = 50
sndmax                         = 6
noctrl                         = FALSE
unifyfilters                   = FALSE
interface2                     = 
protocol1                      = 
destination1                   = 
dest1type                      = 
dest2type                      = 
joinfilters                    = FALSE
best regards
Gunther

turnrod
Posts: 4
Joined: Tue 1. Mar 2016, 13:52

Re: Signal delay due to CAN/ENET Gateway

Post by turnrod » Wed 2. Mar 2016, 19:48

Hi Gunther,

The firmware update solved the issue. Thanks for the help!

Post Reply