Download Binary Data File over Serial Port

I need help setting up a .vi that I can use to download a binary data file from a dos-based system. I will send the system a command, say ascii "DOWNLOAD", and then the remote system will send me a binary data file that will be approx. 600MB. I won't be doing any display/manipulation using labview, I will just need to have the option available in LV to recieve the file.
Any examples would help a programmer that is new to LV and is getting a little desperate.

A VISA Read doesn't care whether the data it's getting is binary or ASCII. Where you might have problems is detecting that file transfer is complete. If you have enable termination character set to True in the VISA Configure Serial Port, the read will stop as soon as the termination character is detected. The default termination character is 0xA or a linefeed. You probably don't want to use this. If the file is terminated with a character or string of characters that you now will be unique, you can use this. If there is no unique termination character at the end of the file, the next best thing is to know the file size exactly and set the byte count of VISA Read to that number. Based on file size and baud rate, you would also need to adjust the VISA timeout value. Another way to do this is to transfer the data in pieces and write to a file as soon as the data is received. The reading of data would then be terminated when there are no more bytes available at the serial port. I've attached a LabVIEW 7.0 program that should give an idea of the last approach.
Attachments:
File Transfer.vi ‏57 KB

Similar Messages

  • Sending File Over Serial PORT

    Hi,
    I'm able to read/write data over serial port using Java Comm APIs in Linux.
    Can anybody please tell me how to write/read a file over Serial port?
    Is it similar to sending a file over network?
    An early response is appreciated...

    Same stream I/O as used over the port works from a file. Dead simple.
    Also dead slow. If you want to do large amounts of data, use a RandomAccessFile and read a big chunk at a time into a byte array. Then send the byte array.

  • Downloading a .DAT file

    Am having a mental lapse here.
    Using DW MX 2004 on XP
    I need to create a link where a user (non computer literate)
    can download a .DAT file to his.her desktop.
    All i get is a "page cannot be found" error page
    Does the file has to be a .exe or .zip file for it to open
    the dialogue box to for user to save or open or am missing
    something here?
    any hints will be appreciated
    Thks

    This is as much a guess as a hint, but I figured that you may
    be able to use
    a "Force Download" script:
    You don't mention what server language you're using... I use
    ASP VBSCRIPT
    and would use something like I've attempted to explain below:
    First of all create a page called "error.asp" - the user will
    be redirected
    to this page if the download fails.
    Then create a page called "forcedownload.asp" in the same
    folder/directory
    Copy and paste the following code to the forcedownload.asp
    page:
    =====>Begin
    <% FileName = (Request.QueryString("FileName"))%>
    <%
    Response.Buffer=true
    On Error Resume Next
    'Create a stream object
    Dim tfm_downloadStream
    Set tfm_downloadStream = Server.CreateObject("ADODB.Stream")
    tfm_downloadStream.Type = 1
    tfm_downloadStream.Open
    tfm_downloadStream.LoadFromFile
    Server.Mappath("../../changetofilepath/"&(FileName))
    If Err.number = 0 Then
    Response.Clear
    Response.ContentType = "application/octet-stream"
    Response.AddHeader "Content-Disposition", "attachment;
    filename="&(FileName)
    Response.AddHeader "Content-Transfer-Encoding","binary"
    Response.BinaryWrite tfm_downloadStream.Read
    tfm_downloadStream.Close
    Set tfm_downloadStream = Nothing
    Response.End()
    Else
    tfm_downloadStream.Close
    Set tfm_downloadStream = Nothing
    Response.Redirect("error.asp")
    End If
    %>
    =====>End
    (Make sure you change
    "Server.Mappath("../../changetofilepath/"&(FileName))"
    to reflect the correct file path to the .dat file)
    Then link to forcedownload.asp including the filename in the
    URL under the
    variable "FileName".
    For example, the link would read something like:
    "forcedownload.asp?FileName=MyFile.dat" (of course you would
    change "MyFile"
    according to the correct filename)
    I don't know if there's some "rule" that prevents .dat files
    from working
    with such a script... I've never tried it, but I do use a
    script similar to
    the sample above for a number of different file types to be
    downloaded
    across a range of different websites.
    Regards
    David
    "ositogrande" <[email protected]> wrote in
    message
    news:[email protected]...
    > Am having a mental lapse here.
    > Using DW MX 2004 on XP
    > I need to create a link where a user (non computer
    literate) can download
    > a
    > .DAT file to his.her desktop.
    > All i get is a "page cannot be found" error page
    > Does the file has to be a .exe or .zip file for it to
    open the dialogue
    > box
    > to for user to save or open or am missing something
    here?
    > any hints will be appreciated
    > Thks
    >

  • Airport downloading binary data instead of loading web page?

    I've been having the usual problems with dropped connections for the past month since I set up my new dsl service. It didn't bother me too much since all I had to do was unplug my airport and plug it back in. This morning it happened again and I decided to go ahead and update the firmware to 5.7.
    Whenever I tried to open a web page, I would get a little popup box that stated I was trying to download binary data. It gives me the option of opening in Textedit, etc. I'd try a different web page and the same thing happened. I've tried this on multiple computers and multiple browsers with the same result. I then downgraded to 5.5.1: same result. Tried soft and hard factory resets. No help. It's not the modem, since I am connected to it via ethernet right now with no problems. I can't believe I am the only one with this problem but I've searched all over and cannot find a fix for this. Any suggestions (in english please, I'm not completely computer-literate)?

    Mac OS X (10.6.6)
    Well, there is one problem....

  • Files via serial port

    I need to send a jpg file via serial port. Have anyone an idea how to get it. I am using LabView 6.0.

    Hi Francesc,
    In order to solve this you will need:
    - a null modem cable (the difference is that pin 2in goes to pin 3out and pin 3in goes to pin 2out)
    - a normal serial communication VI (you can use the one in lv\examples)
    - to pass the data you have to transform your array of bytes (your file) in string at sender and reverse this operation at receiver. THE ONLY PROBLEM is with ASCII character 11 (even if the receiver has all your bytes in buffer it seems that will return to you just those before ASCII 11). Thus, you will have to avoid the transmission of this character. An idea will be to split each byte from file in other two for transmission - for example its hex code (so, 11 will be transmitted as 0B ). Of course, this method doubles the number of transmit
    ted bytes. If somebody found a better solution, please let me know.
    good luck

  • I want to transfer data through the serial port in the same coding that hyperterminal uses. How can i do it?

    The serial port seems to be working, and labview seems to be sending the data, but the problem is in which format does it send the data, because in hyperterminal i just input the string "JDX" and it sends it to my device, with labview it sends something but my device does not recognize it.

    nobuto wrote:
    > I want to transfer data through the serial port in the same coding
    > that hyperterminal uses. How can i do it?
    >
    > The serial port seems to be working, and labview seems to be sending
    > the data, but the problem is in which format does it send the data,
    > because in hyperterminal i just input the string "JDX" and it sends it
    > to my device, with labview it sends something but my device does not
    > recognize it.
    Hyperterminal adds the carriage return/line feed to the string which is
    generated by the return key to send out the current line. LabVIEW simply
    sends out what you tell it, so try to set the string to "Show \ Display"
    format and add a \r or \n or \r\n to the command you want to send out.
    Assumes of course that you set the right baudr
    ate/bits/parity etc in
    LabVIEW with the VISA property node, when opening the serial port.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Why does a standalone program created in Labview 8.5 try connecting to the internet when the program only reads data through the serial port? Firewalls object to progams that contact the internet without permission.

    why does a standalone program created in Labview 8.5 try connecting to the internet when the program only reads data through the serial port? Firewalls object to progams that contact the internet without permission.
    The created program is not performing a command I have written when it tries to connect to the internet, it must be Labview that is doing it. How do I stop this from happening? 
    Any help would be very appreciated.

    It looks that way..
    "When LabVIEW starts it contacts the service
    locator to removes all services for itself. This request is triggering
    the firewall.This is done in case there were services that were not
    unregistered the last time LabVIEW executed- for example from VIs that
    didn't clean up after themselves"
    This is not yet fixed in LV2009.
    Message Edited by Ray.R on 11-04-2009 12:25 PM

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

  • To attach/upload binary data file(to vendor) from EP(sends from) to abap

    Hi All,
    I have requirement Enterprise portal(JAVA) will send the file data in binary format to abap.we have to attach the binary data(file) to content server.
    that is for vendor/custmer(XK02/XD02) will have attachments in the sap screen.
    similarly the above screens are provided using enterprise portal (using java) also attachment feature also needs to provide.
    so whenever user imports file form EP screen, they will convert the file into binary format and sends to abap through proxy(custom proxy) abap should attach the binary file to vendor/customer.
    I have checked so_object_upload,so_object_insert, binary relation create --  these FMs are helped using dialog box or providing the path of the file. but couldnt use when the file is in binary format and if it sent form proxy interface.
    could anyone help me in resolving the requirement to upload binary data.

    I use "call function 'ARCHIVOBJECT_CREATE_TABLE'" to process a binary table.  However, in my situation, I'm storing in Documentum.  Once that FM completed, I follow up with call function 'ARCHIV_CONNECTION_INSERT' to store the reference to the document and the archived object in SAP tables.  In your case, you need something that processes the binary table, or you need to utilize one of the "SCMS* " function modules to put your binary table into something that you can use with the other functions.
    The upload from desktop can be done using BIN filetype for GUI_UPLOAD class or function module, or from apps server, you can read your file into an xstring with open dataset....in binary mode....read dataset into your xstring, close dataset.

  • Project select data from the serial port

    Hi everyone,
    The project is about use labview to receive data from a serial
    port wirelessly. The serial port will receive two values (X1 and X2) every 10
    minutes. I want to use those two values as two inputs for my formula. How to
    make selection? Many thanks.
    Baicy
    Solved!
    Go to Solution.
    Attachments:
    port read.png ‏23 KB

    Scan From String.
    Using the first option, and putting some numbers in for the zeroes so it shows some kind of meaningful result.
    Attachments:
    Example_VI.png ‏12 KB

  • Downloading as dat file ... each columns in  NEW LINE

    HI ,
    Can any one help me out in this ...
    example emp table having columns empid ename salary
    12 AA 123
    now im downloading it as a ".dat" file , its getting downloaded but all the columns are in the same line
    i have tried it with chr(13) still its not getting to next line
    select empid||chr(13) ||ename||chr(13)||salary from emp .. this is how i framed the query ...
    in toad its displaying with square box in between the field
    required is
    =======
    12
    AA
    123 .. this is how it has to downloaded in dat file
    regards,
    ARUMUGAM

    HI,
    the query is working only for wordpad .. science im dow\nloading that file as a DAT file i cn open it in execle, word also but when i open in these two its displaying all the columns values in single line and not in new line
    the problem when i open in wordpad is ......... the file contains tags line <table>,<td etc > h
    how could i eleminate these tags and
    what could be done for getting in excel and word
    regards,
    ARUMUGAM

  • B&K Portable Signal Analyzer Binary Data Files

    I am currently using a B&K 2144/7651 Portable Signal Analyzer.  I'd like to start a project to display the binary data files created by the analyzer in Labview.  I have the technical documentation that specifies the formatting of the binary files and they have example code written for Pascal but I have no idea how to translate that to Labview.  If anyone has experience with these data files or could give me a hint on how to parse the Labile files I would appreciate it.
    I can post the technical doumentation but I have to scan it first.
    Thanks
    Eric
    Solved!
    Go to Solution.

    Hi Arvin,
          Thanks much for the Kudos!
    Here's a first "possbly useful" LLB.  The main thing is the data arrays are being populated!
    I hope you'll forgive me for not unpacking the entire "Setup" section - - I wasn't sure you needed it all(?)  As is, enough Setup is unpacked to interpret the Data correctly plus a bunch more.
    Please give it a test-drive and let me know if you need any unrepresented Setup values (or all of them.)
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
    Attachments:
    7651.FileReader.llb ‏1475 KB

  • Urgent!!! Need help in file read/write data to a serial port

    Hi,
    I really need someone's help in order for me to complete my project. I have attached a vi which I have taken from an example and integrate to my project. In the vi, I have managed to get the encoder counts using Ni 9411. I need to read/write that data from ni9411 to ni9870 without using any serial port as they are connected to a NI 9104 chasis. May I know whether I am correct in writing the data to my ni9870 port using the vi I have attached? Does anyone know how i can convert the number of counts to a 8-bit data/byte so that I can send the data through the RS232 port? I really need someone's help as I need to finished in 2 weeks time.
    I have also attached an vi on controlling the epos2 controller using instrument driver. Does anyone know how can i integrate this vi to the fpga vi (the one which I need to read/write data to 9870) as I need to send those data to control my epos2 controller.
    Please help me!!!
    Attachments:
    Encoder Position & Velocity (FPGA).vi ‏23 KB
    SINGLEMOTORMODIFIED.vi ‏17 KB

    Afai,
    As I allready suggested you here, call your local NI Office and ask for assistance!
    You really need assistence in a higher level that we can provide via the forums. Otherwise I don't see a chance for you to finish your project in time.
    1. Convert I32 to U8 to write it to the 9870 could be done like this:
    2. The vi to control the epos2.
    There is NO way ( absolutely NO way) to port this vi to FPGA. It's based on VISA calls, uses an event-structure, both are not available at the FPGA.
    The only thing you could do is to analyze the VI, the instruction set and design an FPGA vi which handles the specific instructions you would need.
    I have no experience with epos2 and I'm not 100% sure if this would work as you would like to use it. And doing this needs deep knowledge of LabVIEW, VISA, Instrument Drivers, the epos hardware, FPGA programming, and so on... 
    Christian

  • Send file to serial port using comfromfile

    Hi,
    I am current working on a project with requires to transfer a bin file to the controller, if the file is valid i will get the correct respose.
    if we send a file in hyperterminal using send text file option i am getting response from the controlller as file valid.
    I want to send a file through the code i used comfromfile function i am getting invalid file reponse from the controller even i tried byte by byte with comwrtbyte also i received the same invalid response..
    I cross checked the rs232 configuraiton of both hyperterimal and my code..both are same..even i checked with port sniffer tool to capture the port data..both are same.
    I am not able to find what is the issues with my code. what is the differece in the Hypertemail and CVI functions..
    Regards
    Vikram Kumar P

    Thank you for your support....
    As per policy i cant share my complete code..
    whatever eariler shared code is a part of my application code where the binary data is transfered..there is no issues with formating reading coping.
    I checked the serial data variable before sending the data is correct what expected to send.
    I tried all the serial functions comwrtbyte, comfromfile, comwrt & visa functions..the same behavior is received
    please find the attachment of catured data from portman tool.
    attached 3 files
    hyperterminal captured data - I am getting valid response from controller
    cvi exe captured data - I am getting failed response from controller.
    binary data - downloadable binary file to a flash memory using the RS 232 communication system
    Attachments:
    With CVI applicatoin exe.LOG ‏44 KB
    With hyperterminal.LOG ‏44 KB
    Binary data to transfer.txt ‏1 KB

  • Using Labview to download a data file

    I have a time-critical problem that I'm hoping some of the experts here can help me fix. In the file download_c.vi, I am trying to download a file from a remote computer over a serial port to my Labview control computer. The file works great when the file size is small(500-700KB). Anything over this, and I have to increase the bytes for the visa read to read, and then I lose data. Eventually the file that I will be downloading will be about 600MB. I know that the way the .vi is set up, this will never work for large files, and I throw myself on the mercy of the experts here in the forums for help.
    Can anyone take a look at the file that I've attached and show me how i can make this work for large files, more efficiently, and without losing my data.
    Advance thanks from a beginner that is getting slightly desperate.
    JDM
    Attachments:
    File Download.zip ‏46 KB

    Well, my first question would be - do you have to use serial?
    600 MB sounds like an awful lot for a serial connection.
    Second, I have never done anything like this, and I'm not sure I understood why you're losing data and where it's being "vanishing". If you're asking the port for X bytes and the timeout is too short, you will lose your data. You might need to play with it.
    But let's start with the first question I asked - does it have to be serial?
    Try to take over the world!

Maybe you are looking for

  • Row getting added in the end of the scroll

    Hi - I am using a scroll area on a page on level 1. The issue iam encountering is that when ever i click the plus sign to add a second or third row (assume one record already exists in scroll 1) , the row gets added in the end of the scroll and also

  • Installation errors for CS6

    Ipourchased and installed CS6 design and web premium after uninstalling the down loaded trial version. I am receiving the following errors: Display requirements not met Error 1310: error writing to file c:\config.msi DF012: File folder does not exist

  • Safari crash when I open facebook timeline

    I prefer to browsing fb desktop on safari instead of fb app, but safari just crash all the time after I zoom in&out several times on the timeline(myself) page. Anyone got the same problem? I hope ios will fix the bug in the future.

  • A buffering problem that is driving me nuts!

    Hello everyone. First of all I should thank all those who help me in solving this problem. I've updated my flash player to the latest one but have some annotying problems with it. When I pause a video, the buffer goes on and there's no problem; howev

  • Lexmark 6570 wont work

    I have a lexmark x6570 and I have tried everything on support forums to make it work with my macbook pro running lion 10.7.4, has anyone solved this problem? Please help!