On Thu, May 3, 2012 at 1:13 PM, Dirk Zimoch
<[email protected]> wrote:
Hello Pavel,
Use a CHAR or UCHAR waveform with NELM large enough for the file, empty InTerminator, %1r converter.
Maybe MaxInput=<size of file> to avoid using timeout as a terminator. The file you sent me has 14940 bytes. Is this always the case?
record (waveform, "$(PICTURE)") {
field (FTVL, "UCHAR")
field (NELM, "14940")
field (DTYP, "stream")
field (INP, "@protocolfile get_picture asynport")
}
Terminator="\n";
get_picture {
InTerminator=""; # we receive binary data
MaxInput=14940; # number of bytes to read
out ":HARDCOPY:FORMAT PNG;PALETTE NORMAL;PORT RS232;"
"LAYOUT PORTRAIT;PREVIEW 0;INKSAVER 0;COMPRESSION 0";
out "HARDCOPY START";
in "%1r"; # read all bytes into waveform
}
This will put the fill file into the waveform. To display the waveform is a completely different issue.
You can as well cut of header information:
...
in "%*36r"; # skip 36 bytes
in "%1r"; # read remaining bytes into waveform
I found a 1 at byte 30 of your file. According to Wikipedia, that means that the image is compressed. Even though the setting was "COMPRESSION 0". Maybe the file and the settings above do not match.
With compression things are more difficult because the size varies. In that case make NELM large enough for the largest possible image and do not use MaxInput. Play with ReadTimeout to get minimal delay but without losing data. The file size is encoded in the header, but at the moment, StreamDevice cannot use this information to change the number of bytes read dynamically.
Dirk
Pavel Masloff wrote:
Hello again,
As I mentioned earlier we are running a series of experiments with our high current switches. I have written simple support ("...with a little help from my friend" Dirk Zimoch) for the Tektronix TPS2000 over RS232 using StreamDevice and ASYN, so now I can remotely arm the scopes, set its properties, save waveforms on to the CF card, etc. But...
In order to not run back and forth and see if everything went OK (which is rather tiresome and time consuming), we need a confirmation from the scopes. I don't want to deal with the implementation of the waveform records for now, all I have got so far is that I save them on the flash card.
As such a confirmation I see transferring the BMP (or PNG) image from the scope (sort of Print screen) on to the operator PC somehow.
There is a special SCPI command "Hardcopy start". Which mimics the Print button on the scope's front panel. I have tried to transfer a BMP file via Hyperterminal (and Python script) and it worked out well (more or less).
How could this be ported to the EPICS database from the IOC and client standpoint, so an operator could see the oscillogram on the screen and decide whether the experiment went well, so she will save the waveforms and move on to the next experiment?
The image file is maximum ~ 46Kb (20Kb on average).
Any thoughts?
--
Best regards,
Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia
Mobile: +7 (951) 672 22 19
Landline: +7 (812) 461 01 01