This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Get list of objects
#1
Hi

I have a need to get a list of objects inside the SL/LM based on the main group. What I would like to do is make a query for all objects in main group 0.

I have tried some different SQL lookup, but due to my restricte knowledge of SQL I am not able to get a list based on the group address, only based on the name. Anyone have a tip how to proceed?

What I have done so far is:
Code:
liste = db:getall('SELECT address FROM objects WHERE name LIKE "%lys set value%"') -- returns a list with all objects containing this string
liste = db:getall('SELECT address FROM objects WHERE address LIKE "%0/0%"') -- returns empty list, as the address in the SQL table seems to be a number, not a string.
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply
#2
You need to query WHERE id BETWEEN 1 AND 2047
This will get all objects between 0/0/1 and 0/7/255
Reply
#3
Ah, Ok. Will do that.

So that means I need to calculate the different values for the different main groups?

The reason I need this is that in one project we have 30 SL's, and in each we only want to have certain main groups available due to capasity. I then need to create a script that automatically delete the not wanted objects once a day or something.
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply
#4
You can disable bus sniffer in main configuration. This will stop new objects from appearing.
Group address is 2 bytes split into parts as 5/3/8 bits.
Reply
#5
(16.07.2019, 11:39)admin Wrote: You can disable bus sniffer in main configuration. This will stop new objects from appearing.
Group address is 2 bytes split into parts as 5/3/8 bits.

Yeah, I know about the bus sniffer, but in this case we have a large ETS project, and we only want one part of the project in each SL. So I want to just import the complete ESF-file and then just let the script delete what I do not need. The script can then just run once a day to make sure any new import is also cleaned up.

Trond
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply


Forum Jump: