필터 지우기
필터 지우기

How do I send a file .txt or .evt between two computers using TCP/IP

조회 수: 17 (최근 30일)
Vanessa ricardo
Vanessa ricardo 2015년 8월 1일
댓글: Walter Roberson 2015년 8월 2일
I need send files but just found how tranfer cha.

답변 (4개)

Walter Roberson
Walter Roberson 2015년 8월 1일
file_as_char = fileread('YourFile.evt');
Now file_as_char is char that can be sent.

Cedric
Cedric 2015년 8월 1일
편집: Cedric 2015년 8월 1일
I'd say "by email". More seriously, if you need to build a client-server system, look at the following:
The example is easy to run on two distinct machines, and you can send a file content this way.

Vanessa ricardo
Vanessa ricardo 2015년 8월 1일
%cliente
t = tcpip('192.168.7.195', 50000, 'NetworkRole', 'client');
fopen(t)
pause(2);
fprintf(t, 'Hola sub 2');
%servidor
t = tcpip('0.0.0.0', 50000, 'NetworkRole', 'server');
fopen(t);
data=fscanf(t);
I managed to pass a message ' hello world ' from a PC to another, but I want to do is send an .evt file I have on my PC to another PC . could you help me to send and receive the file ?
  댓글 수: 3
Vanessa ricardo
Vanessa ricardo 2015년 8월 1일
thanks so much, how can i do to solve this problem ? i dont speak english sorry my way to write.
Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout period.
Cedric
Cedric 2015년 8월 1일
편집: Cedric 2015년 8월 1일
But at this stage I have to ask you how serious your project is, how large are the files that you need to transfer, and why you need to manage file transfer from MATLAB. Because writing a solid/stable client-server system is complicated.
For a small project, I would play with TCPIP etc, because it is "fun" to learn a bit how to deal with these things. If I had to build a solid/stable solution though, I would install an FTP server or a Web server, or anything which supports protocols for transferring files, and I would use this from MATLAB. If one machine had an FTP server for example, I would use
Then I would just test the presence of new files, or use TCPIP for signaling/synchronizing transfers, and let the FTP client/server, WGET, etc, manage file transfers properly.

댓글을 달려면 로그인하십시오.


Vanessa ricardo
Vanessa ricardo 2015년 8월 1일
the truth is that I have to transfer files constantly from multiple computers to a principal , through dial up , I wanted to test how to pass files with tcpip because I thought it would be equal to the modem 232 , if not, could you help me do it ? I call specific numbers modem and transfer the files . if you would be a tremendous help . this is my mail avril_just159@hotmail.com
  댓글 수: 5
Vanessa ricardo
Vanessa ricardo 2015년 8월 1일
what I need is: I have several computers connected through dial up modem rs232 to a private telephone line , each modem has its number this network already exists , I wanna call the specific number and have a program that responds to my call . I have three pcs in two of them constantly .evt files stored in a folder called events. what I want is that in the third pc main constantmente these folders are synchronized automatically , that is like a cloud.
use matlab because is the program that my university want. if you give me a email i can explain better. sorry the english again.
Walter Roberson
Walter Roberson 2015년 8월 2일
Is this to solve a practical problem, or is it a university assignment? If it is to solve a practical problem, then do not use MATLAB for this: use one of the existing tools such as kermit or hyperterm.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interface-Based Instrument Communication에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by