05-09-2017 08:48 AM
Greetings from Michigan,
Is is possible to create a custom control from a Measurement Studio control, particular a boolean button or switch control? I have an application where I want to use a Measurement Studio switch control that inherits from another third party control. Is this possible?
Thanks,
D
05-09-2017 11:06 AM
When you say "inherit", are you talking about behavior or just visual appearance? For instance, in WPF a control can be given a new visual appearance through a custom control template. Alternatively, with a user control you can use composition to include multiple controls in a single logical instance. However, multiple inheritance for classes is not supported by the .NET framework.
05-09-2017 12:11 PM
Yes, I am talking about behavior. There is another third party control that I have that is also a switch type control. It has a few properties that I need to be able to use, but I want to keep the appearance and everything else of the Measurement Studio switch control. So it appears I won't be able to do that.
05-09-2017 12:19 PM
Depending on the properties involved, it may be possible to get equivalent behavior from the switch control (it is hard to say without knowing more details). But there is no general way to mix-and-match properties/behaviors across multiple controls.
05-09-2017 01:42 PM
I am using "AdvancedHMI" which is free (download from here). It comes with a bunch of its own custom industrial style HMI controls in order to write a .NET program and use as an HMI to talk to AB and other brand PLC's. It's rather good. However, I have another identical machine (other than the brand PLC) that I wrote a .NET UI for a while back, but I used Measurement Studio controls exclusively for that. I wrote all my own communications for communicating back and forth from the UI to the PLC for that machine. It wasn't bad but rather tedious and monotonous. AdvancedHMI makes it easy as you are just required to drop one of their Communications Drivers down on your form, drop a control on the form (Switch in my case), then give it a PLC address in the appropriate field/s in the control's properties pane. But.....in order to make both machine's UI's identical for user ease, I'd like to use the Measurement Studio switch for this UI as well, but I need to be able to write to the PLC addresses (AdvancedHMI's Switch functionality). There is a short example on their website where they make a custom control from another third party control - here. I tried to follow that but wasn't able to make it work. I'm now thinking I won't be able to do it with Measurement Studio controls (?).
Here as screenshot of the Selector Switch from "AdvancedHMI". In their example, all they did was take an AdvancedHMI control, (after they added appropriate references, etc) and change first line of code - "Inherits...."