⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 router.vts

📁 BacNet ScriptsExamples(英文的)。用于数据采集。
💻 VTS
📖 第 1 页 / 共 3 页
字号:
    DA = MY_MAC_NET_1
    SNET = NET_2
    SADR = MY_MAC_NET_2
    MESSAGE = I-Could-Be-Router-To-Network, NET_4, 6
    )

  ;--------------------------------------------------------------

  TEST #5a
  --- Sending a local broadcast on network 1, containing a Router
  --- Busy To Network 5 message.

  DEPENDENCIES #2

  REFERENCE Clause 6.6.3.6

  SEND (
     NETWORK = NET_1
     MESSAGE = Router-Busy-To-Network, NET_5
     )

  --- The router should update its routing table and forward
  --- message to all downstreamed networks.

  EXPECT (
     NETWORK = NET_2
     DA = BROADCAST
     MESSAGE = Router-Busy-To-Network, NET_5
     )

  ;--------------------------------------------------------------

  TEST #5b
  --- Sending a routing message on network 2 to a device on
  --- network 5, containing a ReadProperty-Request (PresentValue
  --- of Analog-Input 5) APDU.

  DEPENDENCIES #5a

  REFERENCE Clause 6.6.3.6

  SEND (
     NETWORK = NET_2
     DNET = NET_5
     DADR = DEVICE_NET_5
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should not forward message on network 1 within
  --- a specified time period (30 sec, see 6.6.3.6), instead it
  --- could send back a local message, containing a Reject Message
  --- To Network 5 message with reason 2 (the router is busy and
  --- unable to accept messages at the present time).

  EXPECT (
     NETWORK = NET_2
     DA = MY_MAC_NET_2
     MESSAGE = Reject-Message-To-Network, 2, NET_5
     )

  ;--------------------------------------------------------------

  TEST #5c
  --- Sending a local broadcast on network 1, containing a Router
  --- Available To Network 5 message.

  DEPENDENCIES #5a

  REFERENCE Clause 6.6.3.7

  SEND (
     NETWORK = NET_1
     MESSAGE = Router-Available-To-Network, NET_5
     )

  --- The router should update its routing table and forward
  --- message to all downstreamed networks.

  EXPECT (
     NETWORK = NET_2
     DA = BROADCAST
     MESSAGE = Router-Available-To-Network, NET_5
     )

  ;--------------------------------------------------------------
--**** This needs to be updated *
  TEST #6a
  --- Sending a local message on network 1, containing an
  --- Initialize Routing Table message with a routing entry for 
  --- network 13, port 1.

  DEPENDENCIES none

  REFERENCE Clause 6.6.3.8 and 6.6.3.9

  SEND (
     NETWORK = NET_1
     DA = ROUTER_NET_1
     MESSAGE = Initialize-Routing-Table, 1, 13, 1, "Virtual Port"
     DER = TRUE
     )

  --- The router should update its routing table and reply by
  --- sending back a local message, containing an Initialize
  --- Routing Table Acknowledge message without any parameters.

  EXPECT (
     NETWORK = NET_1
     DA = MY_MAC_NET_1
     MESSAGE = Initialize-Routing-Table-Ack
     )

  ;--------------------------------------------------------------

  TEST #6b
  --- Sending a local message on network 2, containing an
  --- Initialize Routing Table message with routing entries for
  --- network 13, port 1, network 14, port 2 and network 15, port
  --- zero.

  DEPENDENCIES none

  REFERENCE Clause 6.6.3.8 and 6.6.3.9

  SEND (
     NETWORK = NET_2
     DA = ROUTER_NET_2
     MESSAGE = Initialize-Routing-Table, 3
     NL = X'000D', 1, 14, "Virtual Port 1"
     NL = X'000E', 2, 14, "Virtual Port 2"
     NL = X'000F', 0, 14, "Virtual Port 3"
     DER = TRUE
     )

  --- The router should update its routing table and reply by
  --- sending back a local message, containing an Initialize
  --- Routing Table Acknowledge message without any parameters.

  EXPECT (
     NETWORK = NET_2
     MESSAGE = Initialize-Routing-Table-Ack
     )

  ;--------------------------------------------------------------

  TEST #6c
  --- Sending a local message on network 1, containing an 
  --- Initialize Routing Table message without any parameters.

  DEPENDENCIES none

  REFERENCE Clause 6.6.3.8 and 6.6.3.9

  SEND (
     NETWORK = NET_1
     DA = ROUTER_NET_1
     MESSAGE = Initialize-Routing-Table, 0
     DER = TRUE
     )

  --- The router should reply by sending back a local message
  --- containing an Initialize Routing Table Acknowledge message
  --- with its complete routing table.

  EXPECT (
     NETWORK = NET_1
     MESSAGE = Initialize-Routing-Table-Ack
     NL > 0
     )

  ;--------------------------------------------------------------

  TEST #7
  --- Sending a global broadcast on network 1, containing an
  --- invalid network message.

  DEPENDENCIES none

  REFERENCE Clause 6.5.2.2

  SEND (
     NETWORK = NET_1
     DNET = 0xFFFF
     MESSAGE = 0x3F
     )

  --- The router should send back a local message, containing
  --- a Reject Message To Network FFFF message with reason 3
  --- (unknown network layer message type).

  EXPECT (
     NETWORK = NET_1
     MESSAGE = Reject-Message-To-Network, 3, 0xFFFF
     )

  ;--------------------------------------------------------------

  TEST #8
  --- Sending a local broadcast on network 1, containing an
  --- vendor specific network message.

  DEPENDENCIES none

  REFERENCE Clause 6.5.2.2

  SEND (
     NETWORK = NET_1
     MESSAGE = 0x02
     VENDORID = 1
     )

  --- The router should ignore these message, because it contains
  --- no DNET field.

  EXPECT (
    NETWORK = NET_1
    )

  ;--------------------------------------------------------------
  ;
  ; Following the tests for testing the router's capability to
  ; route AL messages
  ;

SECTION Testing the router's AL routing

  ;--------------------------------------------------------------

  TEST #0
  --- Sending a local broadcast on network 1, containing an I Am
  --- Router To Network 5 message, and sending a local broadcast
  --- on network 2, containing an I Am Router To Network 3 message,
  --- the repeat of the test #2 at the previous section, when this
  --- section is enabled alone.

  DEPENDENCIES none

  REFERENCE Clause 6.6.3.3

  SEND (
     NETWORK = NET_1
     MESSAGE = I-Am-Router-To-Network, NET_5
     )

  AND (
     NETWORK = NET_2
     MESSAGE = I-Am-Router-To-Network, NET_3
     )

  --- The router should update its routing table and forward
  --- message to all downstreamed networks.

  EXPECT (
     NETWORK = NET_2
     DA = BROADCAST
     MESSAGE = I-Am-Router-To-Network, NET_5
     )

  AND (
     NETWORK = NET_1
     DA = BROADCAST
     MESSAGE = I-Am-Router-To-Network, NET_3
     )

  ;--------------------------------------------------------------

  TEST #1
  --- Sending a local message on network 1 to a device on network 1,
  --- containing a ReadProperty-Request (PresentValue of
  --- Analog-Input 5) APDU.

  DEPENDENCIES none

  REFERENCE Clause 6.5.2

  SEND (
     NETWORK = NET_1
     DESTINATION = DEVICE_NET_1
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should not take any actions.

  EXPECT (
     NETWORK = NET_1
     )

  AND (
     NETWORK = NET_2
     )

  ;--------------------------------------------------------------

  TEST #2a
  --- Sending a routing message on network 1 to a device on
  --- network 2, containing a ReadProperty-Request APDU.

  DEPENDENCIES none

  REFERENCE Clause 6.5.4

  SEND (
     NETWORK = NET_1
     DNET = NET_2
     DADR = MY_MAC_NET_2
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should forward message to network 2, removing
  --- the DNET, DADR and HOPCNT and adding SNET and SADR.

  EXPECT (
     NETWORK = NET_2
     DA = MY_MAC_NET_2
     DER = TRUE
     SNET = NET_1
     SADR = MY_MAC_NET_1
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  ;--------------------------------------------------------------

  TEST #2b
  --- Sending a routing message on network 2 to a device on
  --- network 1, containing a ReadProperty-Request APDU.

  DEPENDENCIES none

  REFERENCE Clause 6.5.4

  SEND (
     NETWORK = NET_2
     DNET = NET_1
     DADR = MY_MAC_NET_1
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should forward message to network 1, removing
  --- the DNET, DADR and HOPCNT and adding SNET and SADR.

  EXPECT (
     NETWORK = NET_1
     DA = MY_MAC_NET_1
     DER = TRUE
     SNET = NET_2
     SADR = MY_MAC_NET_2
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  ;--------------------------------------------------------------

  TEST #2c
  --- Sending a routing message on network 1 to a device
  --- on network 5, containing a ReadProperty-Request APDU.

  DEPENDENCIES #0

  REFERENCE Clause 6.5.4

  SEND (
     NETWORK = NET_1
     DNET = NET_5
     DADR = DEVICE_NET_5
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should not take any actions.

  EXPECT (
     NETWORK = NET_1
     )

  AND (
     NETWORK = NET_2
     )

  ;--------------------------------------------------------------

  TEST #3a
  --- Sending a routing message on network 1 to a device
  --- on network 3 using a broadcast to determine the router,
  --- containing a ReadProperty-Request APDU.

  DEPENDENCIES #0

  REFERENCE Clause 6.5.4

  SEND (
     NETWORK = NET_1
     DNET = NET_3
     DADR = DEVICE_NET_3
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should forward message to the router for network 3
  --- on network 2, decrementing HOPCNT and adding SNET and SADR.

  EXPECT (
     NETWORK = NET_2
     DNET = NET_3
     DADR = DEVICE_NET_3
     SNET = NET_1
     SADR = MY_MAC_NET_1
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     )

  ;--------------------------------------------------------------

  TEST #3b
  --- Sending a routing message on network 1 to a device
  --- on network 3 using the router's address, containing a
  --- ReadProperty-Request APDU.

  DEPENDENCIES #0

  REFERENCE Clause 6.5.4

  SEND (
     NETWORK = NET_1
     DNET = NET_3
     DADR = DEVICE_NET_3
     ROUTER = ROUTER_NET_1
     DER = TRUE
     PDU = Confirmed-Request
     Service = ReadProperty
     Object = 0, Analog-Input, 5
     Property = 1, Present-Value
     )

  --- The router should forward message to the router for network 3
  --- on network 2, decrementing HOPCNT and adding SNET and SADR.

  EXPECT (
     NETWORK = NET_2
     DNET = NET_3
     DADR = DEVICE_NET_3

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -