Mitsubishi Electric CR800 Series Ethernet Function Instruction Manual page 132

Electric industrial robot
Hide thumbs Also See for CR800 Series:
Table of Contents

Advertisement

4 Appendix
If Check1.CheckState = CheckState.Checked Then
Else
End If
Catch ex As Exception
MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1)
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Send text
Try
Dim SendBuf As Byte() = System.Text.Encoding.Default.GetBytes(Text3.Text)
Dim Stream As NetworkStream = Client.GetStream()
Stream.Write(SendBuf, 0, SendBuf.Length)
Catch ex As Exception
'Disconnect
Client = Nothing
MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1)
End Try
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Receive process
Try
'
If Client Is Nothing Then
4-12
Dim interfaces As NetworkInterface()
Dim _currentInterface As NetworkInterface
'Get local IP address
interfaces = NetworkInterface.GetAllNetworkInterfaces
For Each NetworkInterface As NetworkInterface In interfaces
If NetworkInterface.Name = "Local Area Connection" Then
_currentInterface = NetworkInterface
Dim properties As IPInterfaceProperties
properties = _currentInterface.GetIPProperties
If properties.UnicastAddresses.Count > 0 Then
For Each info As UnicastIPAddressInformation In properties.UnicastAddresses
Text1.Text = info.Address.ToString
Next
End If
End If
Next
'Wait connection from client
Listener = New TcpListener(IPAddress.Parse(Text1.Text), Convert.ToInt32(Text2.Text))
Timer1.Start()
Listener.Start()
Client = Nothing
Timer1.Stop()
Button1.Enabled = False 'Disable send button
Text3.Enabled = False
Listener.Stop()
'
If Listener.Pending = False Then
Text1.Enabled = False
Text3.Enabled = False
'Stop listen
'Disable IP address edit
'Disable send text edit

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr751 seriesCr750 series

Table of Contents