+ 3

If I am sending data from python how do I receive in matlab side all these? for the moment I have this: t=tcpip('localhost',197

This is my server in python: import pygds as g import time d = g.GDS() minf_s = sorted(d.GetSupportedSamplingRates()[0].items())[0] d.SamplingRate, d.NumberOfScans = minf_s for ch in d.Channels: ch.Acquire = True d.SetConfiguration() scope = g.Scope(1/d.SamplingRate) #print("test") # data = d.GetData(d.SamplingRate,scope) # this runs the scope figure #data = d.GetData(d.SamplingRate) data = d.GetData(d.SamplingRate) print(data.shape) print(data.shape[1]) print(data.shape[0]) import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('localhost', 1972)) # Привязываем серверный сокет к localhost и 3030 порту. s.listen(1) # Начинаем прослушивать входящие соединения. conn, addr = s.accept() # Метод который принимает входящее соединение. while True: data = conn.recv(1024) # Получаем данные из сокета. if not data: break conn.sendall(data) # Отправляем данные в сокет. print(data.decode('utf-8')) conn.close() This is my client matlab: for the moment I have this: t=tcpip('local

3rd Nov 2022, 7:41 AM
Zhenis Otarbay
Zhenis Otarbay - avatar
1 Réponse
+ 1
Mhm you get a tupple, try to extract them as example: Example=(„ipaddress“, 4000) Ip, port = Example Print(Ip, port) Hope that help you
25th Nov 2022, 3:18 PM
S3R43o3
S3R43o3 - avatar