How to transfer files from PC to PC via a serial port using labview

I need to transfer files (.txt, .doc, .xls) from PC to PC via a serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?

Yes, it is possible to transfer files with the serial port using LabVIEW.  The files are just collections of bytes and the serial port is good enough in the expedition of the bytes from one PC to another.  You must connect the ports series with a null modem cable.

First, take a look at the example of serial communication.   In LabVIEW, go to the Help menu and select «Find examples...» ».  From there, you can search for "serial" or navigate to hardware input and output > series.  Select «Write series base» and Read.vi  Try this example to gain confidence on the serial communication methods.

Then it's time to learn how to read and write files.  For this, the examples might be somewhat confusing as they deal with files that are presumed to have data of a specific type in them.  I would recommend just familiarize yourself with the functions in the file e/s palette.  Specifically, familiarize yourself with the following functions.

  1. Open/create/replace file - on the side of your destination, you will need to create the copy of the file you are trying to transfer
  2. Close the file - when you're done reading or writing to a file, you must close it.  It cleans the memory used and finalizes write operations that are still floating in the write buffer.
  3. Read a binary file - is the best way to play a file when you don't really like what type of file it.  In your case, you just want to get these read bytes and sent so they can be written down instead of destination.
  4. Write to a binary file - next to the destination, is what will store the bytes in the file that you created with the number 1.
  5. Size of the file get (under the range of the advanced features of file) - you need to know how big the file is, so you know when you are finished.

OK, so once you are able to create files byte write and read bytes from existing files, you can move forward.

I suggest the basic method is to have the user specify a source file on the source PC, and a folder on the destination computer.  Then find the size of the source file using the number 5.  Divide this number of size by the number of bytes that you want to transfer to the times.  The series pads are usually around 32 k (if I remember correctly) in order not to exceed that.  Now start to send data by reading a number of bytes and this string output wiring to the feature of writing VISAS.  On the side of destination, you will want to monitor the serial port for bytes and read when they arrive.  This string of yarn to the writing of the function of binary file to add them to your destination file.

This is the basic outline of how to do it.  He needs to not to overload him write and read buffers on the serial ports.  Initially, you can use delays on the side sending to make sure that the side reading has enough time to digest.  To make things faster, you can bring in a control of flow.

If all that sounds a little intimidating, there are there Alliance member companies (such as the automation of PrimeTest) who can write this code for you and even provides a turnkey for you solution.

Happy wiring,

Dan press

Certified LabVIEW Architect

PrimeTest Automation

Tags: NI Software

