LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

transfer a file over tcp or datasockets

Hello,
I want to transfer a complete JPEG file over TCP or DataSockets with LabW CVI. I got the code example "transfering ascii file with dataSockets" but it doesn't seems to work on my computer.
Please Help me. How can I do that with LabW CVI?
0 Kudos
Message 1 of 3
(3,017 Views)
Hi,

I wrote a program similar to this in Visual Basic using IMAQ Vision software and datasocket. My URL for the datasocket connection was dstp://localhost/image. I found the program worked the best when the reader and writer were in autoupdate mode. The real keys to simplifiying the code were the IMAQ Vision "Image to Array" and "Array to Image" functions. This allowed me to convert the image to a 2D array for transfer through datasocket.

Note, for an image approximately 300 x 300 pixels, the transfer time just over the local machine (Dell Pentium III with 128 megs of ram) was approximately 5 seconds.

Unfortunately, Datasocket cannot be used to send binary files. If this was an ASCII text file, you could use a URL of the form file://...

If you wo
uld like more information on the IMAQ Vision software, go here. This is an ActiveX component, so you could easily build a project similar to the attached Visual Basic example in CVI.

regards,
Eric Meyer
National Instruments
0 Kudos
Message 2 of 3
(3,017 Views)
Oh, and as a sidenote, you can always easily transfer files over shared network drives using the normal file I/O library functions. If both reader and writer are on the same network, this is the optimal solution in terms of ease of implementation and speed of transfer.

good luck,
Eric
0 Kudos
Message 3 of 3
(3,017 Views)