Main Board Discussion

filter() function does not return an altered table

I don't know if it's a bug or a feature...

Should the filter function return a new table or not?

I've encountered a problem where after applying dr(0) to the filter function's result, it returns the first row of the original table, not the first row after the function.

I think it's a bug.

G

OPC server tags

I have an OPC server with 297 tags. The tag values ​​are updated every minute. I want to take these values ​​and write them to the database using a Java script. What's the best way to do this using an absolute model?

Li Jiaqi

Catch variable changes with an activator: users.admin.devices.opcua:updated@

Extract name and value via {env/value}, then write where needed

G

Searching value

I've encountered a problem. I'm trying to find a value in a table by using filter() and counting the number of rows in the filtered table, but this doesn't work:

filter({.:blacklist},"{id}==6")#records

Can you tell me what I'm doing wrong?

Li Jiaqi

The #records syntax is used within references.
For your task, you can use the expression language function records():

records(
filter(
{.:blacklist}
, "{id} == 1"
)
)

G

Instantiable Model - where do objects go?

Hello everyone!

Where do instances go after the validity expression in the instantiable model changes?

In theory, they are not going anywhere. An instance is a row in the database. If it's not deleted permanently, then returning the original expression should restore it. Or at least that used to be the case.

G

Line Chart Data

I'm loading data into a line chart using the variable source type.

Can I read the current data or display it in a table?

If I can't, then as I understand it, I'll have to duplicate the query using callFunction("utilities","variableHistory","model name","variable name", start date, end date)

The graph definitely aggregates this data somewhere for display, so I don't want to duplicate the query.

1
Li Jiaqi

Yes, you'll have to do it separately or provide the dataset for the chart yourself (through Source data)

G

Discussion guidelines

  • Respect each other

  • All posts must be on topic and relevant to the discussion

  • No offensive language

  • No personal attacks