I would like to use VTS scripting functionality to get all objects of a device and display the complete returned list using the VTS GUI. The corresponding BACnet server does not support segmentation and the device contains a lot of objects, about 300. I'm completely unexperienced writing VTS scripts and therefore would like to know whether there is eventually an existing script for that task available anywhere.
Thanks in advance for any hint!
Brix
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try the following. It assumes that you have defined a "name" in VTS called "IUT" for your test device.
It unicasts a Who-Is to that address to get the device's DeviceID. (This is backwards from a "real" BACnet setup, in which you would usually broadcast a WhoIs to find the ADDRESS of a known DeviceID. But VTS is kind of address-centric)
It then reads the object list
(Copy the remainder of this message to a file and compile/run as a .vts script)
SETUP Read the Object List
; This script assumes that you have a VTS "name" defined for "IUT" with the address
; of the device whose object list is to be read
IUT_DEVICE_OBJECT = DEVICE, 1 ; Variable to hold the DeviceID
SECTION The tests
TEST Send a WhoIs to get the device's ID
SEND (
PDU = Unconfirmed-Request
Service = Who-Is
)
EXPECT (
PDU = Unconfirmed-Request
Service = I-Am
Object >> IUT_DEVICE_OBJECT ; DeviceID
Unsigned ? ; max APDU
Enum ? ; segmentation
Unsigned ? ; max APDU
)
TEST Read the Object List
SEND (
PDU = Confirmed-Request
Service = ReadProperty
Object = 0, IUT_DEVICE_OBJECT
Property = 1, Object-List
)
Thanks for sending me this script.
I'm not sure whether I got you right?
Do I really have to define exactly the name IUT for my test device?
I already have a name defined called Testname using a Port named Test and an Address 192.168.153.130:47808.
If I try to use that I get "destination address IUT not found. Where would i have to adapt your script to work with another existing name like Testname?
If I define a name IUT as proposed and run the script I get "Test Read Object List failed".
As I'm quite a newbie with VTS it's probably my fault, but I think I need more advices to get it run!
Thank you in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please read the "VTS Survival Guide" in the VTS/docs directory.
If the test fails, look in the VTS packet list to see what went wrong. It will show any errors in the script, whether an unexpected response was returned, etc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since your device does not support segmentation and you need to read a list that contains 30 objects. The only way to read the object-list is by index. Unfortunately, I am not aware of a way to write a script in VTS to read each item out of the object-list individually as you require. The VTS scripting language does not have any loop type constructs. I am also not aware of a way to 'print out' the results of a script. Maybe John can correct me if I am missing something.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all!
I would like to use VTS scripting functionality to get all objects of a device and display the complete returned list using the VTS GUI. The corresponding BACnet server does not support segmentation and the device contains a lot of objects, about 300. I'm completely unexperienced writing VTS scripts and therefore would like to know whether there is eventually an existing script for that task available anywhere.
Thanks in advance for any hint!
Brix
Try the following. It assumes that you have defined a "name" in VTS called "IUT" for your test device.
It unicasts a Who-Is to that address to get the device's DeviceID. (This is backwards from a "real" BACnet setup, in which you would usually broadcast a WhoIs to find the ADDRESS of a known DeviceID. But VTS is kind of address-centric)
It then reads the object list
(Copy the remainder of this message to a file and compile/run as a .vts script)
SETUP Read the Object List
; This script assumes that you have a VTS "name" defined for "IUT" with the address
; of the device whose object list is to be read
IUT_DEVICE_OBJECT = DEVICE, 1 ; Variable to hold the DeviceID
SECTION The tests
TEST Send a WhoIs to get the device's ID
SEND (
PDU = Unconfirmed-Request
Service = Who-Is
)
EXPECT (
PDU = Unconfirmed-Request
Service = I-Am
Object >> IUT_DEVICE_OBJECT ; DeviceID
Unsigned ? ; max APDU
Enum ? ; segmentation
Unsigned ? ; max APDU
)
TEST Read the Object List
SEND (
PDU = Confirmed-Request
Service = ReadProperty
Object = 0, IUT_DEVICE_OBJECT
Property = 1, Object-List
)
EXPECT (
PDU = ComplexAck
Service = ReadProperty
Object = 0, IUT_DEVICE_OBJECT
Property = 1, Object-List
OpenTag 3
ANY
CloseTag 3
)
Thanks for sending me this script.
I'm not sure whether I got you right?
Do I really have to define exactly the name IUT for my test device?
I already have a name defined called Testname using a Port named Test and an Address 192.168.153.130:47808.
If I try to use that I get "destination address IUT not found. Where would i have to adapt your script to work with another existing name like Testname?
If I define a name IUT as proposed and run the script I get "Test Read Object List failed".
As I'm quite a newbie with VTS it's probably my fault, but I think I need more advices to get it run!
Thank you in advance
Yes, you need a name for IUT.
Please read the "VTS Survival Guide" in the VTS/docs directory.
If the test fails, look in the VTS packet list to see what went wrong. It will show any errors in the script, whether an unexpected response was returned, etc.
Since your device does not support segmentation and you need to read a list that contains 30 objects. The only way to read the object-list is by index. Unfortunately, I am not aware of a way to write a script in VTS to read each item out of the object-list individually as you require. The VTS scripting language does not have any loop type constructs. I am also not aware of a way to 'print out' the results of a script. Maybe John can correct me if I am missing something.