Author Topic: AnalogValueDisplay  (Read 1186 times)

PMT Tech

  • Newbie
  • *
  • Posts: 5
    • View Profile
AnalogValueDisplay
« on: February 28, 2017, 09:39:14 AM »
I need a bit of assistance from anyone available. I am attempting to create a new control, based on the AnalogValueDisplay, I don't understand how the PLCAddressValueLimit actualy works. My need is to have two sets of limits, as well and a Blink timer based on hitting the higher or lower of the two. My main concern is I can not seem to find the exact point at which the m_ValueLimitUpper and the v it is compared to actually changes. Any assistance would be appreciated.

Godra

  • Hero Member
  • *****
  • Posts: 1443
    • View Profile
Re: AnalogValueDisplay
« Reply #1 on: February 28, 2017, 10:42:58 AM »
Instead of creating a new control, see if the SevenSegment2 control might be useful for what you want to do.

PMT Tech

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AnalogValueDisplay
« Reply #2 on: February 28, 2017, 10:49:47 AM »
I looked at that, however I did not see a plc addressable set of limits plus I need two sets of two, example hi hihi low lowlow limits. Which is why I was originally looking to simply copy and past the sections for the analogvaluedisplay to create two sets of limits, the hihi and lowlow being set to blink. I will reinvestigate the sevensegment2 control. Thank you

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: AnalogValueDisplay
« Reply #3 on: February 28, 2017, 01:12:48 PM »
The value returned by the PLC (set by PLCAddressValue) is compared to ValueLimitLower. If the value is less, the ForeColor will change to the color specified by ForeColorUnderLimit

If an address is specified in PLCAddressValueLimitLower, then ValueLimitLower will be set to the value returned from the PLC.

The exact code at line 246 in AnalogValueDisplay.vb, where v=Value :

            If v > m_ValueLimitUpper Then
                MyBase.ForeColor = m_ForeColorOverLimit
            ElseIf v < m_ValueLimitLower Then
                MyBase.ForeColor = m_ForeColorUnderLimit
            Else
                MyBase.ForeColor = m_ForeColorInLimits
            End If




On another note, any property of a control can be linked to a PLCAddress simply by adding a single line of code to the control code. For Example, you can add this to SevenSegment2.vb:

Public property PLCAddressForeColorHighLimitValue As String


The key to this working is the text following PLCAddress must be the exact match of the property name including the casing.

bachphi

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: AnalogValueDisplay
« Reply #4 on: February 28, 2017, 03:39:58 PM »
Why not simply have 2 AnalogValueDisplays?  One for Lo-LoLo  and the other for Hi-HiHi.
And If you want only one to display , use valueChanged event to control visibility
« Last Edit: February 28, 2017, 03:41:55 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

PMT Tech

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AnalogValueDisplay
« Reply #5 on: March 01, 2017, 12:31:41 PM »
Thanks Archie, I will start working on it with that information this coming week.

PMT Tech

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AnalogValueDisplay
« Reply #6 on: March 01, 2017, 12:47:09 PM »
Most of the restraints I have, as far as what is on the screen, are hard restraints. My company, does not want to stray to far away from the current scheme on the rsview systems. I am hopeful after the system is proven they will let me go back and make the layouts more efficient and clean. That's why I couldn't use two AnalogValueDisplays. The value changed aspect crossed my mind but they change that value via the plc then the plc calculates what it considers the alarm bands. RSview triggered based on one bit for the hi/low alarm and one bit for the hihi/lowlow alarm so two bits this is different from the word or double that the valuelimits are looking for in the current AnalogValueDisplay. More or less the powers that be would like the machine to look and operate as close to identical as possible to the RSView system.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: AnalogValueDisplay
« Reply #7 on: March 01, 2017, 01:25:39 PM »
Is the objective to change the text color based on the 2 alarms bits?