The USB2CAN Triple and USB2CAN Combo converters have support for the software CAN gateway function in PP2CAN. This function allows data to be transferred between two CAN bus ports, either all or selected data. This function is applicable for example for the following situations:
- transferring data between CAN buses with different speeds
- data transfer between CAN buses of high speed / low speed / single wire type (USB2CAN Combo)
- transfer of classic CAN messages between a classic CAN bus and a CAN FD bus
- determination of the data generated or needed by a CAN device in operation, if a converter is inserted between this device and the rest of the devices on the bus
- testing the behaviour of a highly loaded CAN bus by splitting it into 2 parts and forwarding only part of the data
- the function of inserting data delays when testing situations where data is not sent on time
The gateway function is handled by the PP2CAN software. For this reason, it is not possible to avoid delays in the forwarded data. The data must pass through the USB to the PC, be processed in the software, and when it is forwarded, it must pass through the USB again and be sent to the other CAN port.
In the following pictures we can see the situation on the oscilloscope, it is a message that is forwarded on the free CAN by the gateway function to the second CAN. The CAN bus speed is 250kbit.
In this mode, the delay between the ends of the two messages varies from 2.1 ms to 4ms on the PC used. Because this is a SW function, these times are not guaranteed and depend on the PC used, its current load and the amount of additional data on both CAN buses. It is important to note that the data is processed by the converter processor, 2x passes through the USB, is processed by the PP2CAN software in the PC, all of which introduces a delay into the whole process. In some situations, however, this delay is too large and the devices on the CAN bus may experience erroneous behavior or error conditions.
The PP2CAN version 2.033 and the firmware for these converters get a new CAN gateway function, where a so-called HW mode parameter can be set for up to 16 entries in the GW table. Messages with this parameter are not forwarded between CAN ports by SW, but transferred directly by the USB2CAN converter without any SW involvement in the computer. The figure that follows shows the delay in this mode:
As you can see, the message is forwarded to the other CAN almost immediately. The data delay is thus practically only the length of the message.