Author Topic: Adding extra properties to controls  (Read 12099 times)

Phrog30

  • Guest
Re: Adding extra properties to controls
« Reply #15 on: April 05, 2019, 01:18:32 PM »
I just added two new analog display value controls to a form.  I changed the cursor to hand, didn't add any PLC property values, and changed enabled to false on one, but left the other true.  Then run the app, you can slightly see the text a different color, but you will also see the one enabled is still hand cursor, the one not enabled is not hand.  The controls take care of this automatically, so that tells me the enabled is working as it should.  On my controls, anything that allows an operator input I change the cursor to hand.  This is a good sign to them.  I also draw a box around the control on mouse enter, kind of works like wonderware.  This was something I added. 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Adding extra properties to controls
« Reply #16 on: April 05, 2019, 01:20:10 PM »
On the side, is there a way to make a "basicbutton" change "backcolor" when pressed and back to original color when not pressed? Also is there a way to make a "basicbutton" write the value to the plc even if the user is still holding the button? Right now the "basicbutton" needs to see a rising edge and a falling edge before firing the write event... That's not necessarily helpful.
Are you wanting the button to repeatedly keep writing the same value as long as the button is held?

yes
Can you explain the reasoning? Is your PLC program overwriting what is written by the HMI?

Phrog30

  • Guest
Re: Adding extra properties to controls
« Reply #17 on: April 05, 2019, 01:23:39 PM »
I just added two new analog display value controls to a form.  I changed the cursor to hand, didn't add any PLC property values, and changed enabled to false on one, but left the other true.  Then run the app, you can slightly see the text a different color, but you will also see the one enabled is still hand cursor, the one not enabled is not hand.  The controls take care of this automatically, so that tells me the enabled is working as it should.  On my controls, anything that allows an operator input I change the cursor to hand.  This is a good sign to them.  I also draw a box around the control on mouse enter, kind of works like wonderware.  This was something I added. 


Oh, did the same on the pilot light as well, it worked the same, so it's working.  It's simply the differences aren't that noticeable.  So, you will need to use other means to make it more noticeable, some of which I already shared.

Phrog30

  • Guest
Re: Adding extra properties to controls
« Reply #18 on: April 05, 2019, 01:26:56 PM »
Can you explain the reasoning? Is your PLC program overwriting what is written by the HMI?

If this is true, I can say that every SCADA/HMI software would work no differently.  If the PLC/HMI are "fighting" each other it's not going to work.  I use momentary all of the time, usually when doing a jog.  The functionality also depends on touchscreen, some touchscreen drivers don't allow you to hold/jog, use a mouse to test with if this is the case.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Adding extra properties to controls
« Reply #19 on: April 05, 2019, 01:54:55 PM »
I just added two new analog display value controls to a form.  I changed the cursor to hand, didn't add any PLC property values, and changed enabled to false on one, but left the other true.  Then run the app, you can slightly see the text a different color, but you will also see the one enabled is still hand cursor, the one not enabled is not hand.  The controls take care of this automatically, so that tells me the enabled is working as it should.  On my controls, anything that allows an operator input I change the cursor to hand.  This is a good sign to them.  I also draw a box around the control on mouse enter, kind of works like wonderware.  This was something I added.

Cursors wont works because I have touch screen so no mouse hovering hence I cant switch the cursor

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Adding extra properties to controls
« Reply #20 on: April 05, 2019, 02:03:13 PM »
On the side, is there a way to make a "basicbutton" change "backcolor" when pressed and back to original color when not pressed? Also is there a way to make a "basicbutton" write the value to the plc even if the user is still holding the button? Right now the "basicbutton" needs to see a rising edge and a falling edge before firing the write event... That's not necessarily helpful.
Are you wanting the button to repeatedly keep writing the same value as long as the button is held?

yes
Can you explain the reasoning? Is your PLC program overwriting what is written by the HMI?

No my PLC is not overwriting; it cannot simply because you cannot map a bit to a bit being mapped already on the PLC. They would fight and the PLC will win any time in the day. The reason I want to have that is because this is what operators are used to on all other platforms; they are used to holding the button for whatever time and let go.

