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!
Signal delay due to CAN/ENET Gateway
Re: Signal delay due to CAN/ENET Gateway
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.
best regards
Gunther
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
Gunther
Re: Signal delay due to CAN/ENET Gateway
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!
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
Re: Signal delay due to CAN/ENET Gateway
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 PCAN-View@Virtual PCAN-Gateway and here are the gateways config
best regards
Gunther
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 PCAN-View@Virtual PCAN-Gateway 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
Gunther
Re: Signal delay due to CAN/ENET Gateway
Hi Gunther,
The firmware update solved the issue. Thanks for the help!
The firmware update solved the issue. Thanks for the help!