EasyManua.ls Logo

Mitsubishi Electric CR750-Q - Page 614

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...
Appendix-594 Real-time external control function
7Appendix
Width = 975
End
Begin VB.Label Label1
Caption = "IP address"
Height = 255
Left = 120
TabIndex = 0
Top = 120
Width = 1095
End
End 'Screen setting To here
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
a) Program for the clients (when using the personal computer as the client and using the controller as the
server).
Option Explicit
Dim RecvData() As Byte
Private Sub Check1_Click() ' Process when the connection check button is clicked
If Check1.Value Then
Winsock1.RemoteHost= Text1.Text
Winsock1.RemotePort= Text2.Text
Winsock1.Connect
Else
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_DataArrival(ByVal bytesTotal As Long) ' Process when the received data arrives
If bytesTotal > 0 Then
ReDim RecvData(bytesTotal - 1)
Call Winsock1.GetData(RecvData, , bytesTotal)
Text4.SelStart = Len(Text4.Text)
Text4.SelText = StrConv(RecvData, vbUnicode)
End If
End Sub

Table of Contents

Related product manuals