Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Retrieve files from compact flash MSO 4034

Questions in this forum area are community supported. Tektronix does not regularly monitor posts in this area.
Post Reply
akalei
Posts: 1
Joined: January 26th, 2012, 4:24 pm

Retrieve files from compact flash MSO 4034

Post by akalei » January 26th, 2012, 4:30 pm

I have .png and .csv files saved on the compact flash. I would like to retrieve them via ethernet to a windows computer via labview but am not sure how to use the filesystem:readfile command. I do not have the luxury of using a compact flash reader.

I'd appreciate any help. Thanks!

Chris B
Tektronix Applications
Tektronix Applications
Posts: 657
Joined: December 17th, 2010, 3:17 pm

Re: Retrieve files from compact flash MSO 4034

Post by Chris B » January 27th, 2012, 7:59 am

I am not a LabView expert, but the algorithm I would use:

First, set the current working directory to the compact flash with:
FILESystem:CWD "D:"

next, if you do not know all the names of the files you need, then get the this of whats on the drive:
FILESystem:DIR?

Then, loop through the contents of the file names with the:
FILESystem:READFile "<filename>"

Now, this will transfer the data over to your PC, and be held in RAM by your program. You will have to write that data to a file on the PC yourself.

pandeyom9
Posts: 3
Joined: May 7th, 2018, 9:55 pm
Country: India

Re: Retrieve files from compact flash MSO 4034

Post by pandeyom9 » May 7th, 2018, 10:08 pm

I am able to transfer text or csv files but not image files. Could you please provide me VBA code to get the data from PC memory.
For text file I used below given code;
Getting text file using this
FILESystem:READFile "<filename>"
and then below given code for creating the text file.

Code: Select all

    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")

    Dim Fileout As Object

    Set Fileout = fso.CreateTextFile("D:\vba2.txt", True, True)

    Fileout.Write Osc.ReadString
    Fileout.Close
It would be great if you can provide me code to transfer the image file.

Dave W
Tektronix Applications
Tektronix Applications
Posts: 266
Joined: April 26th, 2010, 12:01 pm
Country: United States

Re: Retrieve files from compact flash MSO 4034

Post by Dave W » May 8th, 2018, 9:14 am

Hi pandeyom9,

You seem to have had a similar post regarding the DPO5204B. The issue here is the same as the issue in that post. My response was
When you read the bytes from the instrument you need to write them directly to a file on disk without any modification. I'm not too familiar with VBA, but I would guess your Osc.ReadString call is going to modify the bytes and try to convert them into a Unicode string which will corrupt the image data. Make sure you are reading the data back from the scope as a byte array and not a string.
In short, don't treat the data returned as text because it is not text. Treat it as plain old bytes and make sure you are writing the raw bytes to disk without any modifications.

Post Reply

Return to “Other or Discontinued Oscilloscopes”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests