Profinet

Many automation project requires Profinet communication. You can use Profinet ActiveX as a communication interface with it’s flexible structure in your projects.   License owners can use this ActiveX without any limitation. For who will purchase License a change can be made at free or paid ActiveX code. .NET Framework 3.5 is used at Profinet ActiveX.

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 Profinet communication in a couple minutes.

 

 

Full Licence 250 Usd. Buy now!

 
Download link will be only displayed to registered users.
Login Register today!

 

 

 

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:

Profinet1.AutoStart_ = True

Following line assigns Auto Start property value to “i” variable:

i = Profinet1.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:

Profinet1.Value_(1) = 100

Following line assigns the value of Tag which locates in the row 1 to variable i.

i = Profinet1.Value_(1)

 

Public FileName_ As String:

Returns the file name which contains active settings.

Example: Following line displays the active settings file name.

MsgBox(Profinet1.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.

Profinet1.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.

Profinet1.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:

Profinet1.Connect_ = True

Disconnects with following line:

Profinet1.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= Profinet1.Connection_

 

Property PlcName_() As String:

Gets or sets the name of the PLC which will be connected.

Following line assings component’s PlcName property value to “str” variable.

str = Profinet1.PlcName_

Following line sets component’s PlcName property.

Profinet1.PlcName_ = str

 

Property PlcIpAddress__()As String:

Gets or sets the address of the PLC which will be connected.

Following line assings component’s PlcIpAddress property value to “str” variable.

str = Profinet1.PlcIpAddress__

Following line sets component’s PlcIpAddress property.

Profinet1.PlcIpAddress__ = str

 

Property PlcPortAddress__()  As UInt16:

Gets or sets the port of the PLC which will be connected.

Following line assings component’s PlcPortAddress property value to “i” variable.

i = Profinet1.PlcPortAddress__

Following line sets component’s PlcPortAddress property.

Profinet1.PlcPortAddress__ = i

 

Property PollInterval_() As UInt16:

Gets or sets the Poll Interval property of the component.

Following line assings Poll Interval value to “i” variable..

i = Profinet1.PollTime_

Following line sets Poll Interval property of the component.

Profinet1.PollTime_ = i

 

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 Profinet 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″)

 

Function TagList_():

Returns whole tag list as an array.

Following line assigns Tag List to array named “TagArray”.

TagArray = Profinet1.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 Profinet1.TagListErr_ = False Then

            MsgBox(“Tag table found error!”)

       Exit Sub

End If

 

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.

Profinet1.GroupCycle_(gr_name) = i

Following line assigns Cycle value of the group which indicated by “gr_name” to i.

i = Profinet1.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.

Profinet1.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.

Profinet1.ConnectButton_ = False

 

Property ToolStrip_() As Boolean:

Sets or gets the visibility of the ToolStrip.

Following line sets the visibility of the ToolStrip to false.

Profinet1.ToolStrip_ = False

 

Property StatusStrip_() As Boolean:

Sets or gets the visibility of the StatusStrip.

Following line sets the visibility of the StatusStrip to false.

Profinet1.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.

Profinet1.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.

Profinet1.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.

 

Translate »