Omron Forums Support Posted March 14, 2022 Posted March 14, 2022 For the full project see the attachment. Below is a step by step description using Visual Basic:1. Import the following libraries: Imports System.Net.Sockets Imports System.Text2. Define the following variables which are used in the code lines later: Dim ClientSocket As New TcpClient Dim ServerStream As NetworkStream Dim ServerAddress As String = "192.168.0.100" Dim PortNumber As Integer = 49211 Dim ReceivedData As String Dim inStream(10024) As Byte 3. Connect to camera: ClientSocket.Connect(ServerAddress, PortNumber) 4. Send data: Dim OutStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes("jobinfo\r\n") ServerStream.Write(OutStream, 0, OutStream.Length) ServerStream.Flush() 5. Receive data:To receive data from the camera in a safe way (without losing data), we need to listen to the socket continuously on a separate thread. The thread function will use a while loop in the following way: While 1 ServerStream.Read(inStream, 0, CInt(ClientSocket.ReceiveBufferSize)) ReceivedData = Encoding.ASCII.GetString(inStream) txtShow() End While*The function txtShow() is a local service routine to display the data. Operating System Any Quote
Recommended Posts
Top Posters In This Topic
1
Popular Days
Mar 14
1
Top Posters In This Topic
Omron Forums Support 1 post
Popular Days
Mar 14 2022
1 post