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

📄 reinit.vts

📁 BacNet ScriptsExamples(英文的)。用于数据采集。
💻 VTS
字号:
  ; Testing Support for Executing the BACnet ReinitializeDevice Service
  ; Version 2.0
  ;
  ;       written by Steven T. Bushby, 10/30/96
  ;               updated 03/18/98 to match current draft test std
  ;
  ; 
  ;  This version assumes that the TD and IUT are on the same Ethernet
  ;  network (network 1).
  ;
  ;  Passwords use ASNI X3.4 encoding. This is the only character set
  ;  that VTS currently supports.
  ;
  ;  In the REFERENCE sections "(B)" refers to the BACnet standard and
  ;  "(T)" refers to the testing addendum.
  ;--------------------------------------------------------------

SETUP BACnet ReinitializeDevice Service Execution

  ;--------------------------------------------------------------
  ;
  ; Setting up the hardware parameters for the VTS computer (TD).
  ;
  ;
  ; the network parameter for the TD
  ;
  NET_1 = 1, ETHERNET, 0
  -- The network which connects the VTS computer to the IUT.
  -- Adjust the parameters as needed to reflect the actual
  -- physical environment. The first value represents the 
  -- physical network number, the second value the physical 
  -- network type and the third value the physical port.
 
  MY_MAC = 00a0242daf41    -- MAC address of the TD
                           -- replace with you TD address

  ;--------------------------------------------------------------
  ;
  ; Setting up the hardware parameters for the IUT.
  ;
  ;
  IUT_MAC = 00602d00006b   -- MAC address of IUT
                           -- replace with your IUT address
                            
  DEVICE_ID = 207          -- Device object instance for IUT.

  PASSWORD = "ThisIsAPassword"   -- replace with a valid password

  BADPASSWORD = "nonsense"       -- this should be an invalid password

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

SECTION Testing the execution of the ReinitializeDevice service

  ;--------------------------------------------------------------
  ; Test group 1 implements the positive ReinitializeDevice service
  ; execution tests.
  ;

  TEST #1a
  -- Coldstart with no password

  DEPENDENCIES none                         

  REFERENCE (B)16.4; (T) 9.23.1.1

  SEND (
    NETWORK = NET_1
    DESTINATION = IUT_MAC
    DER = TRUE
    PDU = Confirmed-Request
    Service = ReinitializeDevice
    ENUM = 0, 0                          ;coldstart
    )

  -- If passwords are not required the IUT should respond with a
  -- simple acknowledgement and then reset. There may or may not 
  -- be a visual indication that the reset has occured. If a 
  -- password is required then one of the indicated error messages
  -- should be returned.
  
  EXPECT (
    Network = NET_1
    Destination = MY_MAC
    DER = FALSE
    PDU = Simple-Ack
    Service = ReinitializeDevice
    )

  OR (
    NETWORK = NET_1
    DER = FALSE
    PDU = Error
    Error-Choice = ReinitializeDevice
    ENUMERATED = 5                       ;error class: services
    ENUMERATED = 26                      ;error code: password failure
    )

  OR (
    NETWORK = NET_1
    DER = FALSE
    PDU = Error
    Error-Choice = ReinitializeDevice
    ENUMERATED = 5                      ;error class: services
    ENUMERATED = 16                     ;error code: missing required parameter
    )


;--------------------------------------------------------------
  TEST #1b
  -- Coldstart with a correct password

  DEPENDENCIES none                         

  REFERENCE (B)16.4; (T) 9.23.1.2

  SEND (
    NETWORK = NET_1
    DESTINATION = IUT_MAC
    DER = TRUE
    PDU = Confirmed-Request
    Service = ReinitializeDevice
    ENUM = 0, 0                           ;coldstart
    CHARSTRING = 1, ANSI X3.4, PASSWORD
     )

  -- The IUT should respond with a simple acknowledgement
  -- and then reset. There may or may not be a visual
  -- indication that the reset has occured.
  
  EXPECT (
    Network = NET_1
    Destination = MY_MAC
    DER = FALSE
    PDU = Simple-Ack
    Service = ReinitializeDevice
    )

