08.08.2018, 07:01
Hi,
Do any have an example of how to mass greate virtual objects in json?
BR Even Sundgot.
Do any have an example of how to mass greate virtual objects in json?
BR Even Sundgot.
Json virtual object
|
08.08.2018, 07:01
Hi,
Do any have an example of how to mass greate virtual objects in json? BR Even Sundgot.
08.08.2018, 07:16
Why not use a script with grp.create in a loop? What kind of objects do you want to create?
08.08.2018, 07:25
That`s probably just as good. Im doing some testing and want to create 200 objects like this:
BACnet_001 to BACnet_200 And I want them to start at 32\1\1 Datatype 1 Byte scale
08.08.2018, 07:49
Code: for i = 1, 200 do
08.08.2018, 07:54
08.08.2018, 10:33
Is there any way to add the same script to several objects, but with one thing changing everytime?
I have this script that i want to add to 200 objects, but the ID needs to be changed everytime. from 65793 to 65992 require('bacnet') value = event.getvalue() bacnet.write(127001, 'analog value', 65809, value)
08.08.2018, 10:49
You can attach event script to a tag. Use event.dstraw to calculate BACnet object id from the group address that triggered the script.
08.08.2018, 10:54
Can you give me an example of this?
08.08.2018, 11:00
First, add a certain tag to all objects via mass edit. Then create an event script which is mapped to the tag you've added. If your range is 32/1/1..32/1/200 then you don't need any extra conversion since it is 65793..65992 in numeric form.
Code: require('bacnet')
08.08.2018, 11:36
(08.08.2018, 11:00)admin Wrote: First, add a certain tag to all objects via mass edit. Then create an event script which is mapped to the tag you've added. If your range is 32/1/1..32/1/200 then you don't need any extra conversion since it is 65793..65992 in numeric form. I dont understand how, but it works! Thanks!
09.08.2018, 13:29
Is there any way to adjust this script to match the range 32/2/1 - 32/2/250 and 32/3/1 - 32/3/250 (all have the same Tag)
I have 500 objects that i want to link to ID 0- 500.
09.08.2018, 16:41
(09.08.2018, 13:29)Evens Wrote: Is there any way to adjust this script to match the range 32/2/1 - 32/2/250 and 32/3/1 - 32/3/250 (all have the same Tag) Nothing has to be modified it will work. your bacnet range will be 66049 - 66290 and 66305 - 66554
------------------------------
Ctrl+F5
10.08.2018, 06:30
event.dstraw is an integer value of group address. You can easily convert to a 0..499 range like this:
Code: id = event.dstraw
10.08.2018, 08:37
Thanks!
I can’t get it to work properly. maybe I’m doing something wrong. How do you convert from Group Address to the number?
10.08.2018, 08:40
H/M/L
H * 2048 + M * 256 + L
10.08.2018, 08:52
Thanks!
This event.dstraw, do you have an easy explanation for it, I’d like to understand what it does.
10.08.2018, 09:28
event.dst is group address that triggered the script in H/M/L format, event.dstraw is the same address but in numeric form.
13.08.2018, 06:10
Thanks, Now i understand
|
« Next Oldest | Next Newest »
|