5.10. MMEMory

5.10. MMEMory

The MMEMory commands are used to store, read or delete file in the PSU’s SD card. It can also query SD card information. In addition it is used for storing and recalling values used by [SOURce[<n>]]:LIST subsystem. File and directory (folder) names cannot contain the following characters:\ / : * ? " < > |

 

SCPI command

Description

MMEMory

 

:CATalog [<directory>]

Returns a list of items in the specified directory (folder)

:LENgth [<directory>]

Returns the number of items in the specified directory

:CDIRectory {<directory>}

Changes the current directory

:COPY {<source>}, {<destination>}

Copies <source> to <destination>

:DATE? {<filename>}

Returns date that the specified file was last saved

:DELete {<filename>}

Deletes an existing file

:DOWNload

 

:ABORt

Aborts current download session

:DATA {<block>}

Downloads data from the host computer

:FNAMe {<filename>}

Creates or opens the specified filename for download data

:SIZE {<filesize>}

Sets information about file size used for progress bar

:INFOrmation?

Returns used and free space

:LOAD

 

:LIST<n> {<filename>}

Loads stored LIST to the specified channel

:PROFile {<filename>}

Loads stored user profile

:LOCK {<password>}

Sets write protection

:MDIRectory {<directory>}

Makes a new directory

:MOVE {<source>}, {<destination>}

Moves or renames <source> to <destination>

:RDIRectory {<directory>}

Removes the specified directory

:STORe

 

:LIST<n> {<filename>}

Saves specified channel LIST

:PROFile {<filename>}

Saves specified user profile

:TIME? {<filename>}

Returns time that the specified file was last saved

:UNLock {<password>}

Clears write protection

:UPLoad? {<filename>}

Uploads data to the host computer

5.10.1. MMEMory:CATalog

Syntax

MMEMory:CATalog? [<directory>]

Description

Returns the list of files and directories (folders) names, types and sizes in the current or specified directory. Number of items (files/directories) corresponds to the value returned by the MMEMory:CATalog:LENgth? command.

 

To read out the information in the root directory (folder), specify "\" (backslash) or "/". If <directory> is not set, this function is applied to the current directory. If directory=<path>, this function is applied to <current directory>\<path>.

 

Error occurs if the specified directory does not exist.

Parameters

Name

Type

Range

Default

<directory>

Quoted string

Directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Return

Returns all files in the directory as list of comma delimited quoted strings of <filename>, <filetype> and <filesize>. The following file types are supported:

  • BIN – binary data
  • CSV – textual data (comma separated)
  • FOLD – directory (folder)
  • LIST – LIST program data
  • LOG – trace (display) or logged data (file extension .log)
  • PROF – user profile data (file extension .profile)
  • STAT – instrument (setting) state or user profiles (file extension .conf)

Usage example

MMEM:CAT?

"USER,FOLD,0","SCPI.PDF,BIN,1274844","SCH5B13A.PDF,BIN,296589",
"Documents,FOLD,0","Lists,FOLD,0","Videos,FOLD,0",
"profile0.profile,PROF,264"

 

MMEM:CAT? "USER"

"LST_2_3.CSV,BIN,88","FERY2.PDF,BIN,2443"

Errors

-250,"Mass storage error"

-251,"Missing mass storage"

-252,"Missing media"

-256,"File name not found"

Related Commands

MMEMory:CATalog:LENgth?

MMEMory:INFOrmation?

MMEMory:DATE?

MMEMory:TIME?

5.10.2. MMEMory:CATalog:LENgth

Syntax

MMEMory:CATalog:LENgth? [<directory>]

Description

This command returns the number of items in the current or specified directory (folder). The result corresponds to the number of files returned by the MMEMory:CATalog? command.

Parameters

Name

Type

Range

Default

<directory>

Quoted string

Directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Return

The query command returns number (NR1) of items (files and directories).

Usage example

MMEM:CAT:LEN? "USER"

2

