Advanced HMI

DJShardy

Member
Join Date
May 2018
Location
Melbourne
Posts
13
Hey,

I am doing a project with Advanced HMI. I am trying to do something pretty basic which is to have a coloured circle show up depending on a value inside the PLC. 0-5 RED 6-10 ORANGE 11-15 GREEN.

I can't find a way to do this, all of the included object don't give me what I want.
Is there a way to get a .PNG or something to just turn up when the value is in the range. This is pretty basic so I am sure that I am missing something easy here.

Cheers
 
AdvancedHMI can't do expressions on visibility in properties, so it's easiest to do your logic in the PLC. Then have an object visible on a Boolean result. Or, create a datasubscriber and then do whatever you want in .net code. Possibilities are endless.
 
I have now 3 Bools in the PLC that each represent a result.

Rate_Light[0]
Rate_Light[1]
Rate_Light[2]

I have three Data subscribers (Each point to one of the bits) inside the project they contain the following code.

(Call me the butcher as I've chopped all of this)


I will work out out to fill the circles later on.

I am having problems where the RED circle will not appear even when it is true inside the PLC. The GREEN & AMBER seem to work ok..

Any ideas?

Code:
    Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles RED.DataChanged
        Dim redCircle As Pen
        redCircle = New Pen(Drawing.Color.DarkRed, 5)
        Dim myGraphics As Graphics = Me.CreateGraphics
        Dim myRectangle As New Rectangle

        myRectangle.X = 840
        myRectangle.Y = 175
        myRectangle.Width = 195
        myRectangle.Height = 195

        myGraphics.DrawEllipse(redCircle, myRectangle)
    End Sub

    Private Sub DataSubscriber22_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles AMBER.DataChanged
        Dim amberCircle As Pen
        amberCircle = New Pen(Drawing.Color.DarkOrange, 5)

        Dim myGraphics1 As Graphics = Me.CreateGraphics
        Dim myRectangle1 As New Rectangle

        myRectangle1.X = 840
        myRectangle1.Y = 175
        myRectangle1.Width = 195
        myRectangle1.Height = 195

        myGraphics1.DrawEllipse(amberCircle, myRectangle1)
    End Sub

    Private Sub DataSubscriber23_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles GREEN.DataChanged
        Dim greenCircle As Pen
        greenCircle = New Pen(Drawing.Color.DarkGreen, 5)

        Dim myGraphics2 As Graphics = Me.CreateGraphics
        Dim myRectangle2 As New Rectangle

        myRectangle2.X = 840
        myRectangle2.Y = 175
        myRectangle2.Width = 195
        myRectangle2.Height = 195

        myGraphics2.DrawEllipse(greenCircle, myRectangle2)
    End Sub
 
0-5 RED 6-10 ORANGE 11-15 GREEN.

What I was saying is do the code in the PLC:
0-5 = A PLC Tag "Red"
6-10 = A PLC Tag "Orange"
11-15 = A PLC Tag "Green"
Then those tags will be your visibility in AHMI.

Or, create a datasubscriber for the integer that is 0-15 for colors.

On data change you will use e.values(0), so look at that value and base your code on that. I think you are making it more complicated. Just drop an object on the form and use visibility based on this code.

Hop on over to to the AHMI forum, for examples.
 
Ah Ok I get what you mean now.

If I want a BOOL to turn make the code run and draw a circle, Do I use a data Subscriber for this?

It kinda works.

For example It will show the Green, Then I'll Make amber "true" and it will show amber. But when I make red "True" It just Will Not draw the red circle.

Ill jump over to the AHMI forums too.

Thanks for the help
 
What I was suggesting is if you have 3 separate objects and you want them to be visible based on a PLC value, then do the code in the PLC and put the PLC tag in the visible property. The latest beta has a basic shape control. You should be able to drop this on the form, make it a circle, then you can set the color by the datasubscriber result. You could also just create your own control. AHMI lets you do almost anything you want.
 
Yeah I am only just starting out so currently I am in over my head.

What object could I use that is just a plain old circle. I understand how to use the built in objects like the light stack, Illuminated buttons etc. But I just want a big old circle
 

Similar Topics

I’m new to plc programming and very new to HMIs. So this is what I have done so far: I bought a micrologix 1100, I used bootP to set the up...
Replies
17
Views
1,661
So I installed advanced hmi and grabbed an ethernet cable. I have the click C0-12DRE-1-D PLC. I installed the advanced hmi and added the...
Replies
13
Views
2,038
Do I use the ethernet port on the click plc to connect it to my computer. Will advancedhmi work properly? Am I able to start data logging into a...
Replies
1
Views
936
Having a hard time getting the data received when using BeginReadMultiple. Not the most familiar with the ClxDriver and EthernetIPforCLXCom()...
Replies
8
Views
2,315
I am in search of a non-PC based, non-SCADA based HMI and software that allows the ability to dynamically draw graphical objects on the screen to...
Replies
15
Views
5,029
Back
Top Bottom