Skip to content

HMI outputs

Hello,

I have created a C# program which I transferred to PLCnext Engineer so I have the following GDS Port List.


What I would like to do is create an HMI Page which shows when the outputSwitch_Pipes are TRUE and when they are FALSE. Also I would like to extend this to add some C# counters I use in my C# code so that I can view their values. I guess in order to do that I have to declare them as [Output] in my C# project and then reload it so that they appear in the previous screen.

My problem is for some reason I cannot click the "HMI" box in the screenshot I provided above. Therefore I cannot connect my C# variables to HMI tags.

Any thoughts?

Comments

  • You need to mark the variables in the C# program with the Ehmi attribute. Then the HMI box will be ticked in PLCnext Engineer for that variable.

    A list of all the attributes is shown here:

    ... and there is a code example linked on that page, showing how to use the attributes.

    For example, here is the top part of a C# Program:

    The port variable marked with the Ehmi attribute has the HMI box ticked in PLCnext Engineer:


  • Once again, thank you for your great detailed answer, this helps a lot.

  • There actually appears to be an error when I try to replicate that.

    I figured that if I use "using Eclr.Pcos;" then I can have "HMI" in the attributes field, even if I use "HMI" the port variable marked with the Ehmi attribute has the HMI box NOT ticked in PLCnext Engineer.

    Am I missing anything?

  • The HMI attribute is not the correct one, I think that's an old attribute that doesn't work.

    This is what I see when I hover over the Ehmi attribute in a C# project created from the standard template:

    Are you using version 2022.6 of the Toolchain and VS extension?

  • You were right once again. I had the 2022.0 of the toolchain installed. After I changed it I can see that the hmi tag box is indeed ticked now. However, when I try to select my variables when setting up the HMI Page I cannot find them in any menu.



  • I have just heard from the developers that this Ehmi tag does not work properly yet. Even though the "HMI" box is checked in PLCnext Engineer, the variable is not available in the HMI - as you have discovered.

    This should be listed as a "known issue" in the PLCnext Engineer release notes.

    For the moment the work-around is to connect the GDS port from the C# program to a global variable in PLCnext Engineer, and check the HMI box on the global variable.

Sign In or Register to comment.