AdvancedHMI Software

General Category => Support Questions => Topic started by: boldive on October 18, 2018, 03:14:27 PM

Title: Momentary pushbutton
Post by: boldive on October 18, 2018, 03:14:27 PM
Hello,

In my application I use momentary push buttons to control object movement on ControlLogix L30-ERMS.
When I press and hold button (holding with mouse click) on the development computer (where Visual Studio is installed) everything works fine. PLC bit is ON and object moves.
When I copy application on the Windows tablet (Teclast X80 Plus) nothing happen when I press button on the touchscreen. All basic indicators works fine on both PC and tablet. Which means communication driver works and able to talk to PLC.

Button properties have:
MaximumHoldTine: 30000
MinimumHoldTime: 500 
OutputType: MomentarySet

Also, I would like to highlight puschbutton using propertie PLCAddressHighlightX. PLC bit in this field does nothing. Button doesn't change color.

Any ideas what can be wrong?

Thanks.
Title: Re: Momentary pushbutton
Post by: Archie on October 18, 2018, 03:20:10 PM
Is your tablet using Windows 10 with the default Windows touch screen driver? If so, buttons click on release because of gesture handling.
Title: Re: Momentary pushbutton
Post by: boldive on October 18, 2018, 03:40:56 PM
Tablet uses Windows 10 Home v.1511.

I am sorry, which output type I need to choose? Or it something else?

Thanks
Title: Re: Momentary pushbutton
Post by: Archie on October 18, 2018, 04:04:21 PM
You will either need to find a setting to make your touch screen enable mouse emulation or turn off gesturing. The other option is to find the manufacturer's touch screen driver
Title: Re: Momentary pushbutton
Post by: boldive on October 18, 2018, 04:12:44 PM
Thank you Archie, I will work on it and update with result.

Any ideas about:
" I would like to highlight puschbutton using propertie PLCAddressHighlightX. PLC bit in this field does nothing. Button doesn't change color."

Thanks
Title: Re: Momentary pushbutton
Post by: Archie on October 18, 2018, 04:43:35 PM
Any ideas about:
" I would like to highlight puschbutton using propertie PLCAddressHighlightX. PLC bit in this field does nothing. Button doesn't change color."
What is your OutputType set to?
Title: Re: Momentary pushbutton
Post by: boldive on October 18, 2018, 04:51:26 PM
In Windows 10 under: Control Panel => Hardware and Sound => Pen and Touch : Touch Action - Right-Click
Highlight "Press and hold" => click on Settings and on new window deselect "Enable press and hold for right-clicking".

So, when I press a button on the tablet Windows emulates Mouse Right Click. It is very useful inside windows but useless inside HMI Application.

Is it any chance to disable this option "Enable press and hold for right-clicking" inside AdvancedHMI and enable it before "Exit"?
Title: Re: Momentary pushbutton
Post by: boldive on October 18, 2018, 04:52:38 PM
What is your OutputType set to?

OutputType: MomentarySet
Title: Re: Momentary pushbutton
Post by: Archie on October 18, 2018, 05:11:47 PM
In Design Mode in Visual Studio, if you select the button and set the Highlight property to True, what happens?
Title: Re: Momentary pushbutton
Post by: boldive on October 18, 2018, 05:50:24 PM
Nothing happens. Regardless of Highlight True or False button doesn't change color.
Title: Re: Momentary pushbutton
Post by: boldive on October 18, 2018, 05:54:35 PM
Sorry,

You mean Highlight option has to be True to activate PLCAddressHighlightX .
I will check it when come online with PLC.

Thank you Archie for help!
Title: Re: Momentary pushbutton
Post by: Archie on October 18, 2018, 06:50:52 PM
You mean Highlight option has to be True to activate PLCAddressHighlightX .
No. I wanted you to check to see that it can change to HighlightColor in design mode.

What is the HighlightColor property set to? What is BackColor set to? What version of AdvancedHMI are you using?
Title: Re: Momentary pushbutton
Post by: Godra on October 18, 2018, 10:09:20 PM
boldive,

if you are using the BasicButton control then you might try using its modified version posted here:

https://www.advancedhmi.com/forum/index.php?topic=1916.msg10739#msg10739
Title: Re: Momentary pushbutton
Post by: boldive on October 22, 2018, 08:15:20 PM
No. I wanted you to check to see that it can change to HighlightColor in design mode.

What is the HighlightColor property set to? What is BackColor set to? What version of AdvancedHMI are you using?

In design mode false/true in Highlight doesn't change anything. Screenshot is attached. BackColor is set to Black.
AdvancedHMI v.399x
Title: Re: Momentary pushbutton
Post by: boldive on October 22, 2018, 08:42:57 PM
if you are using the BasicButton control then you might try using its modified version posted here:

https://www.advancedhmi.com/forum/index.php?topic=1916.msg10739#msg10739

Thanks for advise. I am a beginner in Visual Studio. How I can integrate BasicButton.vb into Toolbox?

When I go to Main Menu Tools => Choose Toolbox Items... System.Activities Components tab is not available to add control into toolbox.
Title: Re: Momentary pushbutton
Post by: Archie on October 22, 2018, 08:59:06 PM
I'm not able to replicate this with the same settings you have. Is your button on a Panel or GroupBox?


If the BasicButton is not in your Toolbox, how did you add it to the form?
Title: Re: Momentary pushbutton
Post by: boldive on October 23, 2018, 09:03:51 AM
The button is on the panel.

BasicButton was taken from Toolbox which is part of initial AdvancedHMI project.

