Mitsubishi Electric FX3U-ENET-ADP User Manual page 147

Table of Contents

Advertisement

FX
-ENET-ADP User's Manual
3U
'lstOutput
'
Me.lstOutput.ItemHeight = 12
Me.lstOutput.Location = New System.Drawing.Point(16, 64)
Me.lstOutput.Name = "lstOutput"
Me.lstOutput.Size = New System.Drawing.Size(264, 196)
Me.lstOutput.TabIndex = 1
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
Me.ClientSize = New System.Drawing.Size(296, 273)
Me.Controls.Add(Me.lstOutput)
Me.Controls.Add(Me.Start)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Start.Click
Dim IpAddress As String
Dim PortNum As Integer
Dim Client As TcpClient
Dim Buffer() As Byte
Dim InBuff(1532) As Byte
Dim TxCommand As String
Dim RxResponse As String
Dim Temp As String
Dim j As Integer
Dim Dreg(5) As Double
Dim DregStr$
Dim SubHeader$
' IP Address specification
IpAddress = "172.16.56.99"
' Port Number specification
PortNum = 10000
Client = New TcpClient
'Line connection processing
Try
Client.Connect(IpAddress, PortNum)
Catch ex As Exception
MsgBox("Connection with the server failed, and the following code was returned:
"& ex.Message, 0, "connection error")
Exit Sub
End Try
Appendix C-2 Program example for communication using MC protocol -2
Appendix C: Program Examples
141
B
C
D
E

Advertisement

Table of Contents
loading

Table of Contents