Errors

-256,"File name not found"

Related Commands

MMEMory:CATalog?

5.10.3. MMEMory:CDIRectory

Syntax

MMEMory:CDIRectory {<directory>}

MMEMory:CDIRectory?

Description

Changes the current directory to the specified directory (folder). This directory must exist otherwise an error will be generated.

 

At *RST, this value is set to the root path.

Parameters

Name

Type

Range

Default

<directory>

Quoted string

Directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Return

This query returns the full path of the current directory.

Usage example

MMEM:CDIR "TEST/Test folder2"

MMEM:CDIR?

"TEST/Test folder2"

Errors

-256,"File name not found"

Related Commands

*RST

MMEMory:CATalog?

MMEMory:MDIRectory

MMEMory:RDIRectory

5.10.4. MMEMory:COPY

Syntax

MMEMory:COPY {<source>}, {<destination>}

Description

Makes a copy of an existing file in the current directory. The file names must include any file extension.

If <destination> is a file name, the copy file is created in the current directory. When <destination> is a <path> (e.g. “test lists/test022”) the source file is duplicated in <current directory>/<path>.

Parameters

Name

Type

Range

Default

<source>

Quoted string

Source file name, 1 to 255 characters

<destination>

Quoted string

Copy file name or directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:COPY "test.bin", "new2/test_new.bin"

Errors

-253,"Corrupt media"

-254,"Media full"

-256,"File name not found"

-258,"Media protected"

Related Commands

MMEMory:CATalog?

MMEMory:CDIRectory

MMEMory:LOCK

MMEMory:MDIRectory

MMEMory:MOVE

5.10.5. MMEMory:DATE

Syntax

MMEMory:DATE? {<filename>}

Description

Returns the (year, month, day) that the specified file was last saved.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name or directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Return

Comma-separated numbers (NR1) of year, month, day formated as yyyy, mm, dd

Usage example

MMEM:DATE? "test.002"

2017, 10, 1

Errors

-256,"File name not found"

Related Commands

MMEMory:TIME

5.10.6. MMEMory:DELete

Syntax

MMEMory:DELete {<filename>}

Description

Use this command to delete a file in the current directory. If SD card is locked using the MMEMory:LOCK command, an error -258 will be generated.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:DEL "test.002"

Errors

-256,"File name not found"

-258,"Media protected"

Related Commands

MMEMory:CATalog?

MMEMory:CDIRectory

MMEMory:RDIRectory

MMEMory:LOCK

5.10.7. MMEMory:DOWNload:ABORt

Syntax

MMEMory:DOWNload:ABORt

Description

Use this command to abort currenlty running file transfer from the host initiated with the MMEMory:DOWNload:DATA command. If not active file transfer exists, the PSU will ignore this command without generating any error.

Usage example

MMEM:ABOR

Related Commands

MMEMory:DOWNload:DATA

5.10.8. MMEMory:DOWNload:DATA

Syntax

MMEMory:DOWNload:DATA {<block>}

Description

Downloads data from the host computer to a file in the SD card. This is a multiple steps process:

  • The filename must have been previously specified by MMEMory:DOWNload:FNAMe.
  • The data can be transferred in single or more blocks. Receiving of first block will erase all previously stored, and each consecutive block will be appended to the end
  • Download is finished when MMEMory:DOWNload:FNAMe with empty name was sent

Use MMEMory:INFOrmation? command first to check available space.

Parameters

Name

Type

Range

Default

<block>

Data block

Usage example

Downloads text Hello world and store into the file "test file" in the current directory. Digit 2 denotes two digits of data length (11).

MMEM:DOWN:FNAM "test file"

MMEM:DOWN:DATA #211Hello world

MMEM:DOWN:FNAM ""

Errors

-253,"Corrupt media"

-254,"Media full"

-258,"Media protected"

Related Commands

MMEMory:DOWNload:FNAMe

MMEMory:INFOrmation?

