Gabriel Franco Posted December 4, 2021 Report Share Posted December 4, 2021 ¿Is it possible to change background or font color to numeric box based on different values? I want to show a process value with different colors based on limits (Lo-Lo, Lo, Hi, Hi-Hi), something like numeric range in Visilogic Link to comment Share on other sites More sharing options...
Gabriel Franco Posted December 10, 2021 Author Report Share Posted December 10, 2021 @Cara Bereck Levy as it is not currently available, I suggest to implement it in next versions. Link to comment Share on other sites More sharing options...
Dave Posted December 10, 2021 Report Share Posted December 10, 2021 It's what I call brute force programming, but you could have multiple numeric boxes placed on top of each other, each with different fonts/background. Then use ladder logic to control the visibility of each box based on the current value. Link to comment Share on other sites More sharing options...
Ness Posted December 13, 2021 Report Share Posted December 13, 2021 Using a "List of Text Variable" object behind a Numeric Box with a transparent background can get you the background color change with only 2 objects. This doesn't allow text color changes like stacked numeric boxes will though. Link to comment Share on other sites More sharing options...
GetAGrip Posted April 8, 2022 Report Share Posted April 8, 2022 I believe my twist on Ness's suggestion is a good work-around (I tested it, it works well and likely comes closer to what people actually need): Use the available "Numeric Box" (set the layer = 2) with a transparent background and put that on top of a "Range Of Text Variable" box (send to background, set layer = 1). Typically you would set the Tag Link in the Range Of Text Variable box the same as the Numeric Value you put in the numeric box. Fill in constants or a variable in each of the "From" and "To" boxes of the collection of "Texts, Ranges" for the various background colors you desire. For the "text" in the collection you create just enter " " for each, and set the background color as desired (foreground doesn't matter since it won't be displayed). This gives you a variable to select the background color (can be the same variable) and it allows the background color to be selected from a list. I does not allow you to set the foreground color of the Numeric Box, see below for that. If Unitronics created a Numeric Box with the Range Collection like the Range of Text Variable this would work even better because it would allow the changing of both foreground and background colors. In the Range Collection Unitronics would just need to substitute "###.##" OR "123.45" or what ever format is selected in the format portion instead of allowing the user to type in text. Then the programmer would have the option to select ranges or put variables in the ranges instead of constants that would dynamically change the colors from a pre-determined collection of colors. That is far more useful than just having to force the background to a particular color, and would only require adding one or two fields to the existing Numeric Box {Range Collection & possibly the Range Value if they want to make that independent of the primary Numeric Value field}. I would suggest adding the Range Value box and defaulting to the Numeric value variable when the Range Value is blank that way the programmer has full control in the event they actually need to control the color independent of the numeric value. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now