hi,all.
now i need to develop one VB.net program to send data to Q series CPU following MC 3E protocol.and now,I can connected to E71 module successful,but while i tried to send data to PLC side,program response code is ok,but PLC side cant received any data.
can anybody give me some advise?
My VB code as followingPC -> PLC,ASCII code)
----------------------------------------------------------------
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
'Connect to the Ethernet interfece module.
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
'Send D4001 to D4003 (3 points) with the QnA-compatible 3E frame command.
'SData = Encoding.ASCII.GetBytes("500000FF03FF000018000A14010000D*004001199512021130")
'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
now i need to develop one VB.net program to send data to Q series CPU following MC 3E protocol.and now,I can connected to E71 module successful,but while i tried to send data to PLC side,program response code is ok,but PLC side cant received any data.
can anybody give me some advise?
My VB code as followingPC -> PLC,ASCII code)
----------------------------------------------------------------
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
'Send D4001 to D4003 (3 points) with the QnA-compatible 3E frame command.
'SData = Encoding.ASCII.GetBytes("500000FF03FF000018000A14010000D*004001199512021130")
'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