AdvancedHMI Software
General Category => Additional Components => Topic started by: Godra on March 29, 2016, 07:33:08 PM
-
This is my attempt at converting NumericUpDown control to AHMI control.
It is using PLCAddressValue property to both read from and write to (tried it with ModRSSim simulator and it worked fine).
Its ReadOnly property is initially set to True, so it will only allow changing value with arrows (change it if you want to manually enter the value in the box).
First file is for older versions of AHMI and the second one is for v3.99d.
Check later posts for updated controls.
-
Hi Godra,
Nice component, excellent alternative to the keypad. Would it be possible to make it resizable? When running AHMI on a tablet it's a bit tricky to hit the right spot especially with my sausage fingers :)
-
If you increase the font size that will automatically increase the height of the NumericUpDown control and buttons on it.
I am not sure if there is any other way to change this control.
One thing to suggest would be using a stylus to compensate for the "sausage" fingers.
Stylus is a rather useful tool for touch screens and has become rather inexpensive.
-
This control has been updated to better handle fast poll rates.
The ReadOnly property is now set to its default value.
PLCAddressValue property was removed and a new PLCAddressReadWrite property is included to handle the address.
The following issue seems to be resolved now (at least with ethernet drivers):
The control will respond slow if the up/down arrow buttons are clicked repeatedly too fast or if they are held pressed.
In this case, using the box to manually enter the desired new value should be a better choice (or possibly change the Increment property value to handle bigger changes).
-
This component does have a bug that if you read the PLC value into the component and it's less than or greater than it's min/max it will throw an exception.
This should prevent that:
Private m_readWrite As Decimal
<System.ComponentModel.Browsable(False)> _
Public Property ReadWrite As Decimal
Get
Return Me.m_readWrite
End Get
Set(value As Decimal)
If Me.m_readWrite <> value Then
Me.m_readWrite = value
If Me.m_readWrite >= Minimum AndAlso Me.m_readWrite <= Maximum Then
MyBase.Value = Me.m_readWrite
End If
Me.Invalidate()
End If
End Set
End Property
-
The control in my previous post was updated and replaced.
It includes a bug fix mentioned by Phrog30 and it also seems to have resolved the issue of responding slow if the up/down arrow buttons were clicked repeatedly too fast or if they were held pressed.
-
This control was modified and updated, with this new version attached in this post.
A new property was added, AllowWriteOnly, which is set to True as default.
If you want the control to as well read the current PLC address then change this value.