How to Dynamically Move an Image Component Based on Database Values in Ignition Perspective?

Hello Ignition Community,

I'm working on a project in Ignition Perspective where I need to dynamically move multiple image components based on X and Y coordinates retrieved from a database. I’m trying to avoid creating many tags for each component and would prefer to directly input the database values into each component's x and y position properties.

Project Details:

  • I am using a Named Query to fetch the latest x_coordinate and y_coordinate values from a database table.
  • My goal is to dynamically update the position of several image components (icon_operator and others) based on the coordinates returned from the query.

My Questions:

  1. Direct Binding to Database Values: Is there a way to directly input the database values (from a Named Query or similar) into the x and y position properties of the components in Perspective without using tags or session properties? I would like to handle this programmatically since there will be many image components to update.
  2. System Functions Not Working in Perspective: Functions like system.gui.getWindow() and system.nav.openWindowInstance() that I used in Vision aren't working in Perspective. What is the correct way to access and update component properties like x and y in Perspective?
  3. Path of Components in Perspective: How do I get the path of the components in Perspective for scripting purposes? In Vision, I could use methods like getComponent() or getRootContainer(), but these do not seem to apply in Perspective. How do I reference components dynamically in Perspective to update their properties?

I'd appreciate any guidance or examples of how to achieve this in Ignition Perspective without creating many tags or relying heavily on session properties. I'm looking for an efficient way to move multiple image components dynamically based on real-time database updates.

Thank you!

Use a map component or a view canvas

1 Like