Menu

#15 Conditional Statements in BACnet VTS script

v1.0 (example)
open
nobody
None
1
2014-08-06
2014-08-06
No

Hi,
I am new to BACnet VTS scripting.Are there any conditional statements in VTS script?
For example IF,WHILE,DO-WHILE etc.If yes,can I get syntax and examples for each of them.

Thanks in Advance

Discussion

  • Indraja Jaladi

    Indraja Jaladi - 2014-08-06

    Hi,
    I am new to BACnet VTS scripting.Are there any conditional statements in VTS script?
    For example IF,WHILE,DO-WHILE etc.If yes,can I get syntax and examples for each of them.

    Thanks in Advance

     
  • John Hartman

    John Hartman - 2014-08-06

    VTS scripting is not a full language. It has no looping, and no run-time IF.

    There is an IF/ENDIF, but it is done during "Check syntax" time, like #if in C.

    There are no subroutines, but you can sometimes use "include" to approximate them.

    You can do quite complex things with these simple tools. For example, I have written a set of scripts to test various options of the Schedule object. A portion of it looks like this:

     IF (AUTO_SET_PROPERTY = schedule-default)
       IF (VALUE_TYPE = "BOOL")
         include "Schedule_setDefault_bool.vts"
       ENDIF
       IF (VALUE_TYPE = "ENUM")
         include "Schedule_setDefault_enum.vts"
       ENDIF
       IF (VALUE_TYPE = "REAL")
         include "Schedule_setDefault_real.vts"
       ENDIF
       IF (VALUE_TYPE = "UINT")
         include "Schedule_setDefault_uint.vts"
       ENDIF
     ENDIF
    

    The options must be set before "Check Syntax", but the scripts are still very useful for regression testing etc.

    The documentation is limited. Read everything in the "Docs" folder, examples in the "scripts" folder, and the source code.

     

Log in to post a comment.