I was asking Godra how to add his version of BasicButton into Toolbox.
Title: Re: Momentary pushbutton
Post by: Archie on October 23, 2018, 09:23:07 AM
This is what I get with the same properties of BackColor=Black and HighlightColor=ButtonHighLight
Title: Re: Momentary pushbutton
Post by: boldive on October 23, 2018, 09:41:32 AM
This is weird. I did what you did. Add another BasicButton on the form and on the panel on the form. In both scenarios Highlight True/False works just fine. However, the BasicButtons which I had before don't behave this way.

It looks like I need to delete them and add again. Will update soon.

Thanks for your help!
Title: Re: Momentary pushbutton
Post by: Phrog30 on October 23, 2018, 10:28:32 AM
Why don't you zip up your application and share it via Dropbox, Google drive, etc. Then we can really see what's going on.
Title: Re: Momentary pushbutton
Post by: boldive on October 23, 2018, 10:50:45 AM
Why don't you zip up your application and share it via Dropbox, Google drive, etc. Then we can really see what's going on.

https://drive.google.com/file/d/1Lvc6AFRfUDylrmLlIJ5jM7S8wmxkaX9S/view?usp=sharing
Title: Re: Momentary pushbutton
Post by: Phrog30 on October 23, 2018, 12:23:18 PM
Change FlatStyle to standard.
Title: Re: Momentary pushbutton
Post by: Phrog30 on October 23, 2018, 12:28:33 PM
You have errors, to fix add AdvancedHMIControls in the spots that show error:
Code: [Select]
Private SubScriptions As AdvancedHMIControls.SubscriptionHandler
Title: Re: Momentary pushbutton
Post by: boldive on October 23, 2018, 12:32:43 PM
Thanks a lot!  It works now.
Title: Re: Momentary pushbutton
Post by: Phrog30 on October 23, 2018, 03:45:19 PM
Great, by the way, before you send an application strip the bin and obj folders from the four main folders in AHMI.  This will make the size substantially smaller.  The only time you wouldn't want to do this is if the recipient needs it compiled.  Must of us already have studio installed, so we can just rebuild.

Your app looks good so far.  The only thing I would recommend is to try and eliminate the blinking when changing forms. 
Title: Re: Momentary pushbutton
Post by: boldive on October 24, 2018, 09:43:51 AM
Thanks for feedback.

After changing  FlatStyle to standard I got errors after build.

All referenced to SubscriptionHandlerEventArg is not defined.
As you have recommended before I add
Code: [Select]
Private SubScriptions As AdvancedHMIControls.SubscriptionHandler
In Solution Explorer under AdvancedHMIControls I see SubscriptionHandlerEventArg.vb
Should I declare it somewhere?


https://drive.google.com/file/d/1_NZsbUr3s6Tz9MHpMkSOzDW8nBasf5FS/view?usp=sharing

Thanks
Title: Re: Momentary pushbutton
Post by: Phrog30 on October 24, 2018, 04:11:37 PM
Looks like you need to add "AdvancedHMIControls" on line 559, 566, & 607.  The software will tell you what has an error, you just have to read it and do what it says.
Title: Re: Momentary pushbutton
Post by: boldive on October 25, 2018, 03:06:18 PM
Looks like you need to add "AdvancedHMIControls" on line 559, 566, & 607.

Thank you Phrog30. One of the software suggestions was to add line

Code: [Select]
Implements SubscribtionHandler
at the beginning of class code. Errors are gone.

Today I was online with PLC and see big flickering of indicators connected to Micrologix1400 PLC. On the forms I have 2 com drivers: one for ControlLogix and one for SLC/Micrologix.
Indicators associated with ControlLogix have no problem at all. However, indicators linked to Micrologix have big flickering and randomly changes indicator colors even if PLC bit doesn't change.

Any ideas what it can be?

Thanks
Title: Re: Momentary pushbutton
Post by: Archie on October 25, 2018, 05:11:52 PM
Today I was online with PLC and see big flickering of indicators connected to Micrologix1400 PLC. On the forms I have 2 com drivers: one for ControlLogix and one for SLC/Micrologix.
Indicators associated with ControlLogix have no problem at all. However, indicators linked to Micrologix have big flickering and randomly changes indicator colors even if PLC bit doesn't change.

Any ideas what it can be?

Thanks
Are you using I:x/x or O:x/x addresses? There is a known issue with physical IO addresses that may cause the problem you are seeing.
Title: Re: Momentary pushbutton
Post by: boldive on October 25, 2018, 08:16:52 PM
Yes, most of them are I:x/x and O:x/x.

So, I need to map them on B3 bits and use B3 in AHMI?

Thanks.
Title: Re: Momentary pushbutton
Post by: Archie on October 25, 2018, 08:24:26 PM
Yes, most of them are I:x/x and O:x/x.

So, I need to map them on B3 bits and use B3 in AHMI?
Yes. Until a future version that fixes this issue, this is the only way to use physical IO addresses.
Title: Re: Momentary pushbutton
Post by: Phrog30 on October 25, 2018, 09:05:57 PM
Mapping should be considered best practice. Spend time as a systems integrator and you will see the benefit in a hurry. It only takes a few short seconds.
Title: Re: Momentary pushbutton
Post by: Godra on October 31, 2018, 10:43:03 PM
The button is on the panel.

BasicButton was taken from Toolbox which is part of initial AdvancedHMI project.

I was asking Godra how to add his version of BasicButton into Toolbox.

Maybe spend some time reading all the topics from the "Additional Components" category.
At least one of them will list the steps required to add a control to the project.
The same/similar steps could be found in other topics throughout the forum.
It would be an exercise that can only help you learn a bit more about using VB and Visual Studio.