Perspective view taking too long to load

Hi,

I have a views with table component and named query(stored procedure) has bind to data property with 1sec polling rate.

Screen is taking too much time to load, I think it is because of 1 sec polling rate.

How I can avoid the use of polling rate here?

table data is updating frequently from other screens, mainly status column is updating, so to populate that I have used polling rate 1 sec.

Is there any other option instead of polling rate?

Thanks!

If it's getting updated on the same session, then you can create a message handler that does refreshBinding when the update is done.

So the status column data is coming from an SQL table?

yes

All of the updates are from inputs to Ignition UIs? If so, have those UIs broadcast their update IDs after their DB operation succeeds. Have your overview listen for these broadcasts and refresh the table binding on demand.

Also, make sure your DB can actually deliver the requested data in a few milliseconds. Get a DBA to analyze your tables/queries to optimize them if you cannot do so yourself. (It is unreasonable to expect 1-second updates for queries that take longer.)

Thanks all of you!!!

I will try these solutions.

Hi,

I have added the message handler on all the places from where status is updaing.

from button events it is updating as expected.

but when I am calling message handler from project library script, it is not updating.

I have 2 project ..the screen which I want to update is in parent project and it is inherited in child and script library functions is in child project.

I am calling message handler in script library where the status are updating.

will it work?

Thanks!!!

The project library is not an independent scope. It's scope is the scope of the original event that calls into it. What scope is calling the project library when it fails? (That will be your answer.)

I am calling in session scope like below in script library function of child project.

This is the handler on view, it is just for refreshing the table bindings.

That doesn't show how that project library is called. So no, that doesn't definitively show session scope.

That project library is called in gateway events tag change script.

Then it is Pure Gateway Scope, and not Session scope. I'm not sure that system.perspective.sendMessage() will work here.

I would default to system.util.sendMessage()

what should be the projrct name in system.util.sendMessage()?(parent or child project)

I want to refresh the view which is inherited in child project and project library script also in child project.

showing below error when I am passing parent project name

and this is error when child project name is given

image

It should be the project where the message handler is located.

Make sure that the name you used for the message handler matches exactly.

Also insure that you have saved the project after adding the handler.

Couldn't the project name be automatatically generated using system.util.getProjectName | Ignition User Manual?

message handler located in parent project and I want to call that in child.

I tried with both name but not working.

Its already saved.

As I am calling message handler in child, If I use system.util.getProjectName(), it will return child name.

The project name should be the name of the project where the message handler is located. The message handler will be running in the child project so that project name should be used.

1 Like

No still not working, I am calling like below inscript library of child project.

showing same error, message handler could not found.

anything wrong in this
system.util.sendMessage(system.util.getProjectName(),'RefreshList',scope='G')

Yes, you are not sending the message to 'Session' scope.

system.util.sendMessage(system.util.getProjectName(),'RefreshList')

or

system.util.sendMessage(system.util.getProjectName(),'RefreshList',scope='S')

Also, I just caught this:

message handlers should not be in inheritable projects, they should be located in the project you are actually running.

It should be noted that if you are using system.util.sendMessage, your perspective message handler will need to re-broadcast the received message or broadcast a different message with system.perspective.sendMessage for any open views in a session to receive a message.

The system.perspective.sendMessage call in the perspective message handler will only work with a scope of session

Component and view message handlers will not receive messages from a system.util.sendMessage call.