AdvancedHMI Software
General Category => Open Discussion => Topic started by: DJShardy on October 24, 2018, 10:50:45 PM
-
Hi,
I have a seven segment display that I want to change to be either red or green.
The red/green is determined by where the factory is in regard to the goal.
In the properties, I can only see the option to change colour depending on the value the seven segments is displaying. ( foreColourOverHighLimit etc.)
Is there any way I can change the colour another way. Like from a BOOL in the PLC. I can do the maths and determine if they are ahead or behind target.
Thanks!
-
I assume I need to place some code in here. I have no idea what to do though. Have tried google and the forum but this hasn't come up before.
Private Sub SevenSegment21_ForeColorChanged(sender As Object, e As EventArgs) Handles SevenSegment21.ForeColorChanged
End Sub
-
The SevenSegment2 has the following properties for changing color based on value:
ForeColorHighLimitValue
ForeColorInLimits
ForeColorLowLimitValue
ForeColorOverHighLimit
ForeColorUnderLowLimit
These properties will let you set up to 3 colors, then 2 limit values. Essentially you have a value good, value low, and value high.
-
Yes, I understand that, But What I'm trying to do is have it change to red or green based on the plant being under or over the production goal for tthe current point in time.
Eg - Goal is 10 widgets over a 12-hour shift. If at the 6-hour mark they have completed 4 widgets the seven segment display would be red. However the next day at the 6-hour mark they have made 5 it would be green.
Is that clear?
I was wondering if its possible to use a Data subscriber & an IF Else statement to change the seven segment display properties so I can manipulate the ForeColorHigh from red to green as I need. I could keep the ForeColorHighLimitValue as 1 and just change the properties.
Thanks!
-
View the code for SevenSegement2.vb
In the Properties Region, add this line of code (case sensitive, so it must be exact):
Public Property PLCAddressForecolorHighLimitValue As String
Build the Solution
Set ForeColorOverHighLimit to Green
Set ForeColorInLimits to Red
Set the new property of PLCAddressForecolorHighLimitValue to a PLC address that holds the target value
Set PLCAddressValue to point to the actual value
Now when you run the application, it will track the moving target calculated in the PLC.
-
I was wondering if its possible to use a Data subscriber & an IF Else statement to change the seven segment display properties so I can manipulate the ForeColorHigh from red to green as I need. I could keep the ForeColorHighLimitValue as 1 and just change the properties.
Yes, you could do it that way to
-
Great, This works exactly how I needed it to. Thank you.
For future reference, If I was to go the Data subscriber way. Where would I put the code for something like this?
Is there any documentation I can read?
Thanks
-
After you add the DataSubscriber to the form, you double click it and it will take you back to the code for the DataChanged event handler. The code will be behind the form that has the DataSubscriber