Mitsubishi Electric QJ71E71-100 User Manual page 427

Q corresponding ethernet interface module
Table of Contents

Advertisement

Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs
As System.EventArgs) Handles Command1.Click
'Connect to the Ethernet interfece module.
Dim sock As New Sockets.Socket(Sockets.AddressFamily.InterNetwork, _
Sockets.SocketType.Stream, Sockets.ProtocolType.Tcp)
Ajsock = sock
Dim ip As IPAddress = Dns.Resolve("192.0.1.253").AddressList(0)
Dim ipend As IPEndPoint = New IPEndPoint(ip, "8192")
Me.Ajsock.Connect(ipend)
MsgBox("Connection Completed")
State = Me.Ajsock.Connected()
End Sub
Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs
As System.EventArgs) Handles Command2.Click
Dim SData As Byte()
Dim RData(256) As Byte
'Rend D0 to D4 (5 points) with the A-compatible 1E frame command.
SData = Encoding.ASCII.GetBytes("01FF000A4420000000000500")
'Read D0 to D4 (5 points) with the QnA-compatible 3E frame command.
'SData = Encoding.ASCII.GetBytes("500000FF03FF000018000A04010000D
'Send the data.
Me.Ajsock.Send(SData)
MsgBox("Send completion", MsgBoxStyle.Information)
'Read the response from the PLC CPU.
Me.Ajsock.Receive(RData)
MsgBox(Encoding.ASCII.GetString(RData), MsgBoxStyle.Information)
End Sub
(To the next page)
APPENDICES
*0000000005")
425
A

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qj71e71-b5Qj71e71-b2

Table of Contents