REMOTE CONTROL AND PROGRAMMING REFERENCE for all FLUKE 190 family of ScopeMeter® test tools © Fluke Corporation 1996, 2012
Revision 1a – December 2012 Copyright © 1996, 2012 Fluke Corporation or its subsidiaries. Productnames and brandnames which appear in this document may be trademarks or registered trademarks of their respective owners.
TABLE OF CONTENTS Table of Contents ................................................................................................................................................. 3 Introduction.......................................................................................................................................................... 5 INTRODUCTION TO PROGRAMMING ...................................................................................................................
Remote Control and Programming Reference for the FLUKE 190 family of ScopeMeter® test tools page 4
INTRODUCTION When using ScopeMeter® testtools, the desire to store any measurement results on the PC, for reference purposes or for documenting the tests made is rather obvious. For that purpose, Fluke offers a dedicated software package: FlukeView ScopeMeter for Windows (or ‘SW90W’).
Remote Control and Programming Reference for the FLUKE 190 family of ScopeMeter® test tools page 6
INTRODUCTION TO PROGRAMMING Basic Programming Information Before trying to remotely control any ScopeMeter tetstool, a communication link needs to be established between PC and ScopeMeter. Next, the software interface needs to be established. Refer to Appendix B and C for details. Once you have installed the interface and drivers, you can control the ScopeMeter® from the computer with simple communication facilities, such as GWBASIC, QuickBASIC or QBASIC, programming languages from Microsoft® Corporation.
Some commands require several parameters. Example: WT 9,50,30 This is the Write Time command. This command requires three parameters. The parameters are separated by a comma, which is called the Program Data Separator. You may use only one comma between the parameters. Also refer to the section ‘Data Separators’. A code at the end of each command tells the ScopeMeter that the command is ended. This is the carriage return code (ASCII 13) and is called the Program Message Terminator.
Notes: 1. You MUST ALWAYS input (that is: make the PC accept this acknowledgement), even when the original command was not a query. 2. Throughout this manual, the may be written in full (as was just done), or as . Data Separators Data Separators are used between parameters sent to the ScopeMeter and between values and strings received from the ScopeMeter.
If the response value is zero, go to step 4. If the response value is not zero, the ScopeMeter didn’t execute the previous command. Read the error message from the following acknowledge subroutine, recover the error, and repeat the command or query (this is not shown in the following program example.) 4. If a query was sent to the ScopeMeter, read the response. 5. The sequence of steps 2, 3, and 4 may be repeated for different commands or queries. 6. Close the communication channel.
COMMAND REFERENCE Conventions Page layout used for each command XY Header Each command description starts with a header for quickly finding the command. This header includes the two-character command indicator (i.c. ‘XY’) used for the command syntax, and includes the full command name (i.c. ‘HEADER’). Note: for the sake of this example, the command indicator differs from the command name, where usually one is an abbreviation of the other. Purpose: Explains what the command does or what it is used for.
Syntax conventions The Command Syntax and the Response Syntax may contain the following meta symbols and data elements: UPPERCASE These characters are part of the syntax. For commands, lower case is also allowed. <...> An expression between these brackets is a code, such as (carriage return) that can not be expressed in a printable character, or it is a parameter that is further specified. Do not actually include these brackets in the command! [...] The item between these brackets is optional.
AS AUTO SETUP Purpose: Command Syntax: Response Syntax: Notes: Switches on the AUTO-ranging mode of the ScopeMeter, which will allow it to automatically adept the actual instrument settings to the input signals applied. AS • You may select elements of the setup not to modified by the AUTO SET procedure, by going through the USER OPTIONS menu of the ScopeMeter. • The instrument will send the as soon as the Autoranging mode has been activated.
AT ARM TRIGGER Purpose: Command Syntax: Response Syntax: Notes: Resets and arms the trigger system for a new acquisition. This command can also be used for single shot acquisitions. When the AT command is given while an acquisition is in progress, this acquisition is aborted and the trigger system is rearmed. The command can also be used to go from other mdoes (e.g. from Replay mode) to ‘live’ acquisition mode.
‘***************** Beginning of example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" FOR RANDOM AS #1 PRINT #1, "AT" ‘Sends the ARM TRIGGER command. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. CLOSE #1 END ‘******************* Acknowledge subroutine ********************* ‘Use this subroutine after each command or query sent to the ‘ScopeMeter. This routine inputs the acknowledge response from ‘the ScopeMeter.
CM CLEAR MEMORY Purpose: Command Syntax: Response Syntax: Note: Example: Clears all saved setups, waveforms, and screens from internal memory. CM Reciving the confirms that the action has been completed. Depending on memory size of the instrument at hand, this may take several seconds. See below ‘***************** Beginning of example program ***************** OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1,”CM” ‘Sends the Clear Memory command.
DS DEFAULT SETUP Purpose: Command Syntax: Response Syntax: Notes: Resets the ScopeMeter to the factory-default settings, just like these were at the moment of original delivery, except for the RS232 communication settings such as baud rate (so as to keep the communications alive). DS • Wait for at least 2 seconds after the reply has been received, so as to let the ScopeMeter settle itself, before you send the next command.
GD GET DOWN Purpose: Command Syntax: Response Syntax: Notes: Switches off the instrument’s power system. GD • If external power (mains adapter) is supplied, you can use the SO command to switch the instrument on again. • If no external power is connected, the instrument can only be switched on manually by pressing the ON/OFF key.
GL GO TO LOCAL Purpose: Command Syntax: Response Syntax: Note: Example: GR Switches on the ‘local operation mode’, this is: enable the keypad for local (manual) control. GL Also refer to the GR (Go to Remote) command. The following example (see next page) uses the GR (GO TO REMOTE) command to set the ScopeMeter in the REMOTE state so that the keypad is disabled.
‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen. OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “GR” ‘Sends GO TO REMOTE command. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. PRINT “All ScopeMeter keys (except the Power ON/OFF key) PRINT “are now disabled by the GR (GO TO REMOTE) command.” PRINT “Check this.” PRINT PRINT “Press any key on the PC keyboard to continue.” SLEEP PRINT PRINT #1, “GL” ‘Sends GO TO LOCAL command.
HO HOLD Purpose: Command Syntax: Response Syntax: Example: Sets the ScopeMeter in the Hold mode. In more detail: the ScopeMeter stops sampling the input channels and stops calculating new measurement results. Bringing the instrument to Hold-mode makes it ‘freeze’ the display.
ID IDENTIFICATION Purpose: Command Syntax: Response Syntax: Makes the ScopeMeter send its model identification data to the PC. ID [] where, is an ASCII string containing the following data elements: ;;; Example: The following example program queries the identity data of the ScopeMeter and displays this data on the PC screen.
IS INSTRUMENT STATUS Purpose: Command Syntax: Note: Response Syntax: Queries the contents of the ScopeMeter’s status register. The returned value reflects the present operational status of the testtool itself (see note). Status is indicated by a 16-bit word, presented as an integer value, where each bit signals the logical status of an individual parameter (so: represented as 1 or 0). See table below for details.
‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “IS” ‘Sends the INSTRUMENT STATUS query GOSUB Acknowledge ‘Input acknowledge from ScopeMeter INPUT #1, Status$ ‘Input Instrument Status StV = VAL(Status$) ‘Decimal value of Instrument Status PRINT “Instrument Status : “; StV IF (StV AND 1) = 1 THEN PRINT “ ScopeMeter in Maintenance mode.” IF (StV AND 2) = 2 THEN PRINT “ ScopeMeter charging.
PC PROGRAM COMMUNICATIONS Purpose: Command Syntax: (not used in 190-series-II) Programs the baud rate for RS232 communications (not used with 190-series-II). PC where, = 1200 | 2400 | 4800 | 9600 | 19200 38400 (Fluke 19xC) 57600 (Fluke 19xC, PM9080/101 or OC4USB required) The default baudrate is 1200 . This is set at power-on or after an RI (Reset Instrument) command. Notes: • The Fluke 19x/19xC instruments support 1 stopbit, 8 databits and software handshake (a.k.a.
PS PROGRAM SETUP Purpose: Restores a complete setup, as previously saved internally using the SS (Save Setup) command and queried by the PC using the QS (Query Setup) command, then saved in a string variable or as a file.
‘***************** Beginning of example program ***************** OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 CLS ‘Clears the PC screen GOSUB ClearPort ‘Clears pending data from port. PRINT #1, “QS” ‘Queries the actual setup data. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. GOSUB Response ‘Writes the setup data to file. PRINT “Present setup data is stored in the file SETUP0” PRINT “This setup will now be retrieved from the file and” PRINT “sent back to the ScopeMeter.
‘****************** Response subroutine ********************* ‘This subroutine reads bytes from the RS232 buffer as long ‘as they enter. When no bytes enter for 1 second, the program ‘assumes that the ScopeMeter has terminated its response. ‘All bytes that enter the buffer are appended to the string ‘Resp$.
QM QUERY MEASUREMENT Purpose: Command Syntax 1: Response Syntax 1: Queries the ScopeMeter testtool for the availability, validity and characteristics of the various automatic measurements (see Syntax 1) or for the actual results of automatic measurements (see Syntax 2). Readings or measurements must be active on screen in order to be available for transfer to a remote PC.
Note: The Syntax 1 command enables the programmer to once ask for the availability, validity and type of measurements that are available given the actual set-up of the instrument. Once this information is known, the use of the command as per Syntax 2 allows for the specific results of individual measurement(s) more rapidly. Those results are then sent as numbers, without any context or unit-of-measure.
presentation value of the reading: 0 Absolute value 1 Relative value 2 Logarithmic value 3 Linear value 4 Fahrenheit 5 Celsius resolution of the reading as to determine the least significant digit Command Syntax 2: QM {,} where is as per the table above (carefully select the table for 190, 190B and 190C series, or the table for 190-series-II).
‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen. OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “QM” ‘Queries for active readings GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. ‘*** Examines only the 7 inputs of the first reading 11. INPUT #1, reading.no ‘1st IF reading.no = 11 THEN PRINT “Measurement reading 1”; ELSEIF reading.
GOSUB ClearReadings PRINT #1, “QM 11” ‘Clears rest of readings data from port ‘Queries Measurement reading 1 or ‘Meter absolute reading (Meter mode). ‘Input acknowledge from ScopeMeter. GOSUB Acknowledge INPUT #1, result PRINT “Measurement value =”; result; “V” CLOSE #1 END ‘******************* Acknowledge subroutine ********************* ‘Use this subroutine after each command or query sent to the ‘ScopeMeter. This routine inputs the acknowledge response from ‘the ScopeMeter.
QP QUERY PRINT Purpose: Command Syntax: Queries a screen dump of the ScopeMeter in a selected printer format. This allows you to make a copy of the ScopeMeter screen on paper or as an image file held on the PC. Image aspect ratios: 1 : 1 = width x height = 240 x 240 (as was the screen of e.g. the 190) 4 : 3 = width x height = 320 x 240 (as is, e.g.
during input from the ScopeMeter. The communication speed (baud rate) is set to 19200 and after the data transfer it is reset to 1200 (default baud rate). ‘***************** Beginning of example program ***************** CLS OPEN “COM1:1200,N,8,1,CS,DS,RB7500” FOR RANDOM AS #1 ‘Programs COM1 port parameters to ‘match the ScopeMeter power-on default ‘values. PRINT #1, “PC 19200” ‘Programs ScopeMeter to the maximum ‘baud rate. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter.
‘****************** Response subroutine ********************* ‘This subroutine reads bytes from the RS232 buffer as long ‘as they enter. When no bytes enter for 1 second, the program ‘assumes that the ScopeMeter has terminated its response. ‘All bytes that enter the buffer are appended to the string ‘Resp$.
0 Continue: Requests the next segment. 1 Retransmit: Requests retransmission of the just transferred segment. 2 Terminate: Aborts block transfer for this QP command. The PNG format is specified in: “PNG (Portable Network Graphics) Specification, Version 1.2”, by G. Randers-Pehrson et al. (PNG Development Group), July 1999; This document is available from www.libpng.org/pub/png/. The PNG file consists of the following chunks: IDHR: Header chunk describing the image characteristics. PLTE: Palette chunk.
DO PRINT “Reading block “; BlockNumber% GOSUB ReadBlock ‘Read data into BlockData$ PRINT #2, BlockData$; BlockNumber% = BlockNumber% + 1 LOOP WHILE LastBlock% = 0 CLOSE #2 ‘ IF BytesToReceive& <> 0 THEN PRINT “Block transfer protocol error.” END IF PRINT #1, “PC 1200” ‘Programs ScopeMeter back to the ‘default baud rate. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. CLOSE #1 PRINT “Print data copied to file ‘SCREEN.PNG’.
BytesToReceive& = BytesToReceive& - BlockLength& RETURN ‘******************* Acknowledge subroutine ********************* ‘Use this subroutine after each command or query sent to the ‘ScopeMeter. This routine inputs the acknowledge response from ‘the ScopeMeter. If the response is non-zero, the previous ‘command was not correct or was not correctly received by ‘the ScopeMeter. Then an error message is displayed and ‘the program is aborted. Acknowledge: INPUT #1, ACK ‘Reads acknowledge from ScopeMeter.
QS QUERY SETUP Purpose: Command Syntax: Queries the ScopeMeter testtool for the present acquisition setup data. QS [] where, = 0 Response Syntax: : Actual setup [#0{}] where, = [] = Possible values: 20 hex All nodes except the last (end node) A0 hex End node = . Unique number for each specific node.
QW QUERY WAVEFORM Purpose: Command Syntax: Queries the trace data (administration and/or sample data) of a waveform from the ScopeMeter. When a waveform is queried that is still being processed (or ‘under construction’), that processing is completed before sending the waveform, so as to avoid incomplete traces from being returned.
If the optional parameter (V or S) is omitted: = , This includes the complete information about the trace (waveform). For detailed descriptions about the waveform structure, refer to Appendix F. If option V or v (value only) is given: = For detailed descriptions about the waveform structure, refer to Appendix F.
RD READ DATE Purpose: Command Syntax: Response Syntax: Reads the date setting of the real time clock in the testtool. RD [] where, = string of the following format: ,, e.g. 1999,8,14 Note: Example: Refer to RT (Read Time), WD (Write Date) and WT (Write Time) commands for associated functionality The following example program reads the date setting from the ScopeMeter.
RI RESET INSTRUMENT Purpose: Command Syntax: Response Syntax: Note: Resets the entire instrument, including the CPL interface. The CPL interface is forced into local and operational mode. Only the baudrate setting (for 190, 190B and 190C models) remains unchanged (note: given the USB-interface, the 190-series-II doesn’t support any baudrate setting).
‘************** Beginning of example program *************** CLS ‘Clears the PC screen. OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “RI” ‘Sends the RESET INSTRUMENT command. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. SLEEP 2 ‘Delay (2 s) necessary after reset. GOSUB ClearPort ‘Clears pending data from port. PRINT #1, “ID” ‘Sends IDENTIFICATION query. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. INPUT #1, IDENT$ ‘Inputs the queried data.
RP REPLAY Purpose: Command Syntax 1: Response Syntax 1: Queries the instrument for the total number of valid replay screens available (see Syntax 1), or to select and setup the Replay analysis mode and to select and bring on to the instrument’s screen a user-selected replay screen-image from memory (see Syntax 2).
‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen. OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “RP” ‘Queries for number of valid replay ‘screens + active screen number GOSUB Acknowledge ‘Input acknowledge from ScopeMeter. INPUT #1, nr.of.screens ‘1st IF (nr.of.screens < 0) OR (nr.of.screens > 100) THEN PRINT nr.of.screens; “ is not a valid number of replay screens” ELSE PRINT “Number of valid replay screens =”; nr.of.
RS RECALL SETUP Purpose: Command Syntax: Recalls an internally stored setup. This setup must have been stored in the ScopeMeter manually or with the SS (Save Setup) command. The effect of the RS command is that the instrument setup is recalled and the instrument forced into running mode (190, 190C), or is forced into HOLD state (190series-II) for further analysis of the waveform and measurements that were stored together with the set-up information/.
‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen. OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “SS 8” ‘Sends SAVE SETUP command. ‘Setup saved in setup memory 8. GOSUB Acknowledge ‘Input acknowledge from ScopeMeter PRINT “ The present setup data is stored in setup memory 8.” PRINT “ The remainder of this program will restore these.
RT READ TIME Purpose: Command Syntax: Response Syntax: Reads the real time clock time settings, in a 24-hours format. RT [
SO SWITCH ON Purpose: Command Syntax: Response Syntax: Notes: Switches the ScopeMeter on. SO • This commands requires that the testtool is being powered by the external power adapter (mains adapter). • A time of at least two seconds should be allowed after receiving the reply for the instrument to actually start up, before sending any more remote commands. Example: An example of this is seen with the command GD (GET DOWN).
SS SAVE SETUP Purpose: Command Syntax: Saves the present setup in one of the (battery-backup powered) instrument registers. SS where, = 1 to 15 1001 1002 : Screen/Setup memories. : Long Record/Replay memory 1 : Long Record/Replay memory 2 When is omitted, number 1 is assumed. Notes: • Some models store setup data and waveform- or recording-data together. Recalling the setup then also recalls the waveform information.
ST STATUS QUERY Purpose: Queries the error status of the ScopeMeter’s CPL interface. The reply is a 16-bit word, presented as an integer value, in which each bit represents the Boolean value of a related error event. After sending the reply to ‘ST’ or after receiving an RI (Reset Instrument) command, the status word is reset (i.c. set to zero). A complete description of the status word is given in Appendix E.
‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen. OPEN “COM1:1200,N,8,1,CS,DS,RB2048” FOR RANDOM AS #1 PRINT #1, “PC 12345” ‘Sends a baud rate value that is ‘out of range for the ScopeMeter. GOSUB Acknowledge.Status ‘Input acknowledge from ScopeMeter ‘and the status value if the ‘acknowledge value is non-zero. END ‘******************* Acknowledge subroutine ********************* ‘Use this subroutine after each command or query sent to the ‘ScopeMeter.
TA TRIGGER ACQUISITION Purpose: Command Syntax: Response Syntax: Example: The command will simulate a trigger, meaning it will initiate an acquisition (assuming the ScopeMeter was ready to be started). This command acts as a hardware trigger that starts a new acquisition. In SINGLE shot acquisition mode the trigger system must have been armed with the AT (Arm Trigger) command before the TA command can be used.
WD WRITE DATE Purpose: Command Syntax: Writes the real time clock date settings. WD where, = string of the following format: ,, e.g. 1999,9,21 Response Syntax: Note: Example: Refer to RD (Read Date), RT (Read Time) and WT (Write Time) commands for associated functionality The following example program writes a date into the the ScopeMeters realtime clock system. ‘***************** Beginning of example program ***************** CLS ‘Clears the PC screen.
WT WRITE TIME Purpose: Command Syntax: Writes the real time clock time settings. The 24-hours time format is adhered to. WT where, = string of the following format: ,, e.g. 15,30,0 Response Syntax: Note: Example: Refer to RD (Read Date), RT (Read Time) and WD (Write Date) commands for associated functionality The following example program writes a time into the the ScopeMeters realtime clock system..
Appendix A ASCII Codes Part 1 - ASCII codes 00 (00h) through 127 (7Fh).
Part 2 - ASCII codes 128 (80h) through 255 (FFh).
Appendix B Installing the interface cable and drivers Fluke 120-, Fluke 190-, Fluke 190B- and Fluke 190C-series all have an optical connector for communications with the PC. This connector can be used with either the PM9080 (optical to RS-232 adapter/cable) or with the OC4USB (optical to USB adapter/cable). The Fluke 190-series-II is itself equipped with a USB-connector for PC communications.
Appendix C Installing USB-drivers for 190-series-II Introduction The Fluke 190-series-II ScopeMeter testtool is equipped s with a USB interface (connector type: USB mini-B) for communications with a computer. In order for communications to be handled by this interface, also dedicated drivers need to be installed onto the computer. This Appendix describes how to install the drivers for the 190-series-II on a Windows XP computer.
In the following window click ‘Next’ to install the software automatically. Windows will then download the drivers from the Windows Driver Distribution Center on the internet automatically. If no connection to the internet is available, you may use the CD-ROM, supplied with the ScopeMeter, which also contains a version of these drivers. Follow the instructions on screen. When the driver has finished installation click ‘Finish’ to complete the first step of the driver installation.
To check if the drivers were loaded properly, connect the ScopeMeter 190-series-II testtool to your computer, using the USB-cable supplied and open the Device Manager (see the ‘Help’-file of your computer system in case you want to find out how to open the device manager for your particular version of Windows). From the device manager main menu, click on the ‘+’sign seen with the line on ‘Universal Serial Bus controllers’, to expand this group. The ‘Fluke 190 ScopeMeter’ should be listed in there.
Appendix D Acknowledge Data The ScopeMeter returns an reply after each command or query. Throughout this manual, this may be written in full or as . The value indicated with this acknowledgement, indicates either correct or incorrect operation. You must read this reply, in order to check for the correct operation and to achieve synchronization between your program and the RS232 interface of the ScopeMeter.
Appendix E Status Data The Status word returned from the ST query gives you additional information in case you have received a non-zero reply. The Status word is a 16-bit binary word in which each bit may be set true or false. ‘True’ represents an error event with a decimal value determined by the bit position (see the table below). In case more than one bit in the status word is set true, the response from the ST query will be the sum of the decimal values of the individual bits.
Appendix F Waveform Data The waveform data that is received in response to the QW (Query Waveform) query, consists of the following data. , where, = #0 In this, = Possible values: 144 and 0.
screen. = Number of units per y division. = Number of units per x division. = Specifies in which scale the is set by the instrument: 1 = 1-2-5 range 2 = 1-2-4 range = Specifies in which scale the is set by the instrument: 1 = 1-2-5 range 3 = record range 4 = variable range = Measurement value for the samples with value zero (0) that you can see as offset value.
One binary character which represents the sum of all the ‘s sent after the and before the . And where = #0 = which is 129. = This (4-bytes) value gives the number of bytes that are transmitted after the and before the .
Remarks: The instrument will finish any processing on the queried waveform first before sending the data to the remote device (usually: the PC). Therefore, the remote device will not have to do any polling on status bits before the query is sent. For as long as the waveform that was queried for, is still being processed, the processing will continue before making the waveform available to the external device. And so, no incomplete traces will be sent to the remote device.
Appendix G Program Example for Query Waveform ‘***************** Beginning of example program ***************** ‘ ‘ If an error occurs in the waveform data, the program stops.
END SELECT PRINT "Program aborted." END END IF RETURN ‘******* Clears pending data from the RS232 port ********* ‘ ‘ ‘ ClearPort: WHILE LOC(1) > 0 Dummy$ = INPUT$(1, #1) WEND RETURN ‘ ‘****************** Response subroutine ********************* ‘This subroutine reads bytes from the RS232 buffer as long ‘as they enter. When no bytes enter for 1 second, the program ‘assumes that the ScopeMeter has terminated its response.
Interpret.Admin: Resp.Count = 1 ‘Byte counter for Resp$ SumCheck1% = 0 ‘Sumcheck byte for Resp$ ‘ ‘***** Interpret the waveform data bytes ‘***** in the Resp$ string (see Appendix C). ‘ ‘***** 2 bytes block trailing : #0 IF MID$(Resp$, Resp.Count, 2) <> "#0" GOTO Wave.Error Resp.Count = Resp.Count + 2 ‘ ‘***** 1 byte nb = ASC(MID$(Resp$, Resp.Count, 1)) IF nb <> 128 AND nb <> 0 GOTO Wave.Error Resp.Count = Resp.Count + 1 ‘ ‘***** 2 bytes Block1.
FOR i = 0 TO 2 SumCheck1% = (SumCheck1% + ASC(MID$(Resp$,Resp.Count+i,1))) MOD 2 NEXT i nb = ASC(MID$(Resp$, Resp.Count, 1)) IF nb >= 128 THEN nb = - (256 - nb) * 256 ‘Negative value nb = nb +ASC(MID$(Resp$, Resp.Count + 1, 1)) ELSE nb = nb * 256 ‘Positive value nb = nb + ASC(MID$(Resp$, Resp.Count + 1, 1)) END IF expscale(1) = ASC(MID$(Resp$, Resp.Count + 2, 1)) YXscale#(1) = nb Resp.Count = Resp.Count + 3 ‘***** ‘* Further calculation after ‘Signed.
nb = nb * 256 ‘Positive value nb = nb + ASC(MID$(Resp$, Resp.Count + 1, 1)) END IF exponent(1) = ASC(MID$(Resp$, Resp.Count + 2, 1)) YXvalue#(1) = nb Resp.Count = Resp.Count + 3 ‘***** ‘* Further calculation after ‘Signed.Samples’ determination ‘***** ‘***** 3 bytes = ‘***** = * 256 + ‘***** = E ‘***** Example: +123E-4 = 123 / 10000 = 0.
YXvalue#(4) = nb Resp.Count = Resp.Count + 3 ‘***** ‘* Further calculation after ‘Signed.Samples’ determination ‘***** ‘***** 3 bytes = ‘***** = * 256 + ‘***** = E ‘***** Example: +123E-4 = 123 / 10000 = 0.0123 FOR i = 0 TO 2 SumCheck1% = (SumCheck1% + ASC(MID$(Resp$,Resp.Count+i,1))) MOD 2 NEXT i nb = ASC(MID$(Resp$, Resp.
Minutes$ = MID$(Resp$, Resp.Count + 2, 1) Minutes$ = Minutes$ + MID$(Resp$, Resp.Count + 3, 1) Seconds$ = MID$(Resp$, Resp.Count + 4, 1) Seconds$ = Seconds$ + MID$(Resp$, Resp.Count + 5, 1) Resp.Count = Resp.Count + 6 PRINT " = "; Hours$+":"+Minutes$+":"+Seconds$ ‘ ‘***** 1 byte Check.Sum% = ASC(MID$(Resp$, Resp.Count, 1)) IF Check.Sum% <> (SumCheck1% MOD 256) GOTO Wave.Error Resp.Count = Resp.Count + 1 PRINT " ="; Check.
END IF ELSE MinMax.Samples = 7 ‘Unknown format! END IF Sample.Bytes = Sample.Format AND 7 IF Sample.Bytes = 1 THEN ‘Single-byte samples CLimit = C128 : CMaxim = C256 ELSE ‘Double-byte samples CLimit = C32768 : CMaxim = C65536 END IF ‘ ‘ ‘ Resp.Count = Resp.Count + 1 PRINT "Signed.Samples = "; PRINT #4, "Signed.Samples = "; IF Signed.Samples = 1 THEN PRINT "TRUE "; : PRINT #4, "TRUE" ELSE PRINT "FALSE "; : PRINT #4, "FALSE" END IF PRINT "Sample.Format = "; PRINT #4, "Sample.Format = "; IF MinMax.
NEXT i END IF NEXT j ‘ ‘ Y.Zero = YXvalue#(1) X.Zero = YXvalue#(2) Y.Resol = YXvalue#(3) X.Resol = YXvalue#(4) Y.At.0 = YXvalue#(5) X.At.0 = YXvalue#(6) PRINT " ="; Y.Zero, PRINT " ="; X.Zero PRINT " ="; Y.Resol, PRINT " ="; X.Resol PRINT " ="; Y.At.0, PRINT " ="; X.At.0 ‘ ‘***** bytes value Sample.Byte = ASC(MID$(Resp$, Resp.Count, 1)) SumCheck2% = SumCheck2% + Sample.Byte IF (Signed.Samples = 1) AND (Sample.
FOR i = 2 TO Sample.Bytes Sample.Byte = ASC(MID$(Resp$, Resp.Count + i - 1, 1)) SumCheck2% = (SumCheck2% + Sample.Byte) MOD 256 Invalid& = Invalid& * 256 + Sample.Byte NEXT i IF (Signed.Samples = 0) OR (Invalid& < CLimit) THEN Invalid.Value = Invalid& * Y.Resol ‘Positive value ELSE ‘Negative value Invalid.Value = - ((CMaxim - Invalid&) * Y.Resol) END IF Resp.Count = Resp.Count + Sample.Bytes PRINT "Invalid sample value ="; Invalid&; Invalid.Value PRINT #4, "Invalid sample value ="; Invalid&; Invalid.
PRINT #4, "SumCheck2 MOD 256 ="; SumCheck2% MOD 256 ‘ ‘***** 1 byte CR C.R = ASC(MID$(Resp$, Resp.Count, 1)) IF C.R <> 13 GOTO Wave2.Error Resp.Count = Resp.Count + 1 CLOSE #4: RETURN Wave2.Error: PRINT "Waveform sample error at byte :"; Resp.Count PRINT "Waveform decimal byte value ="; ASC(MID$(Resp$,Resp.Count,1) PRINT "SumCheck so far (MOD 256) ="; SumCheck2% MOD 256 CLOSE: END ‘ Create.CSV: ‘ ‘***** ‘***** Convert the total Response string to file Wave.
PRINT #4, ‘ ‘ ‘***** Sample values x,y (time,amplitude) Time.Value = X.Zero ‘Start at x-offset MinMax.Flag = MinMax.Samples ‘Switch flag (2, 1, 0) FOR i = 1 TO Nbr.Of.Samples IF (Signed.Samples = 0) OR (Sample.Value&(i) < CLimit) THEN ‘Positive value Amplit.Value = Sample.Value&(i) * Y.Resol ELSE ‘Negative value Amplit.Value = - ((CMaxim - Sample.Value&(i)) * Y.Resol) END IF IF MinMax.Samples = 2 THEN ‘Min/Max/Ave waveform IF MinMax.Flag = 2 THEN MinMax.Flag = MinMax.Flag - 1 PRINT #4, Time.
Remote Control and Programming Reference for the FLUKE 190 family of ScopeMeter® test tools page 82