Author Topic: Reference document for AdvancedHMI  (Read 3330 times)

Ronkpa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Reference document for AdvancedHMI
« on: September 15, 2017, 11:45:31 AM »
I'm just getting started with AdvancedHMI Modbus TCP and so far it is working great. Are there any reference documents available for AdvancedHMI that cover things such as MaxReadGroupSize and SwapWords and other things like that which are available? Also if I want to create my own ControlComponent and have it automatically send and receive data just like the the AdvancedHMIControlComponents (without using explicit reads and writes), how would I get started? Lastly is there a way to set up an AdvancedHMIControlComponent to handle Unsigned Long (UInt32)? Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Reference document for AdvancedHMI
« Reply #1 on: September 15, 2017, 01:36:04 PM »
Over the years the documentation has become fragmented and scattered about, but recently an effort has been made to slowly consolidate it on a wiki found here:

http://advancedhmi.com/documentation

Creating components from scratch does require some fairly advanced programming techniques and can take a while to master. One place to start is in the Additional Components section of the forum. There are many examples with full source code. One in particular that is good to start with is the Aqua gage.

As for unsigned integers, that is a service of the particular driver. The Modbus driver currently supports unsigned 16 bit or signed 32 bit , but not unsigned 32 bit. You would have to read 2 consecutive registers then perform some code to assemble the results into an unsigned 32 bit.

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Reference document for AdvancedHMI
« Reply #2 on: September 15, 2017, 02:45:48 PM »
Can anyone contribute to the WiKi?

I wouldn't mind writing a few dozen pages of info.
Still just trying to figure out this thing called Life.

Ronkpa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Reference document for AdvancedHMI
« Reply #3 on: September 15, 2017, 03:11:49 PM »
@timryder: Thanks. I will definitely read it! And once I know enough I would be happy to contribute as well.
@archie: Would it be possible to use a standard WinForm control, such as a TextBox for creating my own Unsigned Long UInt32 field? Are there any examples of hooking a standard WinForm control like that into the automatic periodic read/write sequence of AdvancedHMI? Or would I be better off fashioning something after the Aqua Gage?
Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Reference document for AdvancedHMI
« Reply #4 on: September 15, 2017, 03:22:28 PM »
Anyone can contribute to the documentation wiki. I am open for suggestions on the format also.

As for standard WinForm controls, all AdvancedHMI controls are based on a WinForm control then inherited into an AdvancedHMI control that gives it the connectivity through the drivers. For example, the BasicLabel inherits from the Label.

Phrog30

  • Guest
Re: Reference document for AdvancedHMI
« Reply #5 on: September 16, 2017, 12:04:43 PM »
On top of creating documentation outside of AHMI, I think it would be a good use of time to create documentation inside of the software.  For example, this is a property from the AnalogValueDisplay:

Code: [Select]
    Private m_ForeColorInLimits As Color = Color.White
    Public Property ForeColorInLimits As Color
        Get
            Return m_ForeColorInLimits
        End Get
        Set(value As Color)
            m_ForeColorInLimits = value
        End Set
    End Property

I think it's very useful to have descriptions for these properties, so in this example it should be something like this:

Code: [Select]
    Private m_ForeColorInLimits As Color = Color.Black
    ''' <summary>
    ''' ForeColor When Value In Limits
    ''' </summary>
    ''' <remarks></remarks>
    <Description("ForeColor When Value In Limits")>
    Public Property ForeColorInLimits As Color
        Get
            Return m_ForeColorInLimits
        End Get
        Set(value As Color)
            m_ForeColorInLimits = value
        End Set
    End Property

I didn't get very descriptive on this example, but it doesn't take very long, maybe a minute, to create this.  Just my two pennies.

James

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Reference document for AdvancedHMI
« Reply #6 on: September 16, 2017, 01:39:43 PM »
I've never come to fully accept the way Microsoft decided to do code comments using the ''' and XML because in my opinion it clutters the code and makes it visually harder distinguish comments from code. Unfortunately it is the standard method that VS uses and most document generators like NDoc use, so better alternatives require VS extensions or do not integrate nicely into VS designer. Because of this I tend to favor code readability at the sacrifice of VS designer showing comments and the use of document generators.

The distinction of comment from comment can be easily resolved by using '''********************** above and below the comment block, but XML is still has a cluttered appearance. Its kind of like reading C# versus VB. One flows nicely and reads easily while the other looks very cryptic.

Here's a typical example that when I look at it I think yes this may help the person in VS using the component or it makes automatically generating a document nice, but it does not do favors to the person reading the code (this is C#, but would be the same in VB by replacing /// with ''')
Code: [Select]
/// <summary>
/// The main <c>Math</c> class.
/// Contains all methods for performing basic math functions.
/// <list type="bullet">
/// <item>
/// <term>Add</term>
/// <description>Addition Operation</description>
/// </item>
/// <item>
/// <term>Subtract</term>
/// <description>Subtraction Operation</description>
/// </item>
/// <item>
/// <term>Multiply</term>
/// <description>Multiplication Operation</description>
/// </item>
/// <item>
/// <term>Divide</term>
/// <description>Division Operation</description>
/// </item>
/// </list>
/// </summary>
/// <remarks>
/// <para>This class can add, subtract, multiply and divide.</para>
/// <para>These operations can be performed on both integers and doubles.</para>
/// </remarks>

Phrog30

  • Guest
Re: Reference document for AdvancedHMI
« Reply #7 on: September 16, 2017, 03:09:22 PM »

...but it does not do favors to the person reading the code (this is C#, but would be the same in VB by replacing /// with ''')


I guess I like it during design time as it gives a description in the properties pane as well as intellisense, I don't consider it useful when looking at it in code.