LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transfering files

There is a way to do a simple VI client that transfert a VI or library to a
specified path on a server by VI on the server side too?

let me know if u can help
Eric
0 Kudos
Message 1 of 4
(3,660 Views)
Hi Eric,

"Simple"?
I don't believe there is a simple way to do what you are asking.
If the two machines can map each others drives, you can "simply" use the "copy" (File I/O >>> advanced >>> copy) to move the files you are after.

If this is not the case and you do not want to set-up an FTP site then life gets interesting.

A brief outline of the two (server and client) follows;

SERVER:
Check out the VI server example under TCP/IP.
Create an "action engine" VI and configure LV (on the server) so it knows this VI is served. On the FP on this action engine place three string controls and two string indicators. Wire all of these to the connector pane. The three controls will be "action" "File spec" and "data". THe indicators can be "status", and "data out".
Wire the "action"
control to a case structure with three states, (read, write, bad_command(default)). In the read case, use the file spec control to open a file and convert it to a string which is wired to the "data out" indicator. Do similarly with the write case.

Cient:
Write a VI that opens a connection to LV on the server and then open a connection to the "action engine" VI on the server. Use a call by reference node and wire in the command and file spec. The contents of the file (if everything is correct) should be retuned via the "data Out" terminal of the call by reference. This data can then be written to disk.

"Simple"?

I wouldn't say so.

But, if you get this to work, you will be powerful.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(3,660 Views)
Hi Ben, thanks for the help, I try it, but I have littles problems to
understand you. First what's the function of the control data?
Second: i'm not familiar with call by reference node. If you can send me an
example or explications...
So if you have time to help me more, I'll apprciate this. However, I thank
you for the help you give.

Eric
0 Kudos
Message 3 of 4
(3,660 Views)
Hi Eric,

The data control on the server will accept the file contents from the client that is to be written to a file on the server. If you do not intend on moving files from the clients to the server, this control can be eliminated.

The call by reference node can be found in the application control pallette. Once you drop it on the diagram, right click and select "select VI server class" and then browse. Navigate to the server VI and select it. This will configure the inputs and outputs of the "call by ref..." so you can wire up your inputs and outputs (make sure you configured the connector pane of the server VI first!).

I can't promise that I will have time to reply, but if you have questions you can e-mail me at bar@dsautomation.com .

I hope
this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 4
(3,660 Views)