AdvancedHMI Software
General Category => Support Questions => Topic started by: Cowboy1 on July 19, 2015, 12:44:23 AM
-
I would like to add a cycle complete indicator on my screen. The only way I can show the cycle is complete is by a level switch that is normally closed and is open when the cycle is complete. I tried a Annunciator1 and can't find a property that will let me configure it backwards.
Is there another way to do this?
I would also like to know if the is a way to click control the water pump like the other objects and have it highlight when it is running?
This really is a great program for somebody to have this out for free, I have purchased all the add-ons except for the latest one and I will be getting that tomorrow. So thanks to the creator or creators of this software excellent job!!!
I have attached a screenshot of the Fill and Strike Cycle of my first HMI it is going to run my home brewery.
The stuff in the lower right corner is some test stuff for a countdown timer to be used on my next screen the Mash Cycle.
I could also use some ideas to make it look better or better functionality?
It will be used outside in daylight so not sure of the best color choice for outdoors?
Any help with these issues would be greatly appreciated.
Thanks,
David
-
You can invert boolean values by preceding the address with "NOT ". For example, you would put an address like this in PLCAddressValue:
NOT B3/0
NOT MyTag
NOT 10001
-
I would also like to know if the is a way to click control the water pump like the other objects and have it highlight when it is running?
You can modify the WaterPump.vb code without too much effort to add the PLCAddressClick functionality. If you look in Motor.vb to use as a model, look for the Property PLCAddressClick and copy those lines of code into WaterPump.vb. Then you will want to look for the Click event handler and copy that routine also. There will be another property of OutputType that also needs copied.
Try that and let me know if you need more help with it and I can go into greater detail later tonight.
-
You can invert boolean values by preceding the address with "NOT ". For example, you would put an address like this in PLCAddressValue:
NOT B3/0
NOT MyTag
NOT 10001
Archie you are great with help, this worked perfectly. Almost complete with screen 1. Thanks for all you help. I have not tried the pump yet but will give it a go shortly.
-
I would also like to know if the is a way to click control the water pump like the other objects and have it highlight when it is running?
You can modify the WaterPump.vb code without too much effort to add the PLCAddressClick functionality. If you look in Motor.vb to use as a model, look for the Property PLCAddressClick and copy those lines of code into WaterPump.vb. Then you will want to look for the Click event handler and copy that routine also. There will be another property of OutputType that also needs copied
Try that and let me know if you need more help with it and I can go into greater detail later tonight.
I copied the code from the motor to the water pump and when I build solution I get 3 errors:
outputType is not declared. It may be inaccessible due to it's protection level. Just so you know I copied the motor code and changed all "Motor" to "WaterPump" and pasted over the original pump code. I kept a copy in word of the original pump code if I need to put it back.
Update: I have done some searching through the code and think there is something that needs to be setup for the water pump inherits for it to have output property? I can't find it though.
Thanks,
David
-
Here are the pieces of code that you need to place in WaterPump.vb
'*****************************************
'* Property - Address in PLC to Link to
'*****************************************
Private m_PLCAddressClick As String = ""
<System.ComponentModel.Category("PLC Properties")> _
Public Property PLCAddressClick() As String
Get
Return m_PLCAddressClick
End Get
Set(ByVal value As String)
If m_PLCAddressClick <> value Then
m_PLCAddressClick = value
End If
End Set
End Property
'****************************
'* Event - Mouse Down
'****************************
Private Sub MomentaryButton_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
If (m_PLCAddressClick IsNot Nothing AndAlso (String.Compare(m_PLCAddressClick, "") <> 0)) And Enabled AndAlso m_CommComponent IsNot Nothing Then
Try
Select Case OutputType
Case MfgControl.AdvancedHMI.Controls.OutputType.MomentarySet : m_CommComponent.Write(m_PLCAddressClick, 1)
Case MfgControl.AdvancedHMI.Controls.OutputType.MomentaryReset : m_CommComponent.Write(m_PLCAddressClick, 0)
Case MfgControl.AdvancedHMI.Controls.OutputType.SetTrue : m_CommComponent.Write(m_PLCAddressClick, 1)
Case MfgControl.AdvancedHMI.Controls.OutputType.SetFalse : m_CommComponent.Write(m_PLCAddressClick, 0)
Case MfgControl.AdvancedHMI.Controls.OutputType.Toggle
Dim CurrentValue As Boolean
CurrentValue = m_CommComponent.Read(m_PLCAddressClick, 1)(0)
If CurrentValue Then
m_CommComponent.Write(m_PLCAddressClick, 0)
Else
m_CommComponent.Write(m_PLCAddressClick, 1)
End If
Case Else
End Select
If tmrError.Enabled Then
tmrError.Enabled = False
End If
Catch ex As Exception
DisplayError("WRITE FAILED!" & ex.Message)
End Try
End If
Me.Invalidate()
End Sub
'****************************
'* Event - Mouse Up
'****************************
Private Sub MomentaryButton_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
If (m_PLCAddressClick IsNot Nothing AndAlso (String.Compare(m_PLCAddressClick, "") <> 0)) And Enabled AndAlso m_CommComponent IsNot Nothing Then
Try
Select Case OutputType
Case MfgControl.AdvancedHMI.Controls.OutputType.MomentarySet : m_CommComponent.Write(m_PLCAddressClick, 0)
Case MfgControl.AdvancedHMI.Controls.OutputType.MomentaryReset : m_CommComponent.Write(m_PLCAddressClick, 1)
End Select
Catch ex As Exception
DisplayError("WRITE FAILED!" & ex.Message)
End Try
End If
Me.Invalidate()
End Sub
Private m_OutputType As MfgControl.AdvancedHMI.Controls.OutputType = MfgControl.AdvancedHMI.Controls.OutputType.MomentarySet
Public Property OutputType() As MfgControl.AdvancedHMI.Controls.OutputType
Get
Return m_OutputType
End Get
Set(ByVal value As MfgControl.AdvancedHMI.Controls.OutputType)
m_OutputType = value
End Set
End Property