:DISK:FILE:READ?
Query Syntax
:DISK:FILE:READ? "filename" <maximum buffer length>
Where <maximum buffer length> is optional.
Description
Returns the contents of the requested binary or text file. The query takes a file name of the source file as the argument. The advantage of using this query for text files rather than the :DISK:FILE:ASCii:READ?
query is that the data will not be modified upon reading. For example, the :DISK:FILE:ASCii:READ?
query might modify the characters used to define the end of a line to match the receiving environment (PC, Mac, etc.).
Returned Data Type
The :DISK:FILE:READ?
query returns binary byte values as binary definite-length block data queries binary definite-length block data queries binary definite-length block data queries. You must specify this data type in your program language's command that you use to query the data. The specifier for this data type in your programming language will likely be "B" and it is identified in this example with red text. Confirm this with your programming language's documentation. The following is an example of the command used in Python using pyvisa.
The binary contents do not need to be interpreted as integers or floats on the receiving side. Because the data is being send as binary bytes, the endian setting in FlexDCA will not matter. If you plan to save the returned data in a file, the bytes, as received, need to be saved to a file in the order that they are received.
file = '"%USER_DATA_DIR%\\Screen Images\\test_image.jpg"' data = Flex.query_binary_values(':DISK:FILE:READ? ' + file, datatype='B', header_fmt='ieee', container=bytes)
If you are using Python 3 with pyvisa, the data format specifier can also be "s" for a Python byte string. You'll see this specifier used in the example program for this command.
Path Substitution Strings
Use FlexDCA's Path Substitution Stings in you file names to eliminate the need to enter long path strings. For security reasons, this command only allows the %USER_DATA_DIR%
and %TEMP_DIR%
path substitution strings to be used. All other path substitution strings will result in a failed query with a –258, Media protected.
error code.
Security Restrictions
Starting with FlexDCA revision A.07.90, file I/O security was increased when reading or writing files using the :DISK:FILE
commands. FlexDCA no longer permits arbitrary file types, arbitrary folder access, or reading and writing to network share drives. The following "Valid File Types" and "Standard FlexDCA Directories" tables identify the type of files and location that you can read or write using the :DISK:FILE
commands.
Sending a :DISK:FILE:READ
command that specifies a network share drive, a restricted directory, or with a restricted file name results in –258, Media protected.
error code.
You can use the :DISK:FILE:READ?
query for the files marked in the following table as format Binary.
Description | File Name Extension |
---|---|
Adapter definitions | xml |
Color-Grade Gray Scale (CGGS) waveform database for channel or CGGS Memory. | csv |
cgsx | |
Documentation Wizard file. | zip |
Eye Mode mask file. The preferred file name extension is .mskx. | mskx |
Graphics files. For example, images of screen. | bmp, gif, jpeg, jpg, png, tiff |
Instrument Report is an XPS (XML Paper Specification) file. XPS files can be viewed using Microsoft's XPS Viewer application. | xps |
Jitter database | jdx |
Jitter Spectrum Analysis (JSA) data | jsax |
License file to enable features for FlexDCA. | lic |
Limit line file | lltx |
Limit test summary file | sum |
Log files | log |
SCPI command file to run when FlexDCA's Multipurpose button is clicked. | scpi |
Presets files save settings for various FlexDCA features that can be re-imported to setup the feature. For example, for the TDECQ Reference Equalizer function's Reference Rx preset. | xml |
S-parameters Touchstone or Citifile (.cti, .cit) formatted files. For single-ended devices with one port, the preferred Touchstone file name extension is .s1p, but .txt can also be used. | s1p, s2p, s4p, s8p, s12p, s16p, cti, cit, ts, txt |
Instrument Setup file for saving and recalling the current overall state of FlexDCA. | setx |
TDR/TDT calibration file | tdrx |
TDR De-embedding networks | tf2, tf4 |
Waveform file (channels, Diff channels, waveform memories, etc.) | |
Waveform file (internal) | wfmx |
Waveform file (Y-values) | txt |
Waveform file (XY-values) | txt |
Pattern file | csv |
Pattern file (internal) | wfmx |
Waveform file (VSA format). VSA Waveform Recording files are ASCII files that you can import into Keysight's 89600 VSA and WLA software. Two file types include comma separated values (.csv) Tab separated values. VSA files are available to save when Pattern Lock and Acquire Entire Pattern are on. | csv |
txt | |
Pattern file from a BERT instrument which can be imported into FlexDCA. | ptrn |
Waveform file (Mask Limit Waveform). Reporting action for limit test. | |
Pattern waveform | .csv |
Pattern waveform (Internal) | .wfmx |
When using the :DISK:FILE
commands, files can only be read from or written to the directories that are listed in the following two tables. This includes any sub-directories that are in the listed directories. The first table lists FlexDCA's standard directories. The second table lists folders that are not typically used but are available for you to read and write to.
Drive/Directory | FlexDCA Installed On | ||
---|---|---|---|
N1000A | Windows PC | ||
Without OneDrive | With OneDrive | ||
C:\Users\user-name\Documents\Keysight\FlexDCA | ■ | ■ | |
C:\Users\user-name\Documents\Keysight | ■ | ||
C:\Users\user-name\OneDrive - Keysight Technologies\Documents\Keysight\FlexDCA | ■ | ||
D:\User Files | ■ |
Drive/Directory | FlexDCA Installed On | |
---|---|---|
N1000A | Windows PC | |
C:\Temp | ■ | ■ |
C:\Keysight | ■ | |
C:\ProgramData\Keysight\FlexDCA | ■ | ■ |
C:\Users\user-name\AppData\Local\Keysight\FlexDCA | ■ | ■ |
C:\Users\user-name\AppData\Local\Temp | ■ | ■ |
C:\Users\user-name\AppData\Local\Temp\Keysight\FlexDCA | ■ | ■ |
Requires FlexDCA revision A.05.30 and above. FlexDCA revision A.07.90 increases file I/O security.