A good example is that if someone wants to manually jog a motor to a certain position while watching the motor run. This will not work since holding the button and then letting go the second they desire the motor stopped is not how the basicbutton reacts to the user input. I think this is an inheritance from system.button as it appears that both work the same way

Phrog30

  • Guest
Re: Adding extra properties to controls
« Reply #21 on: April 05, 2019, 02:11:50 PM »
You mentioned you are using a touchscreen, I'm guessing that's your problem.  As I said earlier, plug in a mouse and test.  If it works, then you need to find a different touchscreen driver.

Also, I dropped two textboxes and changed background to red, one enabled and one not.  You can't tell the difference on which is one enabled just by looking at them.  One option is to change the background color if not enabled, then it will be noticeable.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Adding extra properties to controls
« Reply #22 on: April 05, 2019, 02:17:35 PM »
No my PLC is not overwriting; it cannot simply because you cannot map a bit to a bit being mapped already on the PLC. They would fight and the PLC will win any time in the day. The reason I want to have that is because this is what operators are used to on all other platforms; they are used to holding the button for whatever time and let go.

A good example is that if someone wants to manually jog a motor to a certain position while watching the motor run. This will not work since holding the button and then letting go the second they desire the motor stopped is not how the basicbutton reacts to the user input. I think this is an inheritance from system.button as it appears that both work the same way
I agree with Phrog on this. I think it is your touch screen. I do jog buttons all the time. When the button is pressed it sets the bit to True/1, when it is released it sets the value to False/0. Are you using Windows 10 with the default touch screen driver? if so, it functions as gestures and doesn't click on down the same as a mouse would.

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Adding extra properties to controls
« Reply #23 on: April 05, 2019, 03:11:34 PM »
I will look into that but I have a feeling it is not the issue because I had the gestures disabled a long time ago.
I am using windows 7 std emb. and on this version holding the button down to jog a motor usually initiates a right click button event..

When I had this issue I went ahead and disabled all the gestures and then I came across the button not holding bit 1 or 0 and the enabled/disabled status issue.

I understand phrog that the controls are working how they are supposed to be but it is not the way they should look like.

The perfect way to disable a control is the way basicbutton works where the difference between enabled and disabled is pretty clear to the user and not just a slight modification to the text etc etc.

Almost every control/component on the microsoft.system gets greyed out when disabled.

You gotta think that this product is mostly going to be used on touchscreen like the rest of the industry not on a mouse and keyboard.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Adding extra properties to controls
« Reply #24 on: April 05, 2019, 03:18:49 PM »
I will look into that but I have a feeling it is not the issue because I had the gestures disabled a long time ago.
I am using windows 7 std emb. and on this version holding the button down to jog a motor usually initiates a right click button event..
You need to disable the right click on hold.

Phrog30

  • Guest
Re: Adding extra properties to controls
« Reply #25 on: April 05, 2019, 03:44:54 PM »
Almost every control/component on the microsoft.system gets greyed out when disabled.
It depends on the backcolor!
See photo.

Edit, those are "standard" winforms controls!

abouhaa

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Adding extra properties to controls
« Reply #26 on: April 08, 2019, 08:04:41 AM »
Almost every control/component on the microsoft.system gets greyed out when disabled.
It depends on the backcolor!
See photo.

Edit, those are "standard" winforms controls!

True, the back color makes a difference; however I should at least be able to have 1 color that will give me the same visual effect of the basicbutton. No?

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Adding extra properties to controls
« Reply #27 on: May 25, 2019, 02:39:51 PM »
Maybe check the attached picture and also this link:

http://www.vbforums.com/showthread.php?803457-RESOLVED-Button-doesn-t-gray-out-when-disabled

All buttons in the picture have the BackColor set to Control and both AnalogValueDisplay controls have it set to ControlDarkDark.
Top row controls are enabled and bottom row are disabled.
« Last Edit: May 25, 2019, 02:41:56 PM by Godra »