MMEMory:LOCK

5.10.9. MMEMory:DOWNload:FNAMe

Syntax

MMEMory:DOWNload:FNAMe {<filename>}

Description

Creates or opens the specified filename prior to writing data to that file with MMEMory:DOWNload:DATA.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEMory:DOWNload:FNAMe "new_list.bin"

Errors

-258,"Media protected"

Related Commands

MMEMory:DOWNload:DATA

5.10.10. MMEMory:DOWNload:SIZE

Syntax

MMEMory:DOWNload:SIZE {<filesize>}

Description

This command define filesize used by progress bar displayed on the local console during the file transfer. If filesize is not provided, progress bar will not be displayed.

Parameters

Name

Type

Range

Default

<filesize>

NR1

0 to 2.147.483.648 (2 GiB) as limited by SD Card FAT

0

Usage example

MMEMory:DOWNload:SIZE 124000

Related Commands

MMEMory:DOWNload:DATA

MMEMory:DOWNload:FNAMe

5.10.11. MMEMory:INFOrmation

Syntax

MMEMory:INFOrmation?

Description

Use this command to find out total amount of storage currently used and storage available on the SD card. The sum of that two amounts represents SD card capacity in bytes.

Return

The command returns used space and free space as two comma separated integers.

Usage example

MMEM:INFO?

3932160,7732461568

Related Commands

MMEMory:DOWNload:DATA

5.10.12. MMEMory:LOAD:LIST

Syntax

MMEMory:LOAD:LIST<n> {<filename>}

Description

Load stored LIST program from SD card location defined by <filename> to the channel defined with <n>.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:LOAD:LIST1 "DC_DC conv testing.list"

MMEM:LOAD:LIST2 "DC_DC conv testing.list"

TRIG:SOUR BUS

INIT

*TRG

Errors

-200,"Execution error"

-256,"File name not found"

Related Commands

MMEMory:STORe:LIST[<n>]

[SOURce[<n>]]:LIST:COUNt

[SOURce[<n>]]:LIST:CURRent[:LEVel]

[SOURce[<n>]]:LIST:DWELl

[SOURce[<n>]]:LIST:VOLTage[:LEVel]

5.10.13. MMEMory:LOAD:PROFile

Syntax

MMEMory:LOAD:PROFile {<filename>}

Description

This command loads data from user profile file to the user profile 0.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:LOAD:PROF "old settings.profile"

Errors

-256,"File name not found"

Related Commands

*RCL

*SAV

MEMory:STATe:RECall:AUTO

MMEMory:STORe:PROFile

5.10.14. MMEMory:LOCK

Syntax

MMEMory:LOCK {<password>}

MMEMory:LOCK?

Description

Use this command to enable write protection of SD card. All writing, deleting or modifying attempts on files or directories will generate an error if SD card is locked.

Parameters

Name

Type

Range

Default

<password>

Quoted string

System password (4 to 16 characters)

Return

This query returns 0 if SD card is unlocked, or 1 if SD card is locked.

Usage example

MMEM:LOCK "test123"

MMEM:LOCK?

1

Errors

122,"Invalid sys password"

Related Commands

MMEMory:UNLock

SYSTem:PASSword:NEW

5.10.15. MMEMory:MDIRectory

Syntax

MMEMory:MDIRectory {<directory>}

Description

This command creates a new directory. If directory=<path>, this command creates a <current directory>/<path> directory.

Parameters

Name

Type

Range

Default

<directory>

Quoted string

Directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:MDIR "test folder"

Errors

-258,"Media protected"

Related Commands

MMEMory:CDIRectory

MMEMory:RDIRectory

5.10.16. MMEMory:MOVE

Syntax

MMEMory:MOVE {<source>}, {<destination>}

Description

This command moves or renames an existing file. If destination is a file name, the source file is renamed to the new file name in the current directory. When destination=<path>, the source file is moved to <current directory>/<path>.

 

Error occurs if the source file does not exist or the destination file already exists.

