How to implement plugin in vb.net class
I know this is probably a frequently asked question, but I've been spending all day trying to find a solution to this problem. Now, I am working on a project in which VB is partially used. And in a program that has been made by someone else, there is a VB class that I want to develop little a bit by implementing a plugin in it to support dynamically extendable application core.
My question is how to replace "M1065" and "M1064" by using the plugin that I created earlier?
This is the vb class.
Friend Function GetWinderTrouble(ByVal lr As String) As Integer
'Left-side
If lr = Constant.YARN_WINDER_L Then
Return Me.GetDeviceValue("M1065")
'Right-side
Else
Return Me.GetDeviceValue("M1064")
End If
End Function
And this is the Plugin that I already created earlier.
Imports IPLCComm
Public Class PlugIn
Implements IPLCComm.IPlugIn
Friend Const YARN_WINDER_L As String = "L"
Friend Const GET_WINDERTROUBLE_L As String = "M1065"
Friend Const GET_WINDERTROUBLE_R As String = "M1064"
Public Function GetWinderTrouble(lr As String) As Integer Implements IPlugIn.GetWinderTrouble
If lr = YARN_WINDER_L Then
'Left side
Return Me.GetDeviceValue(GET_WINDERTROUBLE_L)
Else
'Right side
Return Me.GetDeviceValue(GET_WINDERTROUBLE_R)
End If
End Function
End Class
Please help, thank you in advance.