ActiveX made by considering easily adding to the program and the easily meeting other probable needs. For this purpose some features that are not contained other ActiveXs like save project, fetch record added to ActiveX. Thus you can finish all operations about MPI communication in a couple minutes.
Full Licence 1000 Usd.
Component Properties and their usage:
Public AutoStart_ As Boolean:
When this property True, component will continuously try to connect if PLC is off or there is another communication problem. Connection will be established when PLC ready. False disables this property .
Following line makes Auto Start property True:
MpiServer1.AutoStart_ = True
Following line assigns Auto Start property value to “i” variable:
i = MpiServer1.AutoStart_
Property Value_(ByVal TagId As UInt32) As String:
Sets or gets the value. TagId is the row number in the Tag list.
Example: Following line assigns the 100 to Tag which locates at row 1:
MpiServer1.Value_(1) = 100
Following line assigns the value of Tag which locates in the row 1 to variable i.
i = MpiServer1.Value_(1)
Public FileName_ As String:
Returns the file name which contains active settings.
Example: Following line displays the active settings file name.
MsgBox(MpiServer1.FileName_)
Property LoadSettings_() As String:
Loads previously saved setting file to the component. Return value of this property is file path.
Example: Following line loads the settings from the file which indicated by “path” variable.
MpiServer1.LoadSettings_ = path
Public Sub SaveSettings_(ByVal value As String):
Saves the current connection settings to given path which contains filename.
Example: Following line saves the settings to the file which given in “path” variable.
MpiServer1.SaveSettings_(path)
Property Connect_() As Boolean:
Sets or gets the connection status of component. Component connects to the PLC when this property becomes True. False, disconnects the component. This property returns True while component trying to connect. Real connection state is given by Connection property.
Example: Connection can be activated by following line:
MpiServer1.Connect_ = True
Disconnects with following line:
MpiServer1.Connect_ = False
Public Connection_ As Boolean:
Connection state can be get from this property. Returns True after the connection established.
Following line assings Connection State to “str” variable.
str= MpiServer1.Connection_
Property PcMpiAdress_() As UInt16:
Gets or sets the component’s MPI Network address.
Following line assings component’s MPI Network Address value to “str” variable.
str = MpiServer1.PcMpiAdress_
Following line sets component’s MPI Network Address property of the component.
MpiServer1.PcMpiAdress_ = str
Property PcBaudrate_() As UInt32:
Gets or sets the component’s PC Baudrate.
Following line assings PC Baudrate value to “str” variable.
str = MpiServer1.PcBaudrate_
Following line sets PC Baudrate property of the component.
MpiServer1.PcBaudrate_ = str
Property ComPort_() As String:
Gets or sets the Com port that used by the component.
Following line assings PC Com port value to “str” variable.
str = MpiServer1.ComPort_
Following line sets Com port property of the component.
MpiServer1.ComPort_ = str
Property PollInterval_() As UInt16:
Gets or sets the Poll Interval property of the component.
Following line assings Poll Interval value to “i” variable.
i = MpiServer1.PollTime_
Following line sets Poll time property of the component.
MpiServer1.PollTime_ = i
Property PlcBaudrate_() As UInt32:
Gets or sets the component’s PLC Baudrate. (19200 or 187500)
Following line assings PLC Baudrate value to “str” variable.
str = MpiServer1.PlcBaudrate_
Following line sets PLC Baudrate property of the component.
MpiServer1.PlcBaudrate_ = str
Property StationAdress_(ByVal StationName As String) As UInt16:
Gets or sets the PLC MPI Address.
Following line sets the component’s connected address number.
MpiServer1.StationAdress_ = i
Following line Assigns component’s connected address to i variable.
i = MpiServer1.StationAdress_
Function TagList_():
Returns whole tag list as an array.
Following line assigns Tag List to array named “TagArray”.
TagArray = MpiServer1.TagList_
Function TagListErr_():
Returns False if erroneous value in Tag list. Returns True if no erroneous value.
Following code notifies user about the Erroneous Value.
If MpiServer1.TagListErr_ = False Then
MsgBox(“Tag table found error!”)
Exit Sub
End If
Public Sub NotAvailableTagName(ByVal TagName As Array):
(For COM Component: Public Sub NotAvailableTagName(ByVal TagName As String)):
Imports existing Tag List to component If your application project contains more than one Mpi Component or there are another Tags in the project. Checks tag names for being unique with the component’s and given tags.
The parameter that passed to this method is varies according to being component NET or COM.
For NET Component, tags should given in array type.
For COM component, tagnames should be passed as a string type and separated by chr(20) character.(Tagname as string =”Tag_1 & chr(20) & Tag_2″)
Property GroupCycle_(ByVal GroupName As String) As UInt16:
Sets or gets cycle value of given group.
Following line sets the Cycle value of the group which indicated by “gr_name” variable.
MpiServer1.GroupCycle_(gr_name) = i
Following line assigns Cycle value of the group which indicated by “gr_name” to i.
i = MpiServer1.GroupCycle_(gr_name)
Property FileMenu_() As Boolean:
Sets or gets the visibility of the File menü buttons.
Following line sets the visibility of the File Menü to false.
MpiServer1.FileMenu_ = False
Property ConnectButton_() As Boolean:
Sets or gets the visibility of the Connect – Disconnect buttons.
Following line sets the visibility of the Connect – Disconnect buttons to false.
MpiServer1.ConnectButton_ = False
Property ToolStrip_() As Boolean:
Sets or gets the visibility of the ToolStrip.
Following line sets the visibility of the ToolStrip to false.
MpiServer1.ToolStrip_ = False
Property StatusStrip_() As Boolean:
Sets or gets the visibility of the StatusStrip.
Following line sets the visibility of the StatusStrip to false.
MpiServer1.StatusStrip_ = False
Property TreeviewMenu_() As Boolean:
Enables or disables right click menu of the Network TreeView.
Following line disables right click menu of the Network TreeView.
MpiServer1.TreeviewMenu_ = False
Property DataGridMenu_() As Boolean:
Enables or disables right click menu of the Tag List.
Following line disables right click menu of the Tag List.
MpiServer1.DataGridMenu_ = False
Component Events:
COM Component
|
.NET Component
|
Explanation
|
Event MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
|
Event MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
|
The event that triggerred when mouse button get down on the component.
|
Event MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
|
Event MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
|
The event that triggerred when mouse moved on the component.
|
Event MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
|
Event MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs):
|
The event that triggerred when mouse button up on the component.
|
Event KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
Event KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs):
|
The event that triggerred when keyboard key down on the component.
|
Event Connectedcom(ByVal sender As Object, ByVal Status As Boolean)
|
Event Connected_(ByVal sender As Object, ByVal Status As Boolean)
|
The event that triggerred when component connected.
|
Event ReadValuecom(ByVal sender As Object, ByVal TagId As UInt32, ByVal Value As String)
|
Event ReadValue_(ByVal sender As Object, ByVal TagId As UInt32, ByVal Value As String)
|
The event that triggerred when value different than previously value which read from the PLC. This event sends Tag value with tag’s row index(Tag_Id) to application. All tag values is sent once to main application when communication started.
|
Event ReadErrcom(ByVal sender As Object, ByVal TagId As UInt32)
|
Event ReadErr_(ByVal sender As Object, ByVal TagId As UInt32)
|
The error which occurs while reading from PLC are sent to main application with tag’s row index(TagId).
|
Event SetErrcom(ByVal sender As Object, ByVal TagId As UInt32)
|
Event SetErr_(ByVal sender As Object, ByVal TagId As UInt32)
|
The error which occurs while writing to PLC, it passed to the main application with tag’s row index(TagId).
|
Event TimeOutcom(ByVal sender As Object, ByVal StationName As String)
|
Event TimeOut_(ByVal sender As Object, ByVal StationName As String)
|
Sends the component’s connection timeout status to main application when PLC connection unsuccessful.
|
Event GenericErrcom(ByVal sender As Object, ByVal Message As String)
|
Event GenericErr_(ByVal sender As Object, ByVal Message As String)
|
The other errors is informed to main application with this event. This contains error message as well.
|