LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending multiple files from one folder to another using tcp/ip in labview.

Hi, I have done this code which helps me to send 1 file from folder to another using tcp/ip in labview, as part of learning. Next I am trying to change this code to send multiple files from a folder to another folder using tcp/ip in labview. Iam not sure how to do it. Can someone please help me by suggesting a method. I have attached the VI's for reference. Thanking You.

Download All
0 Kudos
Message 1 of 6
(4,173 Views)

You will definately want to change over to a state machine for this.

 

  1. I would set up a protocol such that
  2. Client connects to server
  3. Server sends # files to be sent
  4. Client Acknowledges
  5. Server sends file
  6. Client Acknowledges when complete
  7. Repeat 5 and 6 until all files are sent
  8. Disconnect

 

A proper state machine will make this really simple and allow for the possibility of retries in the case of an error.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(4,142 Views)

Do you really need to send and receive the same file over and over as fast as the computer and network allows? Are you really creating a new listenener with every iteration? 😮

I don't see any way to e.g. specify the remote folder, so this seems a bit single-purpose. Once you sens multiple files, the target path would need to be embedded into the communication.

 

If these computers are on the same network, wouln't it be simpler to just use windows file sharing and write to the remote folder directly?

Or how about a network shared variable to share data between machines?

0 Kudos
Message 3 of 6
(4,134 Views)

Hello, thank you for your kind reply. But I am actually novice in the field of labview and learning stuff. So what I want to know mainly is what should I use for sending mutiple files from one folder to another. As u seen in the code I ve uploaded for sending 1 file I ve used Write to Binary file and Read to binary file. But with that only 1 file is possible. I need to send multiple files. Its not like I select files one by one. I just select the source folder and the target folder and it automaticall copies all files from the source folder to the target folder using tcp ip. What should I use in place of write to binary file and read to binary file. Thank You.

0 Kudos
Message 4 of 6
(4,102 Views)

For the sake of learning, reading the file, sending over TCP, and then writing the file is fine.  But, again, you will want to use a State Machine.  If you properly plan out your states before doing any coding, it will become a lot simpler.

 

The State Machine is such a fundamental architecture that you really should learn it anyways.  And since you are still in the learning stages, here are some free tutorials:

3 Hour Introduction 
6 Hour Introduction 
LabVEW Basics
Self Paced training for students 
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(4,091 Views)

Thank You very much.

0 Kudos
Message 6 of 6
(4,086 Views)