Similar Questions

  • How to transfer files from PC to Instrument via the LAN by SCPI?

    Dear all,

    Suggestions and procedures?

    Thank you very much!

    I find the method to do it.

    I have summarized the produre below:

    1. open source host controller (fopen) file

    2 get the queue size (fseek)

    3. create the order header (: MMEMATA)

    4 copy the file on the instrument (viWrite)

    Thank you for the answers.

  • I spilled coffee on my Macbook Air and does not illuminate.  How to transfer files from the external hard drive to backup my new Macbook Air?

    I spilled coffee on my Macbook Air and does not illuminate.  How to transfer files from the external hard drive to backup my new Macbook Air?

    If you had a Time Machine backup, you can use the Migration Wizard and connect your new Mac on the external drive which has the Time Machine backup: move your content to a new Mac - Apple Support

  • How to transfer files from one user to another in Windows Vista?

    How to transfer files from one user to another under Vista?

    How to transfer files from one user to another under Vista?

    A simple way is to move the file to the Public folder.
    Public folder is accessible by all users.

    How...
    Right click on the file > click Move To > navigate to the Public folder > click on move.

    If you do not Move To option in your right click context Menu, here is the tutorial...
    http://www.Vistax64.com/tutorials/89196-context-menu-add-copy-folder-move-folder.html

    Use an easier method.

    PS you can also use methiod drag-and-drop rather than pass to the method. I prefer the latter.

  • How to transfer files from mac to ios device?

    I am trying to transfer files from my Mac mini to my iphone via airdrop, but I don't see my device in the drop menu. How can I transfer files other than the drop?

    Another method is iCloud drive:

    http://www.Apple.com/icloud/icloud-drive/

    iCloud Drive FAQ - Apple Support

  • How to transfer files from pc to disc

    How to transfer programs from pc to a disk

    Drag-and-drop the file on the USB key in Windows Explorer. (Windows key + E).

  • How to transfer files from one account to another

    How to transfer files as music from one account to another? my old account has a virus and it got currupted and I want to know how to put my old files in my new account.

    http://Windows.Microsoft.com/en-us/Windows-Vista/fix-a-corrupted-user-profile

    "Fix a corrupted user profile.

    Try this method.

    To copy files to the new user profile

    After creating the profile, you can copy the files from the existing profile. You must have at least three user accounts on the computer to perform these operations, including the new account that you created.

    1. Log on as a user other than the new user that you created or the user that you want to copy the files.

    2. Open Documents by clicking on the button start , and then clicking Documents.

    3. Click on the Tools menu, and then click Folder Options.

      If you don't see the Tools menu, press ALT.

    4. Click the view tab, click Show files and folders, protected the clear theHide operating system files check box, and then click OK.

    5. Find the C:\Users\Old_Username folder, where C is the drive that Windows is installed, and where ancien_nom_utilisateur represents the name of the profile you want to copy the files to.

    6. Select all the files and folders in this folder, except the following files:

      • Ntuser.dat

      • Ntuser.dat.log

      • Ntuser.ini

    7. Click the Edit menu and then click on copy.

      If you don't see the Edit menu, press ALT.

    8. Look for the C:\Users\New_Username folder, where C represents the drive Windows is installed, and New_Username is the name of the new user profile you created.

    9. Click the Edit menu and then click on paste.

      If you don't see the Edit menu, press ALT.

    10. Sign out and then sign back in as a new user.

      If you have messages in e-mail, such as Windows Mail, you must import your e-mail messages and addresses to the new user profile before you delete the old profile. If everything is working properly, you can delete the old profile.

    If the steps above don't fix the problem, you should contact your provider of customer support for assistance. To find more information about customer support options that apply to this computer, click the button start , click Help and Support, and then click the ask someone or expand your search link at the bottom of the Help window.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to transfer files from damaged computer (intact HDD) W7 to new computer with W7?

    Computer fell, breaking the LED screen.  Failed to start.  Buy the new computer, poreferably with OS W7.  How can I transfer files from old computer to the new without losing data?  Should I change to W8, rather than transfer again to W7?

    Monday, December 17, 2012, 15:50:02 + 0000, Ron BMD wrote:

    Computer fell, breaking the LED screen.  Failed to start.  Buy the new computer, poreferably with OS W7.  How can I transfer files from old computer to the new without losing data?

    If you have deleted from the computer, there is a good chance that the hard drive
    has been destroyed, and the files are gone.

    Should I change to W8, rather than transfer again to W7?

    Your choice entirely.

    - http://answers.microsoft.com/message/f940a881-cafd-4a68-8c4d-ac2c26896535

    Ken Blake, Microsoft MVP

  • HOW TO TRANSFER FILES FROM WINDOWS MACHINE FOR ESXI

    Hi I want to transfer files from windows to ESXi 3.5 machine, I have a tool winscp. but I am unable to connect via winscp. I activated the SSH too. Sugest me how to transfer files to ESXi

    some links of usful for the same query

    http://www.bhcblog.com/2008/10/18/HOWTO-transfer-files-and-VMS-to-ESXi-Server/

  • How to transfer files from desktop to Tablet

    I have a Lenovo running Windows 8.1 desktop and just bought a HP Jet 7, 8.1 Windows running tablet.  I expect to be able to transfer files from my desktop computer to Tablet using the USB cable provided that works very well for charging on a wall outlet with the supplied aapter and the USB cable, so I know that the cable is OK, but when I use the cable to connect the dektop to the Tablet, nothing happens not even an error message.  Any suggestions?  Thank you.

    Hello

    This cable will not work. You need a USB OTG cable such as:

    http://www.Amazon.com/lifetime-warranty-electronics-micro-cable/DP/B005GGBYJ4

    Kind regards.

  • How to transfer files from the old hard drive to a disc new hard, old hard disk has been removed?

    I had a hard disk going bad. Installed a new hard drive and the need to transfer files from the old hard drive. I have an external enclosure for the old hard drive and can connect by usb port.

    The process is fairly simple once you put the old drive in the external box. You can use the usual methods of copy and paste in Windows Explorer. If you copy files, complete folders, you can take a look at RichCopy.

    http://TechNet.Microsoft.com/en-us/magazine/2009.04.UtilitySpotlight.aspx

    Tom Ferguson

  • How to periodically send various types of data via the Serial Port?

    Hello! Everyone

    I have to send data to LabVIEW to my device on the Serial Port.

    I know how to send data on serial port in LABVIEW, I already have this part.

    Now the problem is that I have several types of data I need to question my embedded device, if I want to send the query periodically command.

    So lets say that my four Op Codes are the following, which will send four different types of query command to my device on the serial port.

    (To be honest only OP_LED and OP_SENSOR is used now)

    0, OP_SYNC

    1, OP_LED

    2, OP_SENSOR

    3, OP_FUTURE

    Structure of basic package is as follows:

    Header (0x2C), Checksum, length of the data (n bytes), Op_Code (1 byte), length (length of Code + data Op)

    For OP_LED, I need to send the package as follows:

    0x2c 0x02 0x01 0 x 00 0x2F (0x2F being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    Length of the package this is 0x02

    0x01 is Op Code for OP_LED

    In the same way

    For OP_SENSORi need to send the package as follows:

    0x2c 0x03 0x02 0x00 0 x 00 0x2D (0x2D being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    0x03 is length of packet here

    0x02 is Op Code for OP_SENSOR

    So, how can I do this periodically in labview, in such sort that period can be adjusted whenever necessary.

    Is there something in LabVIEW to do.

    I had done the reception and decoding part and working properly.

    http://forums.NI.com/T5/LabVIEW/store-data-coming-from-serial-port-in-buffer-and-then-take/m-p/32722...

    So I must implement read and write the part of same while loop?

    Do not insert in the table if you put data in an array at index 0.  Just use array to build.

    No need to have Visa to write don't be a part of wire to the wire of reference and error VISA go in the upper part.  These wires should go THROUGH the entry VISA.

    Don't your checksum requires all the bytes up through data?  Righ now, you only put the checksum on data bytes and forget the opcode and length bytes.

    Your sending is not the opcode for Opsync or Opfuture.  You just send the empty tables.  At the same time for the other two, you put the opcode in the data table.  All your original opcode in the table build thread.  Get the data out of these structures in case item which is supposed to represent the opcode.

    xpress_embedo wrote:

    Now it works but I have now two problems.

    (1) OP_SYNC and OP_FUTURE do not data, but still receive its data on serial port, can I do something here as I have nothing when the table is empty in the structure of the case.

    I do not understand this statement.  Perhaps my answer above will fix any issue you have here.

    (2) how can selection operation Code to be send is done using control façade but real application, this task should be automated to a certain frequency, like OP_LED package must go out to the serial port to 100msec and packet OP_SENSOR must go out to 1000msec, I do this.

    Now you agree a little more architecture.  I would encapsulate the code that is in the while loop as a Subvi.  Then with the hand of your program while loop, use two time Express VI, a game for 100 msec, the other for 1000 msec.  When an express VI is true, run the Subvi with a command set waiting for the answer.  When the other VI Express is true, have it run the Subvi with the other set of commands.

    The device responds with anything when you send these commands?  You only send data.  I see no VISA Read to be able to recover all the data.

  • drive how to transfer files from 'C' g '.

    recently I bought an external drive, (G), now I want to transfer a lot of my files from C to G - how can I do >?

    Access your files through Windows Explorer. (Windows key + E). Right-click on a folder in the right pane and drag it to the G drive in the left pane. Release the mouse button and choose copy here.
     
    When you are finished, check that the files are successfully and delete the C drive. I suggest that you move only the personal files and not Windows file.
     
    You can defragment the disk when finished.
  • How to transfer files from sendnow

    How can I transfer my old service sendnow files

    Hi spc117,

    You ask about transferring files from Adobe Adobe SendNow send? Unfortunately, there is not a way to do it. Please see this: How can I transfer my existing downloaded files in my Adobe SendNow Adobe account send?

    Best,

    Sara

  • How to transfer files from old PC of office to the new Satellite L750?

    Hi everyone - starting at this site so be gentle with me please.

    Specifically, I want to ask: (a) Will the MS Word 7 Starter, which is already installed on my computer Toshiba laptop accept a lot of files from my old Desk Top for most Word documents? What kind of capacity has the Starter? What is the best device to use - a portable hard drive? USB? Discs?

    and

    (b) how to retrieve my Bing toolbar? Currently, I don't have a toolbar that displays the file, new, cut and paste at all. I have a space of Bing search on my desktop, but nothing else except a toolbar at the top where I type addresses located on the side until now at the top right with host, Star and a cog. Higher than ago valued one minimize, maximize and cross to close.

    Thank you very much

    RR

    Hello

    All word documents are compatible with any Microsoft Office Word application.
    If you used old software in Microsoft Office 2003 and now want to use an Office 2010 or later server MS Office 2007, then you will need to install a patch Ms.
    But usually, you will receive a notification message if necessary.

    On moving the files to the other computer.
    The best and easiest method to move files is the use of external HDD USB or memory flash stick, copy the files to USB HDD and then move it to the new laptop.

    That's

Maybe you are looking for

  • Safari issues - 9.1.3 version

    Hardware: Macbook Air (early 2015) - OS X Yosemite (10.10.05) Guys good day. I've just updated my OS X Security and Safari last night. I am currently having problems with my Safari, it varies not being able to load a Web site (cannot connect cannot c

  • Satellite C870-1F3 - where is the disc/dvd player?

    Hi guys,. I'm probably being a real muppet, but have only brought this laptop for my dad, and we can't see where the disk drive hard/dvd bit is and how to open it - help please!

  • Apps on my ipad has disappeared; reappear briefly during the restoration, and then disappear again.

    I'm in IOS 9.2.1 on an iPad Mini 2, implemented to date (January 31, 2016.) Before the update, I noticed that he lacked all default applications. Projector showed the apps, but the 'Open' button was grey out. The app store shows install them on the i

  • installation of Viva Piñata pc game

    I have a version bought on Viva Piñata for Windows on a DVD. My new laptop has no dvd player... Is there a way to download digitally with my product key? Or can I install it with an external hard drive and play without the dvd? I tried to activate th

  • LR6 install it not on 64 bit Win7, it's Vista

    I have LR6 on my desktop computer. It was purchased on disk with the option to install on two computers.So now I'm trying to put it on my laptop for travel. The two machines that are running Windows 7 64-bit professional.When I try to install on the