EasyManua.ls Logo

Mitsubishi Electric CR750-Q - Page 615

Mitsubishi Electric CR750-Q
730 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
7Appendix
Real-time external control function Appendix-595
Private Sub Winsock1_Error(ByVal Number As Integer, _
Description As String, ByVal Scode As Long, _
ByVal Source As String, ByVal HelpFile As String, _
ByVal HelpContext As Long, CancelDisplay As Boolean) ' Process when an error occurs in Window
Socket
Check1.Value = False
Command1.Enabled = False
Winsock1.Close
MsgBox " Error:" & Number & "(" & Description & ")"
End Sub
b) Program for the server (when using the personal computer as the server and using the controller as the
client).
Option Explicit
Dim RecvData() As Byte
Private Sub Form_Load()
Text1.Enabled = False ' Make edit of the IP address impossible.
End Sub
Private Sub Check1_Click() ' Process when the connection check button is clicked
If Check1.Value Then
Text1.Text = Winsock1.LocalIP
Winsock1.LocalPort = Text2.Text
Winsock1.Listen
Else
Command1.Enabled = False
Winsock1.Close
End If
End Sub
Private Sub Winsock1_Connect()' Process when the network can be connected
Command1.Enabled = True
End Sub
Private Sub Winsock1_Close()' Process when the network is closed
Check1.Value = False
End Sub
Private Sub Command1_Click()' Process when "Transmission" command button is clicked
Winsock1.SendData (Text3.Text)
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long) ' Process when the connection
demand comes
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.Accept requestID
Command1.Enabled = True
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)' Process when the received data arrives
If bytesTotal > 0 Then

Table of Contents

Related product manuals