;--------------------------------------------------------------
  TEST #1c
  -- Warmstart with no password

  DEPENDENCIES none                         

  REFERENCE (B)16.4; (T) 9.23.1.3

  SEND (
    NETWORK = NET_1
    DESTINATION = IUT_MAC
    DER = TRUE
    PDU = Confirmed-Request
    Service = ReinitializeDevice
    ENUM = 0, 1                            -- warmstart
    )


  -- If passwords are not required the IUT should respond with a
  -- simple acknowledgement and then reset. There may or may not 
  -- be a visual indication that the reset has occured. If a 
  -- password is required then one of the indicated error messages
  -- should be returned.
  
  EXPECT (
    Network = NET_1
    Destination = MY_MAC
    DER = FALSE
    PDU = Simple-Ack
    Service = ReinitializeDevice
    )

  OR (
    NETWORK = NET_1
    DER = FALSE
    PDU = Error
    Error-Choice = ReinitializeDevice
    ENUMERATED = 5                       ;error class: services
    ENUMERATED = 26                      ;error code: password failure
    )

  OR (
    NETWORK = NET_1
    DER = FALSE
    PDU = Error
    Error-Choice = ReinitializeDevice
    ENUMERATED = 5                      ;error class: services
    ENUMERATED = 16                     ;error code: missing required parameter
    )

;--------------------------------------------------------------
  TEST #1d
  -- Warmstart with a correct password

  DEPENDENCIES none                         

  REFERENCE (B)16.4; (T)9.23.1.4

  SEND (
    NETWORK = NET_1
    DESTINATION = IUT_MAC
    DER = TRUE
    PDU = Confirmed-Request
    Service = ReinitializeDevice
    ENUM = 0, 1                          ;warmstart
    CHARSTRING = 1, ANSI X3.4, PASSWORD
    )

  -- The IUT should respond with a simple acknowledgement
  -- and then reset. There may or may not be a visual
  -- indication that the reset has occured.
  
  EXPECT (
    Network = NET_1
    Destination = MY_MAC
    DER = FALSE
    PDU = Simple-Ack
    Service = ReinitializeDevice
    )

  ;--------------------------------------------------------------
  ; Test group 2 implements the negative ReinitializeDevice service
  ; execution tests.
  ;

  TEST #2a
  -- Coldstart with an invalid password

  DEPENDENCIES none                         

  REFERENCE (B)16.4; (T) 9.23.2.1

  SEND (
    NETWORK = NET_1
    DESTINATION = IUT_MAC
    DER = TRUE
    PDU = Confirmed-Request
    Service = ReinitializeDevice
    ENUM = 0, 0                           ;coldstart
    CHARSTRING = 1, ANSI X3.4, BADPASSWORD
     )


  -- The IUT should respond with the indicated error
  
  
  EXPECT (
    NETWORK = NET_1
    DER = FALSE
    PDU = Error
    Error-Choice = ReinitializeDevice
    ENUMERATED = 5                       ;error class: services
    ENUMERATED = 26                      ;error code: password failure
    )

;--------------------------------------------------------------
  TEST #2b
  -- Coldstart with an invalid password

  DEPENDENCIES none                         

  REFERENCE (B)16.4; (T) 9.23.2.2

  SEND (
    NETWORK = NET_1
    DESTINATION = IUT_MAC
    DER = TRUE
    PDU = Confirmed-Request
    Service = ReinitializeDevice
    ENUM = 0, 1                           ;warmstart
    CHARSTRING = 1, ANSI X3.4, BADPASSWORD
     )


  -- The IUT should respond with the indicated error
  
  
  EXPECT (
    NETWORK = NET_1
    DER = FALSE
    PDU = Error
    Error-Choice = ReinitializeDevice
    ENUMERATED = 5                       ;error class: services
    ENUMERATED = 26                      ;error code: password failure
    )

⌨️ 快捷键说明

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