This documentation is out of date.

The new version of the documentation is here: https://cannylogic.com/docs

Difference between revisions of "CANNY 5.2 duo, CAN Gateway Driver"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Driver's registers)
(Driver's registers)
Line 143: Line 143:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр установки номера CAN-интерфейса отбора X шлюза CAN
+
|style="padding-left:0.5em;"|CAN gateway selector X linked CAN interface number register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 150: Line 150:
 
|width="70px" style="padding-left:0.5em;"|= 0
 
|width="70px" style="padding-left:0.5em;"|= 0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|применять соответствующий отбор к сообщениям, поступающим в контроллер через интерфейс CAN0;
+
|style="padding-left:0.5em;"|apply the appropriate selection to the messages coming to the controller via the CAN0 interface;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|= 1
 
|width="70px" style="padding-left:0.5em;"|= 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|применять соответствующий отбор к сообщениям, поступающим в контроллер через интерфейс CAN1.
+
|style="padding-left:0.5em;"|apply the appropriate selection to the messages coming to the controller via the CAN1 interface.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 167: Line 167:
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|width="70px" style="padding-left:0.5em;"|≥ 1
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|discard all messages which match an enabled selector;
+
|style="padding-left:0.5em;"|discard all messages which match an enabled selection;
 
|- valign="top"
 
|- valign="top"
 
|width="70px" style="padding-left:0.5em;"|= 0
 
|width="70px" style="padding-left:0.5em;"|= 0
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|allow processing and automatic retransmission to another CAN interface of all messages which match an enabled selector.
+
|style="padding-left:0.5em;"|allow processing and automatic retransmission to another CAN interface of all messages which match an enabled selection.
 
|}
 
|}
 
|}
 
|}
  
  
Регистры значений отборов драйвера шлюза CAN.
+
CAN gateway selection registers.
  
'''''Значение отбора''''' - параметр, при удовлетворении которому, поступившие CAN-сообщение отбирается из общего потока данных для специальной обработки.
+
'''''The value of the selection''''' - is a parameter which, when satisfied, selects an incoming CAN message for special processing.
  
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
|- align="center" valign="top"
 
|- align="center" valign="top"
!width="250px"|Регистр
+
!width="250px"|Register
!Ожидаемые значения
+
!Expected value
 
|- valign="top"
 
|- valign="top"
 
|
 
|
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр установки значения отбора Х шлюза, CAN IDL
+
|style="padding-left:0.5em;"|CAN gateway selector X value, IDL
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 195: Line 195:
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|width="70px" style="padding-left:0.5em;"|0...0xFFFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|значение младшей части идентификатора (биты 0...10 идентификатора стандартного формата или биты 0...15 идентификатора расширенного формата) CAN-сообщения удовлетворяющего соответствующему отбору.
+
|style="padding-left:0.5em;"|the value of the lower part of the identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) ​​of the CAN message the selection will accept.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 201: Line 201:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр установки значения отбора Х шлюза, CAN IDH
+
|style="padding-left:0.5em;"|CAN gateway selector X value, IDH
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 208: Line 208:
 
|width="70px" style="padding-left:0.5em;"|0...0x1FFF
 
|width="70px" style="padding-left:0.5em;"|0...0x1FFF
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|значение старшей части идентификатора (биты 16...28 идентификатора расширенного формата) CAN-сообщения удовлетворяющего соответствующему отбору.
+
|style="padding-left:0.5em;"|the value of the highest part of the identifier (bits 16 ... 28 of the extended format identifier) ​​of the CAN message the selection will accept.
 
|}
 
|}
 
|}
 
|}
  
  
Регистры масок отборов драйвера шлюза CAN.
+
The registers of the gateway driver selection masks.
  
'''''Маска отбора''''' - группа значений, биты которых определяют подлежащие модификации при ретрансляции шлюзом части сообщения попавшего в соответствующий отбор. При значении бита маски равном "0", соответствующий бит принятого сообщения будет ретранслирован на другой интерфейс без изменений. При значении бита маски равном "1", соответствующий бит принятого сообщения будет заменен при ретрансляции соответствующим битом из значения ''Замены отбора''
+
'''''The selection masks''''' - is a group of values ​​whose bits define the bitwise modifications to be made when the gateway retransmits a part of the message that has been accepted by the appropriate selection. If the value of the mask bit is "0", the corresponding bit of the received message will be relayed to the other interface without changes. If the value of the mask bit is "1", the corresponding bit of the received message will be replaced by a corresponding bit from the value of the ''Substitution Substitution''
  
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
{|border="1" style="border-collapse:collapse;" align="left" width="100%"
 
|- align="center" valign="top"
 
|- align="center" valign="top"
!width="250px"|Регистр
+
!width="250px"|Register
!Ожидаемые значения
+
!Expected value
 
|- valign="top"
 
|- valign="top"
 
|
 
|

Revision as of 07:04, 19 May 2018

General Description

Используя драйвер шлюза CAN возможно организовать высокоскоростную асинхронную ретрансляцию сообщений между аппаратными CAN-интерфейсами контроллера с возможностью автоматической модификации ретранслируемых сообщений.


Драйвер шлюза CAN позволяет организовать индивидуальную обработку полученных сообщений CAN путем настройки восьми правил отбора.

Каждое правило позволяет отбирать сообщения CAN по следующим, задаваемым пользователем признакам:

  • номер интерфейса CAN по которому сообщение поступило в контроллер;
  • идентификатор поступившего сообщения (Значение отбора).


При поступлении сообщения удовлетворяющего заданным признакам, драйвер позволяет выполнить одно из следующих действий:

  • ретранслировать сообщение на другой интерфейс CAN контроллера без изменений;
  • модифицировать полученное сообщение, а затем ретранслировать сообщение на другой интерфейс CAN контроллера;
  • отбросить сообщение.

Модификация сообщения производится путем замены по маске любых бит исходного сообщения включая значения его идентификатора, длины и байт данных.


Для всех сообщений, поступивших с определенного интерфейса CAN, но не удовлетворяющих признакам ни одного из включенных правил отбора шлюза возможно задать одно из следующих действий:

  • ретранслировать сообщение на другой интерфейс CAN контроллера без изменений;
  • отбросить сообщение.


Для работы драйвера шлюза CAN необходимо задать конфигурацию драйверов обоих CAN-интерфейсов контроллера, при этом заданные для интерфейсов конфигурации CAN могут отличаться.


При включенном драйвере шлюза CAN, средствами пользовательской диаграммы возможно, используя регистры Драйвера CAN0 и Драйвера CAN1:

  • отправлять сообщения через любой из CAN-интерфейсов контроллера в обычном режиме;
  • получать сообщения CAN удовлетворяющие правилам отбора установленным для соответствующего интерфейса CAN драйвером шлюза CAN.


В процессе работы пользовательской диаграммы возможно многократно изменять любые параметры конфигурации драйвера шлюза CAN средствами пользовательской диаграммы, организуя таким образом, с некоторыми временными ограничениями, динамический режим работы шлюза.

Driver's registers

Below is a description of the permissible values ​​of the CAN gate driver control registers, which allow setting the controller operation parameters for high-speed asynchronous relaying of messages between the CAN hardware interfaces.

Common registers of the CAN gateway driver.

Register Expected values
CAN gateway driver enable register
≥ 1 = Enable the CAN gateway driver;
= 0 = Disable the CAN gateway driver.
CAN gateway configuration register
≥ 1 = Apply the new settings of the CAN gateway driver (see note);
= 0 = Do not update the settings of the CAN gateway driver.
CAN gateway filter enable for CANx interface
≥ 1 = switch on the filtering mode of the CAN gateway for the corresponding interface: relay to the second CAN interface of the controller and transmit only CAN messages that are included in the gateway selections to the functional diagram, the remaining messages are discarded;
= 0 = the filtering mode of the CAN gateway for the corresponding interface is disabled: it automatically retransmits messages that have not entered the gateway selections to the second CAN-interface of the controller in unchanged form.
CAN gateway logging mode enable for CANx interface
≥ 1 = enable the CAN gateway logging mode for the corresponding interface: transmit to the function chart (in the CAN driver) all CAN messages received on this interface. The gateway driver will select, replace and relay CAN messages according to the corresponding gateway settings of the specified CAN interface;
= 0 = disable the CAN gateway logging mode for the corresponding interface: only CAN messages that are included in the gateway's selections are transmitted to the diagram (in the CAN driver), the remaining messages are discarded.


CAN gateway configuration registers.

Common CAN gateway driver selection registers.

Registers Expected values
CAN gateway selector X enable register
≥ 1 = enable the appropriate selection of the CAN gateway;
= 0 = the corresponding CAN gateway selection is disabled.
CAN gateway selector X linked CAN interface number register
= 0 = apply the appropriate selection to the messages coming to the controller via the CAN0 interface;
= 1 = apply the appropriate selection to the messages coming to the controller via the CAN1 interface.
CAN gateway excluding mode register for CANx interface
≥ 1 = discard all messages which match an enabled selection;
= 0 = allow processing and automatic retransmission to another CAN interface of all messages which match an enabled selection.


CAN gateway selection registers.

The value of the selection - is a parameter which, when satisfied, selects an incoming CAN message for special processing.

Register Expected value
CAN gateway selector X value, IDL
0...0xFFFF = the value of the lower part of the identifier (bits 0 ... 10 of the standard format identifier or bits 0 ... 15 of the extended format identifier) ​​of the CAN message the selection will accept.
CAN gateway selector X value, IDH
0...0x1FFF = the value of the highest part of the identifier (bits 16 ... 28 of the extended format identifier) ​​of the CAN message the selection will accept.


The registers of the gateway driver selection masks.

The selection masks - is a group of values ​​whose bits define the bitwise modifications to be made when the gateway retransmits a part of the message that has been accepted by the appropriate selection. If the value of the mask bit is "0", the corresponding bit of the received message will be relayed to the other interface without changes. If the value of the mask bit is "1", the corresponding bit of the received message will be replaced by a corresponding bit from the value of the Substitution Substitution

Register Expected value
Регистр установки маски отбора X шлюза, CAN IDL
0...0xFFFF = установить значение маски младшей части идентификатора CAN-сообщения (биты 0...10 идентификатора стандартного формата или биты 0...15 идентификатора расширенного формата) соответствующего отбора.
Регистр установки маски отбора X шлюза, CAN IDH
0...0x1FFF = установить значение маски старшей части идентификатора CAN-сообщения (биты 16...28 идентификатора расширенного формата) соответсвующего отбора.
Регистр установки маски отбора X шлюза, CAN ERL
0...0xFFFF = установить значение маски регистра ERL CAN-сообщения соотвествующего отбора.
Регистр установки маски отбора X шлюза, CAN D1:D0
...
Регистр установки маски отбора X шлюза, CAN D7:D6
0...0xFFFF = установить значение маски соответствующих байт данных CAN-сообщения соответствующего отбора.


Регистры замены отборов драйвера шлюза CAN.

Замена отбора - группа значений, биты которых определяют результат модификации попавшего в соответствующий отбор ретранслируемого сообщения. При значении бита замены равном "0", соответствующий бит ретранслируемого сообщения будет заменен нулем, при значении бита замены равном "1", соответствующий бит ретранслируемого сообщения будет заменен единицей. Замена будет применена лишь к тем битам, значение маски отбора для которых равно "1".

Регистр Ожидаемые значения
Регистр установки замены отбора X шлюза, CAN IDL
0...0xFFFF = установить значение замены младшей части идентификатора CAN-сообщения (биты 0...10 идентификатора стандартного формата или биты 0...15 идентификатора расширенного формата) соответствующего отбора.
Регистр установки замены отбора X шлюза, CAN IDH
0...0x1FFF = установить значение замены старшей части идентификатора CAN-сообщения (биты 16...28 идентификатора расширенного формата) соответсвующего отбора.
Регистр установки замены отбора X шлюза, CAN ERL
0...0xFFFF = установить значение замены регистра ERL CAN-сообщения используемого отбора.
Регистр установки замены отбора X шлюза, CAN D1:D0
...
Регистр установки замены отбора X шлюза, CAN D7:D6
0...0xFFFF = установить значения замены соответствующих байт данных CAN-сообщения соответствующего отбора.


Блок-схема работы контроллера в режиме CAN-шлюза

800px

See also

CANNY 5.2 duo

CANNY 5.2 duo, CAN Driver