Author Topic: Keysight file transfer format using SCPI commands and sample data  (Read 5171 times)

0 Members and 1 Guest are viewing this topic.

Offline prasimixTopic starter

  • Supporter
  • ****
  • Posts: 2034
  • Country: hr
    • EEZ
I'd like to know if anybody can provide me more information about Keysight's file transfer protocol/data format for exchanging data between instrument and controller application using SCPI commands such as:
  • MMEMory:DOWNload:DATA <binary_block>,
  • MMEMory:UPLoad? <filename>, or
  • MMEMory:TRANsfer <fileName>,<dataBlock>
What I found so far is minimal and comes from publicly available programming manuals where for example MMEM:TRAN data format is presented with simple example:
Quote
Example:
#210ABCDE+WXYZ<nl><end>
Where:
# - always sent before definite block data
2 - specifies that the byte count is two digits (2)
10 - specifies the number of data bytes that will follow, not counting <NL><END>
ABCDE+WXYZ - 10 digits of data
<NL><END> - always sent at the end of block data

There is a note that file must be no larger than 20MB. It is possible that data exchange of e.g. 10MB is one 10MB long string? Or it is sliced to many chunks? If yes, how long they are?
In other case, MMEM:DOWN:DATA include this example:

Quote
The following example writes the word "Hello" to the file "\Myfile" on the internal flash file system.
MMEM:DOWN:FNAM "INT:\Myfile"
MMEM:DOWN:DATA #15Hello

Also any sample data is more then welcome. Thanks in advance.

Offline lundmar

  • Frequent Contributor
  • **
  • Posts: 441
  • Country: dk
Re: Keysight file transfer format using SCPI commands and sample data
« Reply #1 on: October 10, 2017, 03:54:33 pm »
I don't know the particular instrument. However, I would bet that it just transports the data as one big block assuming your are using the VXI protocol or raw TCP SCPI to communicate your SCPI commands. Either way TCP will take care to break down and reassemble the data block so you don't have to worry about that. The 20 MB limit is likely dictated by buffer limits of the instrument and how they have implementd file handling. Also, it's not a string block, its a data block so you can write any binary data you need.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 
The following users thanked this post: prasimix

Offline lundmar

  • Frequent Contributor
  • **
  • Posts: 441
  • Country: dk
Re: Keysight file transfer format using SCPI commands and sample data
« Reply #2 on: October 10, 2017, 04:08:39 pm »
Btw, if you are running on a GNU/Linux system then you might find this useful: http://lxi.github.io
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline prasimixTopic starter

  • Supporter
  • ****
  • Posts: 2034
  • Country: hr
    • EEZ
Re: Keysight file transfer format using SCPI commands and sample data
« Reply #3 on: October 10, 2017, 04:22:33 pm »
Btw, if you are running on a GNU/Linux system then you might find this useful: http://lxi.github.io

Final application will be cross-platform (i.e. at least Linux, Mac, and Windows) but yes, I'm on Linux (my colleague that is software developer use Windows as primary OS), so your suggestion is relevant. Idea is to provide communication via serial and telnet first, and then using VXI-11 and LXI.

It would be nice if someone could also provide some sample data that generate any Keysight instrument that has e.g. SENSe:ELOG commands, like N6700 PSU (huh, I know, that is a real beast, not easily find on a DIYer's bench, but who knows who else is on this forum :).



Offline JonM

  • Supporter
  • ****
  • Posts: 158
  • Country: us
Re: Keysight file transfer format using SCPI commands and sample data
« Reply #4 on: October 11, 2017, 02:59:55 am »
I have some small tools (in Perl and R, but the SCPI could be easily translated) to download data from scopes. They were developed with my Keysight DSOX3024T. A friend did some testing on a Rigol scope but there was an issue with the scale factor and I have not investigated further.

https://github.com/meekj/oscilloscopeTools

 
The following users thanked this post: prasimix

Offline ollopa

  • Regular Contributor
  • *
  • Posts: 125
  • Country: 00
Re: Keysight file transfer format using SCPI commands and sample data
« Reply #5 on: October 11, 2017, 08:13:58 am »
It's just a standard block transfer.  The first digit after the # symbol is the number of digits to parse as the data length, then comes the data length, then comes the data, and theN a scpi eom which is a newline.  #15 means length of length = 1, length of data = 5.  You can see that the lArgent possible file is 999999999 bytes: #9999999999.  Internal buffers typically limit this to a smaller value.   You can chunk it up however you want as it will just keep concatenating data until length is achieved.
 
The following users thanked this post: prasimix


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf