MultiState Indicator - Bind color to SQL tag or property

I am using the MultiState Indicator and would like to be able to bind the Background Color to a SQL tag or property value. We have all the colors for different the states that are stored in a database table which allows the users to customize the colors for the states based on their site standards. One customer may want a “Normal” state (ie. state 0) to be green, while another customer may want that same Normal state to be blue.

Is it possible either by SQL tag, property, or other means to bind the colors so that they can be set by user preference?

Thanks -

Hi, Bob.

Right Click on the component and browse down to the Style Customizer (Ctrl-U does the some thing)

You can use the Style Customizer to make the Indicator however you wish. The default setup is shown here.

Hope this helps!

Hi Jordan,

I have used the Style Customizer for the MultiState Indicator, but I still don’t see how I can make the background color dynamic. What I would like is to ship a generic product and not need to go into the style customer for each customer, or have them do it, yet allow for different colors to be defined for each state as desired by each indicidual customer.

We have a utility that lets users select a state and assign their desired color to each state simply by selecting a color from a drop-down box. Then their preferences are saved to a database table. We would like the application to be able to read the customer preferences from the database and set the state background colors dynamically.

Thanks -

Use the Style Customizer to set a generic look for your multistate indicator, then go to the Property Editor, find the States property, select binding, Cell Update and bind the desired dataset cell to a string tag.

Ah! You mean even more dynamic! :smiley:

Since you’re storing it into a table, You could bind the background color to an SQL Query.

As a better option (to avoid a boatload of queries just for colors), you could make a client tag with the color table in it, then use a lookup expression to bind the background color.

Oh! and before I forget, you would still need to go into the Style customizer and remove the background color from the “Used properties list”

Or… see what y’all did? ya got me goin’!

You could bind the entire Styles dataset to the client tag I mentioned in my earlier post.

Or… ok, never mind, that was really all I had… :laughing:

Thank you for these suggestions! I will try to implement one of them. I always figure there is a way to do what I need with Ignition due to it’s flexibility, but since I am new to Ignition sometimes I need a little direction.

I’m not sure which approach I will take, but if I bind to a SQL Query, but set Polling Mode to OFF, then it will just get the value one time when the Window is instantiated without going back and forth to teh database, correct?

Thanks -

A polling off query will only run once every time the window is opened.

I create string tags for all my different color properties used in a project. For instance I might have a tag called TextSetpointValue and TextProcessValue and then I’ll bind to those tags throughout my project. That gives you one place to change all the colors in your project, the value of the tag only needs to be loaded once and I like having a folder called Colors under which all my color tags reside.

I don’t poll the database for colors, I like to keep the databases resources available for important things (not that the database can’t handle it) but I don’t feel polling the database for a color value every time a window is opened is important.

Just my $0.02