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
- Replies:
- Re: [Scopes] BMP image record?? Pavel Masloff
- References:
- [Scopes] BMP image record?? Pavel Masloff
- Navigate by Date:
- Prev:
Re: [Scopes] BMP image record?? Pavel Masloff
- Next:
labCa build fails on 64 bit Windows james.rowland
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: [Scopes] BMP image record?? Chen, Xihui
- Next:
Re: [Scopes] BMP image record?? Pavel Masloff
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|