Parameters

Name

Type

Range

Default

<source>

Quoted string

Source file name, 1 to 255 characters

<destination>

Quoted string

New file name or directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

Rename file:

MMEM:MOVE "old name","new name"

Move file from current directory to “/Test” directory:

MMEM:MOVE "new name","/Test/new name"

Move and rename file:

MMEM:MOVE "/Test/new name","/Documents/new doc"

Errors

-256,"File name not found"

-258,"Media protected"

Related Commands

MMEMory:CDIRectory

MMEMory:COPY

5.10.17. MMEMory:RDIRectory

Syntax

MMEMory:RDIRectory {<directory>}

Description

Removes the specified empty directory.

Parameters

Name

Type

Range

Default

<directory>

Quoted string

Directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:CDIR?

"Test folder2"

MMEM:CAT:LEN?

0

MMEM:RDIR "Test folder2"

Errors

-250,"Mass storage error"

-258,"Media protected"

Related Commands

MMEMory:CATalog?

MMEMory:CDIRectory

MMEMory:MDIRectory

5.10.18. MMEMory:STORe:LIST

Syntax

MMEMory:STORe:LIST<n> {<filename>}

Description

Store LIST program of channel defined with <n> to SD card location defined by <filename>. Stored file type will be TRAC. Default file extension is .list

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:STOR:LIST1 "DC_DC conv testing.list"

Errors

-258,"Media protected"

Related Commands

MMEMory:LOAD:STATe

[SOURce[<n>]]:LIST:COUNt

[SOURce[<n>]]:LIST:CURRent[:LEVel]

[SOURce[<n>]]:LIST:DWELl

[SOURce[<n>]]:LIST:VOLTage[:LEVel]

5.10.19. MMEMory:STORe:PROFile

Syntax

MMEMory:STORe:PROFile {<filename>}

Description

This command stores the PSU state (i.e. user profile 0) to SD card location defined by <filename>. Stored file type will be STAT. Default file extension is .conf

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Usage example

MMEM:STOR:PROF "Both channels 5V_3A.profile"

Errors

-258,"Media protected"

Related Commands

*RCL

*SAV

MEMory:STATe:RECall:AUTO

MMEMory:LOAD:PROFile

5.10.20. MMEMory:TIME

Syntax

MMEMory:TIME? {<filename>}

Description

Returns the (hours, minute, seconds) that the specified file was last saved.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name or directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Return

Comma-separated numbers (NR1) of hours, minute, seconds formatted as hh, mm, ss

Usage example

MMEM:TIME? "test.002"

22, 10, 14

Errors

-256,"File name not found"

Related Commands

MMEMory:DATE

5.10.21. MMEMory:UNLock

Syntax

MMEMory:UNLock {<password>}

Description

Disable write protection of SD card activated by the MMEMory:LOCK command.

Parameters

Name

Type

Range

Default

<password>

Quoted string

System password (4 to 16 characters)

Usage example

MMEM:LOCK?

1

MMEM:UNL "test123"

MMEM:LOCK?

0

Errors

122,"Invalid sys password"

Related Commands

MMEMory:LOCK

SYSTem:PASSword:NEW

5.10.22. MMEMory:UPLoad

Syntax

MMEMory:UPLoad? {<filename>}

Description

This command uploads the contents of a file from the instrument to the host computer.

The format for <file> is "[<path>]<file_name>", where <path> must be an absolute folder path. If <path> is omitted, the folder specified by the MMEMory:CDIRectory command is used. Absolute paths begin with a "\" or "/" and start at the root folder of SD card.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

File name or directory name, either / (slash) or \ (backslash) can be used as the path separator. 1 to 255 characters

Return

The query returns the file contents are returned as an IEEE 488.2 definite-length block.

Usage example

MMEM:UPL? "test file"

#211Hello world

Errors

-257,"File name error"

Related Commands

MMEMory:DOWNload:DATA