Tag.browse , doesnt return value-key

Hi,
I’m trying to create a script in the project library to store some tag values to a database.
Using system.tag.browse in the script console, I’m able to do this by using

timers = system.tag.browse(path = "[default]Limits/Speed")
for row in timers.getResults():
    print row
    val = row["value"]

Adding the script to the project library, It seems like the “value” - key is not available.
Kinda strange since I can see this when I print each row :slight_smile:


image

Without seeing the rest of script, I’m just guessing, but your browse is called timers, yet you’re calling getResults() on limits

1 Like

Copy/paste error from script console. Bad example :slight_smile:

Can’t you use system.tag.readBlocking? It should be much more efficient for reading the values.

Is it more efficient to execute a readBlocking when the value allready exists in the browse result?
Seems like the script somehow is working from project library now, can’t say I have done any adjustments :slight_smile: Guess the good old “restart your computer” did the trick.

If you need some or all of the data that is returned with the browse results then yeah, it makes since to pull the value from them. If you don’t then, readBlocking is definitely going to be more efficient.

I see that I didn’t explain what I was trying to achieve :slight_smile: I’m using browse to extract tag name,full path and value to log to a database. Easy way to have a backup of “retain” variables in the plc.