Download Print this page

Fluke 225C Programming Reference Manual page 58

Remote control and programming reference
Hide thumbs Also See for 225C:

Advertisement

PRINT #1, "PC 1200"
GOSUB Acknowledge
CLOSE #1
PRINT "Print data copied to file 'SCREEN.PNG'."
PRINT "You can use a browser program or a graphics editor"
PRINT "to view this file."
END
'****************** ReadBlock subroutine *********************
'This subroutine reads one block of data from the RS232 port.
'The actual data bytes received (i.e., excluding the block
'header, checksum and acknowledge bytes) are stored in the
'string BlockData$.
'LastBlock% indicates whether the received block is the last
'one (1) or not (0).
ReadBlock:
PRINT #1, "0"
GOSUB Acknowledge
BlockHeader$ = INPUT$(5, #1)
IF LEFT$(BlockHeader$, 2) <> "#0" THEN
PRINT "Block transfer protocol error."
CLOSE
PRINT "Program aborted."
END
END IF
IF (ASC(MID$(BlockHeader$, 3, 1)) AND 128) = 128 THEN
LastBlock% = 1
ELSE
LastBlock% = 0
END IF
BlockLenHigh% = ASC(MID$(BlockHeader$, 4, 1))
BlockLenLow% = ASC(MID$(BlockHeader$, 5, 1))
BlockLength& = (256 * BlockLenHigh%) + BlockLenLow%
BlockData$ = INPUT$(BlockLength&, #1)
CheckSum$ = INPUT$(2, #1) 'Read the checksum
ReceivedCheckSum% = ASC(LEFT$(CheckSum$, 1))
CalculatedCheckSum% = 0
FOR I& = 1 TO BlockLength&
Byte% = ASC(MID$(BlockData$, I&, 1))
CalculatedCheckSum% = CalculatedCheckSum% + Byte%
CalculatedCheckSum% = CalculatedCheckSum% MOD 256
NEXT I&
IF CalculatedCheckSum% <> ReceivedCheckSum% THEN
PRINT "Checksum error"
PRINT #1, "2"
'Programs ScopeMeter back to the
'default baud rate.
'Input acknowledge from ScopeMeter.
'Request the next data block.
'Input acknowledge from ScopeMeter.
'Read the block header.
'Close all files.
'This is the last block.
'Terminate (abort) QP command.
'(We could send "1" instead to request
'Read the block data.

Advertisement

loading

This manual is also suitable for:

Scopemeter 190 series