Paulo Almeida Posted September 1, 2004 Report Share Posted September 1, 2004 Hello I am developing an system with one server and multiply clients, in this moment i can transfer the most type of data, arrays and strings. But i having a problem on transfer files between the clients for the server. I read the file on the client but i can't send to the server. I saw the examples in Labview examples but they used Datasocket communication and id like use only the TCPIP communication. Someone can help me? Sorry for my bad english :headbang: Quote Link to comment
didierj Posted September 2, 2004 Report Share Posted September 2, 2004 Paulo, Just open and read the file as a text-file. Send the read "string" over TCP the way you are used. On the client read the "string" from TCP, create a new file and write the "string" to this file. Maybe you'll have first to send the filename (also as a string) over your TCP connection, so your server knows the name of the file. LV doesn't care of the real type of the file. LV reads byte by byte and puts them into a string. Didier Quote Link to comment
Sarah83 Posted September 2, 2004 Report Share Posted September 2, 2004 Thats funny, we have the same project :thumbup: Quote Link to comment
Sarah83 Posted September 2, 2004 Report Share Posted September 2, 2004 Hi! Now I have a tcp connection but every time there es failure message: Failure 66: LV: The network connection was closed by a partner. Which partner???? :headbang: I simulated a server like the example simple data server. Quote Link to comment
Paulo Almeida Posted September 2, 2004 Author Report Share Posted September 2, 2004 Hi I had the same error, but you have to clean that error, you can see one example in the examples of Labview. Something about clean error 66 and errors 56 and 64. these error are relation about time out if your connections are slow you have this errors you are saying you have the same project as my, i don't know if i glad for you or sad Quote Link to comment
Paulo Almeida Posted September 2, 2004 Author Report Share Posted September 2, 2004 Hi, I try that but i have problems on side of Server, because in sever i have one cycle which receive same information for all clients. and i want send file from clients only one time and with permission of server. i'll try send one boolean variable for all clients for clients send the file if their want.but i don't have more ideas and don't know to work with datascoket.this tecnologi have very qualities but i don't know how to work with it. Tanks for reply me :worship: Quote Link to comment
Paulo Almeida Posted September 2, 2004 Author Report Share Posted September 2, 2004 Hi You saw the example i told you yet? Can help you Quote Link to comment
Sarah83 Posted September 2, 2004 Report Share Posted September 2, 2004 Hi, ok, now the failure message 66 is off Now I have an connection between my two PC's, I can sent one string from one PC (1) to an other PC (2) :thumbup: My next challenge is to send this string back to PC 1 and there I have to compare these two strings (I must find out if the sting I sent is the same string I received) and make it visible with an LED. But I don't know how to sent my string back. Must I open the TCP connection a second time after reading TCP on PC1? Is it possible to send a string from a PC to an other PC without LV installed and sent this string back to the PC where LV is installed? Or must LV be installed on both PC's? Quote Link to comment
Bryan Posted September 2, 2004 Report Share Posted September 2, 2004 I'm doing TONS with Tcp/Ip right now, but I'm mostly passing binary strings in a protocol with header and checksum. You don't have to have LabVIEW on 2 machines to communicate via tcp/ip, but one machine needs to be set up as a server, and the other a client. Just so long as you have a program on each PC that can act as one or the other, and be able to connect to an IP address and port as well as have the ability to accept the strings it receives you should be able to. I have a LabVIEW program acting as a data acquisition host on a PXI chassis. Using TCP/IP, I can connect to that PXI chassis from any computer that can access it's IP and specified port. I've run LabVIEW as a host, Tcl as a client and vice versa as well as various combinations without problems. So, to answer your question, no, you don't have to have LabVIEW on both machines, BUT you have to have a program on your PC without labview that's able to connect to your PC with labview via ip and port and send/receive strings. I believe you could use hyper terminal for that, I think it's standard on most PCs, but I've never used it so I couldn't tell you what to do. EDIT: I just opened hyperterminal on my computer and tested it with my program here at work. You can create a new connection via TCP/IP, specify an IP and Port and it will run as a receiver, displaying the ascii representation of what it recieves, but I don't know how to send things back to it. It provides the ability to send/receive files and text files, but I don't know how it works. I couldn't do it with mine because my LabVIEW program communicates with our own proprietary in-house protocol, it will reject normal text sent to it. Quote Link to comment
Paulo Almeida Posted September 2, 2004 Author Report Share Posted September 2, 2004 Hi, ok, now the failure message 66 is off Now I have an connection between my two PC's, I can sent one string from one PC (1) to an other PC (2) :thumbup: My next challenge is to send this string back to PC 1 and there I have to compare these two strings (I must find out if the sting I sent is the same string I received) and make it visible with an LED. But I don't know how to sent my string back. Must I open the TCP connection a second time after reading TCP on PC1? Is it possible to send a string from a PC to an other PC without LV installed and sent this string back to the PC where LV is installed? Or must LV be installed on both PC's? 1614[/snapback] I don't understand your doubth but i think for your problem you have a tool in labview "equal" if you can acess both strings and this tool you can compare. But for you change Strings you need labview in the two pc or you can make a program in C for communicate with tcp port, good luck :thumbup: You can also make an executable tougth builder of LV but i don't try this yet Quote Link to comment
Sarah83 Posted September 3, 2004 Report Share Posted September 3, 2004 I don't understand your doubth but i think for your problem you have a tool in labview "equal" if you can acess both strings and this tool you can compare. But for you change Strings you need labview in the two pc or you can make a program in C for communicate with tcp port, good luck :thumbup: You can also make an executable tougth builder of LV but i don't try this yet 1616[/snapback] How to compare is clear, but how to sent the stings back .... I will try to find out something about Bryan's solution Quote Link to comment
aledain Posted September 3, 2004 Report Share Posted September 3, 2004 You can also run both the client and the server on the SAME PC, makes debugging real easy cheers, Alex. Quote Link to comment
aledain Posted September 3, 2004 Report Share Posted September 3, 2004 How to compare is clear, but how to sent the stings back ....I will try to find out something about Bryan's solution 1623[/snapback] To send strings back: on your server just do a write operation after the read of the client message ... Client : WriteMsg, ReadMsg(with timeout 60 sec) Server: ReadMsg(with timeout 60 sec), writemsg cheers, Alex Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.