| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
This file contains remote control programming information above-mentio
Top Searches for this datasheetREMOTE CONTROL PROGRAMMING REFERENCE FLUKE family ScopeMeter test tools This file contains remote control programming information above-mentioned models with PM9080 Optically Isolated RS232 Adapter/Cable. consists following chapters: INSTALLING PM9080 INTRODUCTION PROGRAMMING COMMAND REFERENCE APPENDIXES APPENDIX APPENDIX APPENDIX APPENDIX ACKNOWLEDGE DATA STATUS DATA WAVEFORM DATA ASCII CODES Page INSTALLING PM9080 Connect PM9080 RS232 port computer. necessary, 9-pin 25-pin adapter 25-pin gender changer. Hook PM9080 cable ScopeMeter. Turn computer ScopeMeter. Make sure that communication settings match RS232 port computer ScopeMeter. After power-on, default settings ScopeMeter follows: 1200 baud, parity, data bits, stop modify baud rate with (Program Communication) command. chapter COMMAND REFERENCE. Other settings fixed. modify computer RS232 port settings match above ScopeMeter settings with following command: MODE COM1:1200,N,8,1 This command assumes that COM1 RS232 port used computer. Replace COM1 above command with COM2, COM3, COM4 these ports used. place this command computer startup file AUTOEXEC.BAT that default settings computer same ScopeMeter. want higher data transfer speed (baud rate), your QBASIC program change settings both computer ScopeMeter. example under (Program Communication) command chapter COMMAND REFERENCE. Page INTRODUCTION PROGRAMMING Basic Programming Information When have installed PM9080 described previous chapter, control ScopeMeter from computer with simple communication facilities, such GWBASIC, QuickBASIC QBASIC (programming languages from Microsoft Corporation). examples given this manual QBASIC language will also QuickBASIC. QuickBASIC allows make executable files from programs start such programs directly from DOS. assumed that have knowledge these programming languages. QBASIC supplied with Microsoft MS-DOS higher Windows including 'on-line' Help. Features syntax protocol ScopeMeter follows: Easy input format with 'forgiving' syntax: commands consist characters that UPPER lower case. Parameters that sometimes follow command separated from more separation characters. Strict consistent output format: Alpha character responses always UPPERCASE. Parameters always separated comma ("," ASCII Appendix Responses always with carriage return code (ASCII 13). Because carriage return code non-visible character (not visible screen paper), this character represented <cr> command syntax. Synchronization between input output: After receipt every command, ScopeMeter returns acknowledge character (digit) followed carriage return code (ASCII 13). This indicates that command been successfully received executed. computer program must always read this acknowledge response before sending next command ScopeMeter. Page Commands sent ScopeMeter commands ScopeMeter consist header made alpha characters sometimes followed parameters. Example: This Reset Instrument command. resets ScopeMeter. Some commands followed more parameters give ScopeMeter more information. Example: This Save Setup command. saves present acquisition settings memory. header followed separator (space), then followed parameter indicate where store settings. meaning this parameter described Chapter COMMAND REFERENCE. Some commands require several parameters. Example: 9,50,30 This Write Time command. This command requires three parameters. parameters separated comma, which called Program Data Separator. only comma between parameters. Also refer section 'Data Separators'. code each command tells ScopeMeter that command ended. This carriage return code (ASCII called Program Message Terminator. This code needed indicate ScopeMeter that command completed start executing command. Also refer section 'Command Response Terminators'. Page Responses received from ScopeMeter After each command sent ScopeMeter there automatic response from indicated <acknowledge> (which MUST input), computer know whether received command been successfully executed. Refer 'Acknowledge' section below. There several commands that ScopeMeter response data. Such commands called Queries. Example: This IDentification query, which asks model number software version ScopeMeter. When ScopeMeter received query, sends <acknowledge> reply does after command, followed queried response data. format response data depends upon which query sent. When response consists different response data portions, these separated with commas (ASCII code 44). Also refer section 'Data Separators'. response data, <acknowledge> well following (queried) response data terminated with carriage return code (<cr> ASCII 13). Also refer section 'Command Response Terminators'. Page Acknowledge After receiving command, ScopeMeter automatically returns <acknowledge> response computer know whether received command been successfully executed. This response one-digit number followed <cr> response terminator. <acknowledge> indicates that ScopeMeter successfully executed command. command query, <acknowledge><cr> response immediately followed queried response data terminated with <cr>. <acknowledge> higher, indicates that ScopeMeter executed command successfully. that case, command query, <acknowledge><cr> response followed further response data. There several reasons non-zero <acknowledge> response. more information Appendix case error obtain more detailed status information using (STATUS) query. Note: MUST ALWAYS INPUT <acknowledge>, EVEN WHEN COMMAND QUERY. Page Data Separators Data Separators used between parameters sent ScopeMeter between values strings received from ScopeMeter. Comma (",") used program data separator well response data separator: Program Data Separator ASCII Value Comments Decimal -comma Single comma allowed Name Character Response Data Separator ASCII Value Comments Decimal -comma Name Character Page Command Response Terminators (Message Terminators) Command (Program Message) Terminators code needed each command tell ScopeMeter that command ended, that start executing command. This code called Program Message Terminator. code needed ScopeMeter carriage return (ASCII code decimal). Notes: carriage return code non-visible ASCII character. Therefore this code represented <cr> Command Syntax Response Syntax lines given each command. QBASIC programming language, which used program examples, automatically adds carriage return command output. QBASIC language, this PRINT statement.) After <cr> recognized ScopeMeter, entered command executed. After EACH command ScopeMeter returns <acknowledge><cr> computer signal command processing (also section 'Acknowledge'.) Response (Message) Terminators response from ScopeMeter ends with carriage return (ASCII 13). This indicated <cr> Response Syntax each command. Page Typical program sequence example typical program sequence consists following user actions: communication parameters RS232 port computer match ScopeMeter settings. Output command query ScopeMeter. Input acknowledge response from ScopeMeter. response value zero, step response value non-zero, ScopeMeter execute previous command. Read error message from following acknowledge subroutine, recover error, repeat command query. (This shown following program example.) query output ScopeMeter, input response. sequence points repeated different commands queries. Close communication channel. Refer program example next page. Page 'Example typical program sequence: '***************** Begin example program **************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM 'This QBASIC program line sets parameters 'RS232 port (COM1 Computer) match 'ScopeMeter power-on default settings. also opens 'communication channel (assigned input output 'through COM1 port. Your ScopeMeter must connected this port. "RB2048" sets size computer 'receive buffer 2048 bytes prevent buffer overflow 'during communication with ScopeMeter. PRINT "ID" 'Outputs IDENTITY command (query) ScopeMeter. GOSUB Acknowledge 'This subroutine inputs acknowledge response from 'the ScopeMeter displays error message 'acknowledge value non-zero. INPUT Response$ 'This inputs response data from IDENTITY query. PRINT Response$ 'Displays queried data. CLOSE 'This closes communication channel. 'This ends program. Page '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ***************** Page COMMAND REFERENCE CONVENTIONS Page layout used each command Header Each command description starts page with header quickly finding command. This header indicates command name two-character header used command syntax. Example: AUTO SETUP -Where AUTO SETUP descriptive name command (this syntax!), first characters used command syntax (not complete syntax). Purpose: Explains what command does what used for. Command Syntax: Shows syntax command. Parameters separated commas. Commands terminated <cr> (carriage return). Response Syntax: Shows format response from ScopeMeter. Responses terminated <cr> (carriage return). Each Response Syntax starts with <acknowledge> response, followed query response syntax relates query. Example: This example QBASIC program which shows command. example also include some other commands show relation with these commands. following comment lines (start with successively indicate beginning example program. '***************** '****************** Begin example program example program **************** ***************** Page MS-DOS Editor copy complete program between these lines file name with .BAS extension. Start QBASIC open this file from FILE menu. Long programs (longer than lines) include page breaks. Such page breaks preceded (remark) character prevent QBASIC interpreter from interpreting them incorrect statement. When have connected ScopeMeter, start program from menu. Page Syntax conventions Command Syntax Response Syntax contain following meta symbols data elements: UPPERCASE These characters part syntax. commands, lower case also allowed. expression between these brackets code, such <cr> (carriage return) that expressed printable character, parameter that further specified. insert brackets command! item between these brackets optional. This means that omit command, response appear. insert brackets command! This separator between selectable items. This means that must choose only items (exclusive or). Specifies element that repeated more instances. Grouping multiple elements. <binary_character>= <digit> <sign> <decimal_number>= <digit>{<digit>} <float> <mantissa><exponent> <mantissa> <signed_integer> <exponent> <signed_byte> <signed_integer> bytes representing signed integer value. first byte most significant contains sign (bit four <binary_character>'s <signed_long> <unsigned_integer>= bytes representing unsigned integer value. first byte most significant. <unsigned_long> four <binary_character>'s Page Overview commands ScopeMeter COMMAND PAGE COMMAND NAME HEADER NUMBER -AUTO SETUP TRIGGER CLEAR MEMORY VERSION QUERY 3.11 DEFAULT SETUP 3.13 DOWN 3.15 LOCAL 3.17 REMOTE 3.20 HOLD 3.21 IDENTIFICATION 3.23 INSTRUMENT STATUS 3.25 PROGRAM COMMUNICATION 3.28 PROGRAM SETUP 3.30 QUERY MEASUREMENT 3.34 QUERY PRINT 3.38 QUERY SETUP 3.42 QUERY WAVEFORM 3.43 READ DATE 3.59 RESET INSTRUMENT 3.61 REPLAY 3.63 RECALL SETUP 3.65 READ TIME 3.68 SWITCH 3.70 SAVE SETUP 3.71 STATUS QUERY 3.72 TRIGGER ACQUISITION 3.75 WRITE DATE 3.77 WRITE TIME 3.79 Page AUTO SETUP -Purpose: Invokes automatic setup active mode. result this command same pressing AUTO ScopeMeter. Note: select items that affected AUTO procedure USER OPTIONS ScopeMeter. Command Syntax: AS<cr> Response Syntax: <acknowledge><cr> Example: following example program sends AUTO SETUP command ScopeMeter. Connect repetitive signal INPUT effect AUTO SETUP. '***************** Page Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "AS" 'Sends AUTO SETUP command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page TRIGGER -Purpose: Resets arms trigger system acquisition. This command used single shot measurements. When command given while acquisition progress, this acquisition aborted trigger system rearmed. Command Syntax: AT<cr> Response Syntax: <acknowledge><cr> Example: following example program arms trigger system ScopeMeter with command. This means that after this command ScopeMeter starts acquisition when trigger occurs from signal (when exceeding trigger level) from (Trigger Acquisition) command. After command assumed that signal amplitude sufficient trigger acquisition. not, (TRIGGER ACQUISITION) command force acquisition triggered. this useful want acquisition started signal edge synchronization purposes. Also example program command, which also uses command single shot application. '***************** Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "AT" 'Sends TRIGGER command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE Page '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page CLEAR MEMORY -Purpose: Clears saved setups, waveforms, screens from memory. Command Syntax: CM<cr> Response Syntax: <acknowledge><cr> Example: '***************** Page 3.10 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT #1,"CM" 'Sends Clear Memory command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.11 VERSION QUERY -Purpose: Queries interface version. Command Syntax: CV<cr> Response Syntax: where, <version> ASCII string representing year this version been created. Example: '***************** Page 3.12 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT #1,"CV" 'Sends VERSION query. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT #1,VERSION$ 'Inputs queried data. PRINT "CPL Version VERSION$ 'Displays version data. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.13 DEFAULT SETUP -Purpose: Resets ScopeMeter factory settings delivery, except RS232 communication settings such baud rate, keep communication alive. Master Reset (refer Users Manual) performs same, also resets RS232 communication settings default values. Command Syntax: DS<cr> Response Syntax: <acknowledge><cr> Note: Wait least seconds after <acknowledge> reply been received, ScopeMeter settle itself before send next command. Example: '***************** Page 3.14 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "DS" 'Sends DEFAULT SETUP command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. SLEEP 'Delay necessary after "DS". PRINT "ID" 'Sends IDENTIFICATION query. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT 'Inputs identity data from ScopeMeter. PRINT 'Displays identity data. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.15 DOWN -Purpose: Switches instrument's power off. power adapter connected, command switch power again. there power adapter connected, instrument only switched manually pressing Power ON/OFF key. Command Syntax: GD<cr> Response Syntax: <acknowledge><cr> Example: '***************** Page 3.16 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "GD" 'Sends DOWN command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT "The DOWN command switched ScopeMeter off." PRINT "Press keyboard switch PRINT "the ScopeMeter again." SLEEP PRINT "SO" 'Sends SWITCH command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.17 LOCAL -Purpose: Sets ScopeMeter local operation mode keypad enabled. Also refer Remote) command. Command Syntax: GL<cr> Response Syntax: <acknowledge><cr> Example: following example uses REMOTE) command (refer description this command) ScopeMeter REMOTE state that keypad disabled. After that, LOCAL) command sent that keypad enabled again. '***************** Page 3.18 Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "GR" 'Sends REMOTE command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT "All ScopeMeter keys (except Power ON/OFF key) PRINT "are disabled REMOTE) command." PRINT "Check this." PRINT PRINT "Press keyboard continue." SLEEP PRINT PRINT "GL" 'Sends LOCAL command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT "The ScopeMeter keys enabled again PRINT LOCAL) command." PRINT "Check this." CLOSE Page 3.19 '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.20 REMOTE -Purpose: Sets ScopeMeter remote operation mode that keypad disabled. following methods return local operation mode that keypad enabled: Sending Local) command. Command Syntax: GR<cr> Response Syntax: <acknowledge><cr> example this command under LOCAL (GL). Page 3.21 HOLD -Purpose: Sets ScopeMeter Hold mode. other words, ScopeMeter stops sampling input channels calculating measurement results. Command Syntax: HO<cr> Response Syntax: <acknowledge><cr> Example: '***************** Page 3.22 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "HO" 'Sends HOLD command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT "The HOLD command ScopeMeter HOLD." PRINT "Check ScopeMeter screen." PRINT "Press keyboard continue and" PRINT "enable acquisition again." SLEEP PRINT "AT" 'Sends TRIGGER command 'enable acquisition again. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.23 IDENTIFICATION -Purpose: Returns ScopeMeter model identification information. Command Syntax: ID<cr> Response Syntax: where, <identity> ASCII string containing following data elements: <creation_date>;<languages> Example: following example program queries identity data ScopeMeter displays this data screen. '***************** Page 3.24 Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "ID" 'Sends IDENTIFICATION query. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT IDENT$ 'Inputs queried data. PRINT IDENT$ 'Displays queried data. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.25 INSTRUMENT STATUS -Purpose: Queries contents ScopeMeter's status register. returned value reflects present operational status ScopeMeter. This 16-bit word, presented integer value, where each represents Boolean value related event. Command Syntax: IS<cr> Response Syntax: <acknowledge><cr>[<status><cr>] where, <status> integer value 65535 <status> Value Status Description Maintenance mode Charging Recording AutoRanging Remote Battery Connected Power (Net) Adapter connected Calibration necessary Instrument Held (HOLD status) Calibration busy 1024 Calibration valid 2048 Replay buffer full 4096 Triggered 8192 Instrument 16384 Instrument Reset occurred 32768 Next <status> value available Example: Page 3.26 '***************** Begin example program ***************** 'Clears screen OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "IS" 'Sends INSTRUMENT STATUS query GOSUB Acknowledge 'Input acknowledge from ScopeMeter INPUT Status$ 'Input Instrument Status VAL(Status$) 'Decimal value Instrument Status PRINT "Instrument Status (StV THEN PRINT ScopeMeter Maintenance mode." (StV THEN PRINT ScopeMeter charging." (StV THEN PRINT ScopeMeter recording." (StV THEN PRINT AutoRanging active" (StV THEN PRINT ScopeMeter remote." (StV THEN PRINT Battery connected." (StV THEN PRINT Power Adapter connected." (StV 128) THEN PRINT Calibration necessary." (StV 256) THEN PRINT ScopeMeter HOLD." (StV 512) THEN PRINT Pre-calibration busy." (StV 1024) 1024 THEN PRINT Pre-calibration valid." (StV 2048) 2048 THEN PRINT Replay-buffer full." (StV 4096) 4096 THEN PRINT ScopeMeter triggered." (StV 8192) 8192 THEN PRINT ScopeMeter On." ELSE PRINT ScopeMeter Off." (StV 16384) 16384 THEN PRINT Reset Instrument occurred." Page 3.27 '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.28 PROGRAM COMMUNICATION -Purpose: Programs baud rate RS232 communication: Command Syntax: <baudrate> where, <baudrate> 1200|2400|4800|9600|19200 38400 (Fluke 19xC) 57600 (Fluke 19xC, PM9080/101 required) default baudrate 1200. This power-on after Reset Instrument command (command "RI") Notes: Fluke 19x/19xC instruments support stopbit, databits software handshake (X-on X-off protocol). Hardware handshaking supported. Page 3.29 Response Syntax: <acknowledge><cr> example this command under QUERY PRINT (QP). Page 3.30 PROGRAM SETUP -Purpose: Restores complete setup, previously saved with (Save Setup) command queried with (Query Setup) command saved string variable file. <Command <Response <Command <Response Command Syntax [<saved_setup_no>]<cr> where, <saved_setup_no> Response Syntax <acknowledge><cr> Command Syntax <queried_setup><cr> <queried_setup> data returned with command. (omit <acknowledge><cr> response). Actual setup Response Syntax <acknowledge><cr> Note: Wait least seconds after <acknowledge> reply been received, ScopeMeter settle itself before send next command. Remarks: ScopeMeter sends <acknowledge> reply after executed setup from command. must send <setup> string whole, exactly returned from (Query Setup) command. follow this rule, ScopeMeter crash. Reset then necessary recover ScopeMeter. (Refer ScopeMeter Users Manual.) Example: following example program demonstrates (QUERY SETUP) (PROGRAM SETUP) commands. present setup queried from ScopeMeter saved file. program asks change ScopeMeter settings. Then original setup read from file sent back ScopeMeter. '***************** Page 3.31 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM GOSUB ClearPort 'Clears pending data from port. PRINT "QS" 'Queries actual setup data. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. GOSUB Response 'Writes setup data file. PRINT "Present setup data stored file SETUP0" PRINT "This setup will retrieved from file and" PRINT "sent back ScopeMeter." PRINT this works, change present settings and" PRINT "verify ScopeMeter returns previous" PRINT "settings." PRINT PRINT "Press keyboard continue." SLEEP PRINT "PS" 'Program header programming 'the setup data ScopeMeter. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. OPEN "SETUP0" INPUT 'Opens file SETUP0 data retrieval. WHILE EOF(2) SUCHR$ INPUT$(1, 'Reads setup data from file PRINT SUCHR$; 'Programs ScopeMeter with the" 'setup data stored SETUP0$. LOOP PRINT CHR$(13); 'Program message terminator CLOSE 'Close file SETUP0. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. Page 3.32 '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '******* Clears pending data from RS232 port ********* ClearPort: WHILE LOC(1) Dummy$ INPUT$(1, WEND RETURN Page 3.33 '****************** Response subroutine ********************* 'This subroutine reads bytes from RS232 buffer long they enter. When bytes enter second, program 'assumes that ScopeMeter terminated response. 'All bytes that enter buffer appended string 'Resp$. Response: start! TIMER 'Wait bytes (maximum enter RS232 buffer WHILE ((TIMER (start! (LOC(1) WEND LOC(1) THEN RS232 buffer contains bytes OPEN "Setup0" OUTPUT 'File setup data LOC(1) gives number bytes waiting: ScopeInput$ INPUT$(LOC(1), 'Input bytes PRINT ScopeInput$; start! TIMER WHILE ((TIMER (start! (LOC(1) WEND LOOP WHILE LOC(1) 'Repeat long bytes enter CLOSE RETURN '****************** example program ****************** Page 3.34 QUERY MEASUREMENT -Purpose: Queries active readings (see Syntax measurement results from ScopeMeter (see Syntax Command Syntax QM<cr> Command Syntax <no>{,<no>}<cr> where TrendPlot mode, ************************** <no> where Meter mode, **************************** <no> where Scope mode, ************************** <no> <no> MEASUREMENT TYPE DESCRIPTION Measurement reading Meter absolute reading Meter relative reading (relative instrument setup reference value) Measurement reading Cursor absolute amplitude value Cursor absolute amplitude value Cursor absolute amplitude value (Maximum) Cursor absolute amplitude value (Average) Cursor absolute amplitude value (Minimum) Cursor relative amplitude value (Delta) Cursor relative time value (delta Notes: Maximum readings command. readings <no> non-valid, readings will returned. Only active (valid) readings will returned. Page 3.35 Response Syntax where, <reading> <no> Command Syntax <valid> validity reading: reading valid reading non-valid <source> source reading: Voltage channel: Input (Scope mode) Ampere channel: Input (Scope mode) Input external: V/Ohm/Diode (Meter mode) Input_AB (Phase over (Scope mode), (Mathematics A+B, AxB) Input_BA (Phase over (Scope mode) <unit> unit reading: None (off) Volt Ampere Watt Farad Kelvin seconds hours days Hertz Degrees Celsius Fahrenheit percentage dBVolt dBAmpere dBWatt Volt Ampere Reactive (VAR) Volt Ampere (VA) <type> reading characteristic measurement: None Mean True Peak peak Peak maximum Peak minimum Crest factor Period Duty cycle negative Duty cycle positive Frequency Pulse width negative <pres> <resol> Pulse width positive Phase Diode Continuity Reactive Power Apparent Power Real Power Harmonic Reactive Power Harmonic Apparent Power Harmonic Real Power Harmonic Displacement Power Factor Total Power Factor Total Harmonic Distortion Total Harmonic Distortion with respect Fundamental Factor (European definition) Factor definition) Line Frequency Vac+dc Rise time Fall time presentation value reading: Absolute value Relative value Logarithmic value Linear value Fahrenheit Celsius resolution reading <float> determine least significant digit Response Syntax where, <meas_value> Notes: Only displayed results available output. readings available Fluke 19x/19xC models/versions. Page 3.36 Example: '***************** Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "QM" 'Queries active readings GOSUB Acknowledge 'Input acknowledge from ScopeMeter. '*** Examines only inputs first reading <no> INPUT reading.no '1st <decimal_number> reading.no THEN PRINT "Measurement reading ELSEIF reading.no THEN PRINT "Measurement reading ELSE PRINT "Unknown measurement reading"; INPUT validity '2nd <decimal_number> validity THEN PRINT valid" ELSE PRINT 'not' valid" INPUT source '3rd <decimal_number> PRINT "Source reading source THEN PRINT "Voltage channel Input ELSEIF source THEN PRINT "Ampere channel Input ELSEIF source THEN PRINT "Input External" ELSE PRINT "Unknown source?" INPUT unit '4th <decimal_number> PRINT "Unit reading unit THEN PRINT "Volt" ELSEIF unit THEN PRINT "Ampere" ELSEIF unit THEN PRINT "Ohm" ELSE PRINT "Unexpected unit?" INPUT types '5th <decimal_number> PRINT "Type reading types THEN PRINT "Mean value" ELSEIF types THEN PRINT "Rms value" ELSEIF types THEN PRINT "True value" ELSE PRINT "Unexpected characteristic?" INPUT presentation '6th <decimal_number> PRINT "Presentation reading= presentation THEN PRINT "Absolute value" ELSEIF presentation THEN PRINT "Relative value" ELSEIF presentation THEN PRINT "Logarithmic value" ELSE PRINT "Unexpected value?" INPUT resolution '7th <decimal_number> PRINT "Resolution reading resolution GOSUB ClearReadings 'Clears rest readings data from port PRINT 'Queries Measurement reading 'Meter absolute reading (Meter mode). GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT result PRINT "Measurement value result; CLOSE Page 3.37 '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '******* Clears pending data from RS232 port ********* ClearReadings: WHILE LOC(1) LINE INPUT dummy$ WEND RETURN '****************** example program ****************** Page 3.38 QUERY PRINT -Purpose: Queries screen dump ScopeMeter different printer formats. This allows make copy ScopeMeter screen paper. Format ratios: width height width height Command Syntax: where, <screen_number> <output_format> Always zero Epson compatible Returns screen image (Fluke 19x) Returns screen image (Fluke 19xC) Laser Returns screen image (Fluke 19x) Desk Returns screen image (Fluke 19x) PostScript Returns screen image (Fluke 19x) format (<block_transfer> mandatory) Returns screen image (Fluke 19xC) binary format Binary format <block_transfer>= Note: Sending without arguments returns screen image Epson format (i.e., this command equivalent 0,0). Response Syntax 0,3: <printer_data> This data sent directly printer hard copy screen paper. Page 3.39 Example 0,3): following program reads ScopeMeter screen (print) data copies this data file Qpfile. This file copied printer port LPT1, example. Read Buffer length 7500 bytes prevent buffer overflow during input from ScopeMeter. communication speed (baud rate) 19200 after data transfer reset 1200 (default baud rate). '***************** Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB7500" RANDOM 'Programs COM1 port parameters 'match with ScopeMeter power-on 'defaults. PRINT 19200" 'Programs ScopeMeter maximum 'baud rate. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE OPEN "COM1:19200,N,8,1,CS,DS,RB7500" RANDOM 'Programs COM1 port parameters 'match with ScopeMeter 'settings. PRINT 0,0" 'Sends QUERY PRINT data command. '(actual screen EPSON print) GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT PRINT "Busy reading print data PRINT GOSUB Response PRINT 1200" 'Programs ScopeMeter back 'default baud rate. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT "Print data copied file 'QPFILE'." PRINT "You copy file contents EPSON Printer." PRINT "DOS-example: COPY Qpfile LPT1" CLOSE 'Close files. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT CLOSE 'Close files. PRINT "Program aborted." RETURN '****************** Response subroutine ********************* 'This subroutine reads bytes from RS232 buffer long they enter. When bytes enter second, program 'assumes that ScopeMeter terminated response. 'All bytes that enter buffer appended string 'Resp$. Response: start! TIMER 'Wait bytes (maximum enter RS232 buffer WHILE ((TIMER (start! (LOC(1) WEND LOC(1) THEN RS232 buffer contains bytes Resp$ OPEN "Qpfile" OUTPUT 'File print data LOC(1) gives number bytes waiting: ScopeInput$ INPUT$(LOC(1), 'Input bytes PRINT ScopeInput$; start! TIMER WHILE ((TIMER (start! (LOC(1) WEND LOOP WHILE LOC(1) 'Repeat long bytes enter CLOSE RETURN '****************** example program ****************** Page 3.40 Response Syntax 0,11,b 0,11,B: where, <png_data_length> <digit>{<digit>} This field indicates total number bytes <png_data>. <png_data> <segment> <segment>{<segment>} <block_data><check_sum><cr> <block_header> <binary_character> When most significant (bit set, this block (segment) last sequence. <block_length> <unsigned_integer> Specifies number <binary_character>'s that follow <block_data> field. <block_data> {<binary_character>} Part graphics (PNG) data. <binary_character> binary character which represents <binary_character>'s sent after <block_length> before <check_sum>. <check_sum> <png_data> sent blocks (segments). When <block_data> parts <segment>'s concatenated, they form PNG-format graphics file length <png_data_length> bytes. instrument prompted every block (segment): Command syntax block transfer: <segment_acknowledge><cr> where, <segment_acknowledge> Continue: Request next segment. Retransmit: Request retransmission just transferred segment. Terminate: Abort block transfer this command. format specified "PNG (Portable Network Graphics) Specification, Version 1.2", Randers-Pehrson (PNG Development Group), July 1999; This document available from www.libpng.org/pub/png/. file consists following chunks: IDHR: Header chunk describing image characteristics. PLTE: Palette chunk. first entries form color palette table, next entries form grey-scale palette table conversion Black White. Notice that index numbers IDAT chunk only refer first palette entries. retrieve grey-scale values, index numbers. tEXt: Text chunk specifying acquisition date time screen. Keyword "Creation Time", Text field format "dd-mm-yyyy,hh:mm:ss". IDAT: image data chunk. IEND: image chunk. Page 3.41 Example 0,11,b 0,11,B: following program reads screen (print) data format from Fluke 19xC instrument copies this data file SCREEN.PNG. This file viewed loading into graphics editor browser. Read Buffer length 7500 bytes prevent buffer overflow during input from ScopeMeter. communication speed (baud rate) 19200 after data transfer reset 1200 (default baud rate). '***************** Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB7500" RANDOM 'Programs COM1 port parameters 'match with ScopeMeter power-on 'defaults. PRINT 19200" 'Programs ScopeMeter maximum 'guaranteed baud rate. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE OPEN "COM1:19200,N,8,1,CS,DS,RB7500" RANDOM 'Programs COM1 port parameters 'match with ScopeMeter 'settings. PRINT 0,11,B" 'Sends QUERY PRINT data command. '(actual screen format) PRINT PRINT "Busy reading screen data GOSUB Acknowledge 'Input acknowledge from ScopeMeter. '(This take seconds) ScreenDataLength$ INPUT$(1, ScreenDataLength$ ScreenDataLength$ LOOP WHILE BytesToReceive& VAL(ScreenDataLength$) OPEN "SCREEN.PNG" OUTPUT 'File data. BlockNumber% PRINT "Reading block BlockNumber% GOSUB ReadBlock 'Read data into BlockData$ PRINT BlockData$; BlockNumber% BlockNumber% LOOP WHILE LastBlock% CLOSE BytesToReceive& THEN PRINT "Block transfer protocol error." PRINT 1200" GOSUB Acknowledge CLOSE 'Programs ScopeMeter back 'default baud rate. 'Input acknowledge from ScopeMeter. PRINT "Print data copied file 'SCREEN.PNG'." PRINT "You browser program graphics editor" PRINT view this file." '****************** ReadBlock subroutine ********************* 'This subroutine reads block data from RS232 port. 'The actual data bytes received (i.e., excluding block 'header, checksum acknowledge bytes) stored 'string BlockData$. 'LastBlock% indicates whether received block last 'one (0). ReadBlock: PRINT GOSUB Acknowledge 'Request next data block. 'Input acknowledge from ScopeMeter. 'Read block header. BlockHeader$ INPUT$(5, LEFT$(BlockHeader$, "#0" THEN PRINT "Block transfer protocol error." CLOSE 'Close files. PRINT "Program aborted." (ASC(MID$(BlockHeader$, 128) THEN LastBlock% 'This last block. ELSE LastBlock% BlockLenHigh% ASC(MID$(BlockHeader$, BlockLenLow% ASC(MID$(BlockHeader$, BlockLength& (256 BlockLenHigh%) BlockLenLow% BlockData$ INPUT$(BlockLength&, 'Read block data. CheckSum$ INPUT$(2, 'Read checksum ReceivedCheckSum% ASC(LEFT$(CheckSum$, CalculatedCheckSum% BlockLength& Byte% ASC(MID$(BlockData$, CalculatedCheckSum% CalculatedCheckSum% Byte% CalculatedCheckSum% CalculatedCheckSum% NEXT CalculatedCheckSum% ReceivedCheckSum% THEN PRINT "Checksum error" PRINT 'Terminate (abort) command. '(We could send instead request 'the block again) GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE 'Close files. PRINT "Program aborted." BytesToReceive& BytesToReceive& BlockLength& RETURN '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT CLOSE 'Close files. PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.42 QUERY SETUP -Purpose: Queries present acquisition setup data from ScopeMeter. Command Syntax: [<setup_no>]<cr> where, <saved_setup_no> Response Syntax: where, <node> [<node_data>]<check_sum> <node_header> <binary_character> Possible values: nodes except last (end node) node <node_identifier> <binary_character> Unique number each specific node. <node_length> <unsigned_integer> Specifies number <binary_character> fields that follow <node_data> field. <node_data> {<binary_character>} contents <node_data> depends <node_identifier> selected setup. <check_sum> <binary_character> Contains binary bytes <node_data> field. Note: Also Program Setup (PS) command. example this command under PROGRAM SETUP (PS). Actual setup Page 3.43 QUERY WAVEFORM -Purpose: Queries trace data (administration and/or sample data) related waveform from ScopeMeter. When waveform queried that still under processing, processing finished first half traces returned). Command Syntax: <trace_no>[,V|S] <trace_no> <decimal number> <trace_no> Trace Source: (only Fluke 19x) Scope mode: Normal trace INPUT Min/Max trace INPUT Scope Record: Min/Max trace INPUT TrendPlot Min/Max/Average trace Scope mode: Normal trace INPUT Min/Max trace INPUT Scope Record: Min/Max trace INPUT TrendPlot Min/Max/Average trace Scope mode, Mathematics (not available versions): Min/Max trace A+B, <trace_no> Trace Source: (only Fluke 19xC) Scope mode: Normal trace INPUT Min/Max trace INPUT Scope Record: Min/Max trace INPUT TrendPlot Min/Max/Average trace Scope mode: Min/Max trace INPUT ENVELOPE Scope mode: Min/Max trace INPUT REFERENCE Scope mode: Normal trace INPUT Min/Max trace INPUT Scope Record: Min/Max trace INPUT TrendPlot Min/Max/Average trace Scope mode: Min/Max trace INPUT ENVELOPE Scope mode: Min/Max trace INPUT REFERENCE Scope mode, Mathematics: Min/Max trace A+B, Trace values (samples) only Setup (administration) data only. When omitted, trace values setup data returned. Response Syntax: where, <trace_data> <trace_admin> <trace_samples> <trace_admin>,<trace_samples> optional parameter omitted: <trace_data> This includes complete information about trace (waveform). detailed descriptions about waveform structure, refer Appendix Page 3.44 option (value only) given: <trace_data> <trace_samples><cr> detailed descriptions about waveform structure, refer Appendix option (Setup data only) given: <trace_data> <trace_admin><cr> where, <trace_admin> string hexadecimal characters, representing setup related given <trace_no>. Example: '***************** Begin example program ***************** '***** error occurs waveform data, '***** program stops. C65536 65536 '2-bytes Maximum constant C32768 32768 '2-bytes Sign-bit constant C256 '1-byte Maximum constant C128 '1-byte Sign-bit constant OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM GOSUB ClearPort 'Clears pending data from port Query$ 'Queries normal trace INPUT when 'select "Display Glitches No". 'Queries min/max trace INPUT when 'select "Persistence" "Display 'Glitches Yes"; also Command Syntax. '***** normal trace series waveform samples consisting single waveform points. min/max trace series waveform samples consisting minimum maximum waveform points. min/max/average trace series waveform samples consisting minimum, maximum, average waveform points. '***** PRINT Query$ 'Response <trace_admin>,<trace_samples> GOSUB Acknowledge 'Inputs acknowledge from ScopeMeter Resp$ 'Clears total Response string GOSUB Response 'Writes waveform data Resp$ files GOSUB Interpret.Admin 'Interprets waveform administration data 'See also Appendix GOSUB Interpret.Samples 'Interprets waveform sample data GOSUB Create.CSV 'Creates Wave.CSV file from waveform data input Excel, example. Page 3.45 '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '******* Clears pending data from RS232 port ********* ClearPort: WHILE LOC(1) Dummy$ INPUT$(1, WEND RETURN Page 3.46 '****************** Response subroutine ********************* 'This subroutine reads bytes from RS232 buffer long they enter. When bytes enter second, program 'assumes that ScopeMeter terminated response. 'bytes that enter buffer appended string Resp$ 'and written following files: 'File Waveform waveform data bytes 'File Waveresp waveform ASCII values Response: start! TIMER 'Wait bytes (maximum enter RS232 buffer WHILE ((TIMER (start! (LOC(1) WEND LOC(1) THEN RS232 buffer contains bytes OPEN "WaveForm" OUTPUT 'File contain waveform data bytes docount total.count& LOC(1) gives number bytes waiting: total.count& total.count& LOC(1) ScopeInput$ INPUT$(LOC(1), 'Input bytes PRINT ScopeInput$; PRINT total.count&; Resp$ Resp$ ScopeInput$ start! TIMER WHILE ((TIMER (start! (LOC(1) WEND docount docount LOOP WHILE LOC(1) 'Repeat long bytes enter CLOSE PRINT '***** Write total Response string file WaveResp OPEN "WaveResp" OUTPUT PRINT "Response data length LEN(Resp$) PRINT "Response data length LEN(Resp$) LEN(Resp$) PRINT ASC(MID$(Resp$, 1)); NEXT CLOSE RETURN Page 3.47 Interpret.Admin: Resp.Count 'Byte counter Resp$ SumCheck1% 'Sumcheck byte Resp$ '***** Interpret <trace_admin> waveform data bytes '***** Resp$ string (see appendix '***** bytes <trace_admin> block trailing MID$(Resp$, Resp.Count, "#0" GOTO Wave.Error Resp.Count Resp.Count '***** byte <block_header> ASC(MID$(Resp$, Resp.Count, GOTO Wave.Error Resp.Count Resp.Count '***** bytes <block_length> Block1.Length ASC(MID$(Resp$, Resp.Count, Block1.Length Block1.Length ASC(MID$(Resp$, Resp.Count Resp.Count Resp.Count '***** byte <trace_result> Trace.Result ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% Trace.Result Trace.Result Trace.Result GOTO Wave.Error Resp.Count Resp.Count '***** byte <y_unit> Y.Unit ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% Y.Unit Resp.Count Resp.Count PRINT "<y_unit> Y.Unit, '***** byte <x_unit> X.Unit ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% X.Unit Resp.Count Resp.Count PRINT <x_unit> X.Unit '***** bytes <y_divisions> Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% Sample.Byte Y.Divisions Sample.Byte Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck1% SumCheck1% Sample.Byte Y.Divisions Y.Divisions Sample.Byte Resp.Count Resp.Count PRINT "<y_divisions> Y.Divisions, '***** bytes <x_divisions> Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% Sample.Byte X.Divisions Sample.Byte Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck1% SumCheck1% Sample.Byte X.Divisions X.Divisions Sample.Byte Resp.Count Resp.Count PRINT <x_divisions> X.Divisions Page 3.48 expscale(2) 'Exponents Y/X.Scale YXscale#(2) 'Values Y/X.Scale '***** bytes <y_scale> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <y_scale> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count expscale(1) ASC(MID$(Resp$, Resp.Count YXscale#(1) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <x_scale> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <x_scale> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count expscale(2) ASC(MID$(Resp$, Resp.Count YXscale#(2) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** byte <y_step> Y.Step ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% Y.Step Resp.Count Resp.Count PRINT "<y_step> Y.Step, '***** byte <x_step> X.Step ASC(MID$(Resp$, Resp.Count, SumCheck1% SumCheck1% X.Step Resp.Count Resp.Count <x_step> X.Step Page 3.49 exponent(6) 'Exponents Y/X.Zero Y/X.Resol Y/X.At.0 YXvalue#(6) 'Values Y/X.Zero Y/X.Resol Y/X.At.0 '***** bytes <y_zero> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <y_zero> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count exponent(1) ASC(MID$(Resp$, Resp.Count YXvalue#(1) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <x_zero> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <x_zero> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count exponent(2) ASC(MID$(Resp$, Resp.Count YXvalue#(2) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <y_resolution> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <y_resolution> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE Page 3.50 'Positive value ASC(MID$(Resp$, Resp.Count exponent(3) ASC(MID$(Resp$, Resp.Count YXvalue#(3) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <x_resolution> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <x_resolution> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count exponent(4) ASC(MID$(Resp$, Resp.Count YXvalue#(4) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <y_at_0> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <y_at_0> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count exponent(5) ASC(MID$(Resp$, Resp.Count YXvalue#(5) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <x_at_0> '***** <mantissa> <mantissa_high> <mantissa_low> '***** <x_at_0> <sign><mantissa> <sign><exponent> '***** Example: +123E-4 10000 0.0123 Page 3.51 SumCheck1% (SumCheck1% NEXT ASC(MID$(Resp$, Resp.Count, THEN (256 'Negative value ASC(MID$(Resp$, Resp.Count ELSE 'Positive value ASC(MID$(Resp$, Resp.Count exponent(6) ASC(MID$(Resp$, Resp.Count YXvalue#(6) Resp.Count Resp.Count '***** Further calculation after 'Signed.Samples' determination '***** '***** bytes <year><month><date> SumCheck1% (SumCheck1% NEXT Year$ MID$(Resp$, Resp.Count, Year$ Year$ MID$(Resp$, Resp.Count Year$ Year$ MID$(Resp$, Resp.Count Year$ Year$ MID$(Resp$, Resp.Count Month$ MID$(Resp$, Resp.Count Month$ Month$ MID$(Resp$, Resp.Count Day$ MID$(Resp$, Resp.Count Day$ Day$ MID$(Resp$, Resp.Count Resp.Count Resp.Count PRINT "<date_stamp> Year$ Month$ Day$; '***** bytes <hours><minutes><seconds> SumCheck1% (SumCheck1% NEXT Hours$ MID$(Resp$, Resp.Count, Hours$ Hours$ MID$(Resp$, Resp.Count Minutes$ MID$(Resp$, Resp.Count Minutes$ Minutes$ MID$(Resp$, Resp.Count Seconds$ MID$(Resp$, Resp.Count Seconds$ Seconds$ MID$(Resp$, Resp.Count Resp.Count Resp.Count PRINT <time_stamp> '***** byte <check_sum> Check.Sum% ASC(MID$(Resp$, Resp.Count, Check.Sum% (SumCheck1% 256) GOTO Wave.Error Resp.Count Resp.Count PRINT "<check_sum> Check.Sum%; PRINT "SumCheck1 SumCheck1% RETURN Wave.Error: PRINT "Waveform admin error byte Resp.Count PRINT "Waveform decimal byte value ASC(MID$(Resp$,Resp.Count,1) PRINT "SumCheck (MOD 256) CLOSE: SumCheck1% Page 3.52 Interpret.Samples: '***** Interpret <trace_samples> waveform data bytes '***** Resp$ string (see appendix '***** '***** byte separator admin/samples '***** bytes <trace_samples> block trailing SumCheck2% MID$(Resp$, Resp.Count, ",#0" GOTO Wave2.Error Resp.Count Resp.Count '***** byte <block_header> ASC(MID$(Resp$, Resp.Count, GOTO Wave2.Error Resp.Count Resp.Count '***** bytes <block_length> Block2.Length& ASC(MID$(Resp$, Resp.Count, Block2.Length& Block2.Length& Block2.Length& Block2.Length& ASC(MID$(Resp$,Resp.Count+i,1)) NEXT Resp.Count Resp.Count PRINT "Number sample chars Block2.Length& OPEN "Samples" OUTPUT PRINT "Number sample chars Block2.Length& '***** byte <sample_format> Sample.Format ASC(MID$(Resp$, Resp.Count, SumCheck2% SumCheck2% Sample.Format (Sample.Format 128) THEN Signed.Samples ELSE Signed.Samples (Sample.Format 112) THEN 'bits MinMax.Samples 'Min/Max=100 ELSEIF (Sample.Format 112) THEN MinMax.Samples 'Min/Max/Ave=110 ELSEIF (Sample.Format 112) THEN MinMax.Samples 'Normal=000 ELSEIF (Sample.Format 112) THEN MID$(Query$, THEN 'TrendPlot MinMax.Samples 'Min=Max=Ave=111 ELSE 'Average Min/Max MinMax.Samples 'Min=Max=111 ELSE MinMax.Samples 'Unknown format! Sample.Bytes Sample.Format Sample.Bytes THEN 'Single-byte samples CLimit C128 CMaxim C256 ELSE 'Double-byte samples CLimit C32768 CMaxim C65536 Page 3.53 Resp.Count Resp.Count PRINT "Signed.Samples PRINT "Signed.Samples Signed.Samples THEN PRINT "TRUE PRINT "TRUE" ELSE PRINT "FALSE PRINT "FALSE" PRINT "Sample.Format PRINT "Sample.Format MinMax.Samples THEN PRINT "Single" PRINT "Single" ELSEIF MinMax.Samples THEN PRINT "Min/Max" PRINT "Min/Max" ELSEIF MinMax.Samples THEN PRINT "Min/Max/Ave" PRINT "Min/Max/Ave" ELSE PRINT "Unknown: OCT$(Sample.Format); octal" PRINT "Unknown: OCT$(Sample.Format); octal" PRINT "Number Sample.Bytes Sample.Bytes PRINT "Number Sample.Bytes Sample.Bytes '***** Further calculation that 'Signed.Samples' determined '***** expscale(j) THEN 'Negative exponent expscale(j) expscale(j) expscale(j) YXscale#(j) YXscale#(j) NEXT ELSE 'Positive exponent expscale(j) YXscale#(j) YXscale#(j) NEXT NEXT Y.Scale YXscale#(1) X.Scale YXscale#(2) PRINT "<y_scale> Y.Scale, PRINT <x_scale> X.Scale exponent(j) THEN 'Negative exponent exponent(j) exponent(j) exponent(j) YXvalue#(j) YXvalue#(j) NEXT ELSE 'Positive exponent exponent(j) YXvalue#(j) YXvalue#(j) NEXT NEXT Page 3.54 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> Y.Zero, PRINT <x_zero> X.Zero PRINT "<y_resolution> Y.Resol, PRINT <x_resolution> X.Resol PRINT "<y_at_0> Y.At.0, PRINT <x_at_0> X.At.0 '***** <Sample.Bytes> bytes <overload> value Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck2% SumCheck2% Sample.Byte (Signed.Samples (Sample.Byte 128) THEN Sample.Byte (256 Sample.Byte) Overload& Sample.Byte Sample.Bytes Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck2% (SumCheck2% Sample.Byte) Overload& Overload& Sample.Byte NEXT (Signed.Samples (Overload& CLimit) THEN Overload.Value Overload& Y.Resol 'Positive value ELSE 'Negative value Overload.Value ((CMaxim Overload&) Y.Resol) Resp.Count Resp.Count Sample.Bytes PRINT "Overload sample value Overload&; Overload.Value PRINT "Overload sample value Overload&; Overload.Value '***** <Sample.Bytes> bytes <underload> value Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck2% SumCheck2% Sample.Byte (Signed.Samples (Sample.Byte 128) THEN Sample.Byte (256 Sample.Byte) Underload& Sample.Byte Sample.Bytes Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck2% (SumCheck2% Sample.Byte) Underload& Underload& Sample.Byte NEXT (Signed.Samples (Underload& CLimit) THEN Underload.Value Underload& Y.Resol 'Positive value ELSE 'Negative value Underload.Value ((CMaxim Underload&) Y.Resol) Resp.Count Resp.Count Sample.Bytes PRINT "Underload sample value Underload&; Underload.Value PRINT "Underload sample value Underload&; Underload.Value Page 3.55 '***** <Sample.Bytes> bytes <invalid> value Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck2% SumCheck2% Sample.Byte (Signed.Samples (Sample.Byte 128) THEN Sample.Byte (256 Sample.Byte) Invalid& Sample.Byte Sample.Bytes Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck2% (SumCheck2% Sample.Byte) Invalid& Invalid& Sample.Byte NEXT (Signed.Samples (Invalid& CLimit) THEN Invalid.Value Invalid& Y.Resol 'Positive value ELSE 'Negative value Invalid.Value ((CMaxim Invalid&) Y.Resol) Resp.Count Resp.Count Sample.Bytes PRINT "Invalid sample value Invalid&; Invalid.Value PRINT "Invalid sample value Invalid&; Invalid.Value '***** bytes <nbr_of_samples> Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck2% (SumCheck2% Sample.Byte) Nbr.Of.Samples Sample.Byte Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck2% (SumCheck2% Sample.Byte) Nbr.Of.Samples Nbr.Of.Samples Sample.Byte MinMax.Samples THEN 'Min/Max pair samples Nbr.Of.Samples Nbr.Of.Samples MinMax.Samples THEN 'Min/Max/Ave samples Nbr.Of.Samples Nbr.Of.Samples Resp.Count Resp.Count PRINT "Number samples Nbr.Of.Samples PRINT "Number samples Nbr.Of.Samples '***** <Sample.Bytes> bytes <sample_value>'s Sample.Value(Nbr.Of.Samples) LONG Nbr.Of.Samples 'Sample loop Sample.Byte ASC(MID$(Resp$, Resp.Count, SumCheck2% (SumCheck2% Sample.Byte) (Signed.Samples (Sample.Byte 128) THEN Sample.Byte (256 Sample.Byte) Sample.Value&(i) Sample.Byte Sample.Bytes THEN 'More sample bytes Sample.Bytes Sample.Byte ASC(MID$(Resp$, Resp.Count SumCheck2% (SumCheck2% Sample.Byte) Sample.Value&(i) Sample.Value&(i) Sample.Byte NEXT Resp.Count Resp.Count Sample.Bytes Page 3.56 Nbr.Of.Samples-1 Nbr.Of.Samples THEN (Signed.Samples (Sample.Value&(i) CLimit) THEN Ampl.Value Sample.Value&(i) Y.Resol 'Positive value ELSE 'Negative value Ampl.Value ((CMaxim Sample.Value&(i)) Y.Resol) PRINT "Sample"; "="; Sample.Value&(i); Ampl.Value PRINT "Sample"; "="; Sample.Value&(i); Ampl.Value NEXT '***** byte <check_sum> Check.Sum% ASC(MID$(Resp$, Resp.Count, Check.Sum% (SumCheck2% 256) GOTO Wave2.Error Resp.Count Resp.Count PRINT "<check_sum> Check.Sum%; PRINT "SumCheck2 SumCheck2% PRINT "<check_sum> Check.Sum%; PRINT "SumCheck2 SumCheck2% '***** byte ASC(MID$(Resp$, Resp.Count, GOTO Wave2.Error Resp.Count Resp.Count CLOSE RETURN Wave2.Error: PRINT "Waveform sample error byte Resp.Count PRINT "Waveform decimal byte value ASC(MID$(Resp$,Resp.Count,1) PRINT "SumCheck (MOD 256) SumCheck2% CLOSE: Page 3.57 Create.CSV: '***** '***** Convert total Response string file Wave.CSV '***** input file Excel (spreadsheet), example. '***** OPEN "Wave.CSV" OUTPUT PRINT "Title MID$(Query$, "10" THEN PRINT "Input ELSEIF MID$(Query$, "11" THEN PRINT "TrendPlot Reading Trace.Result Trace.Result THEN PRINT Trace.Result 'Acquisition trace PRINT "Type "Acquisition trace" ELSEIF Trace.Result THEN PRINT 'TrendPlot trace PRINT "Type "TrendPlot trace" PRINT "Date PRINT "Time Hours$+":"Minutes$+":"+Seconds$ '***** X.Scale time division (over divisions) PRINT Scale X.Scale PRINT X.Zero PRINT Resolution X.Resol PRINT Size Nbr.Of.Samples PRINT Unit X.Unit THEN PRINT X.Unit THEN PRINT "Hz" PRINT Label X.Unit THEN PRINT X.Scale; "s/Div" X.Unit THEN PRINT X.Scale; "Hz/Div" PRINT Scale Y.Scale PRINT Y.Zero PRINT Resolution Y.Resol PRINT Size Sample.Bytes THEN '1-byte samples PRINT 'Range Sample.Bytes THEN '2-byte samples PRINT 65536 'Range 256*256 PRINT Unit Y.Unit THEN PRINT Y.Unit THEN PRINT Y.Unit THEN PRINT "Ohm" PRINT Label Y.Unit THEN PRINT Y.Scale; "V/Div" Y.Unit THEN PRINT Y.Scale; "A/Div" Y.Unit THEN PRINT Y.Scale; "Ohm/Div" PRINT Page 3.58 '***** Sample values (time,amplitude) Time.Value X.Zero 'Start x-offset MinMax.Flag MinMax.Samples 'Switch flag Nbr.Of.Samples (Signed.Samples (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) MinMax.Samples THEN 'Min/Max/Ave waveform MinMax.Flag THEN MinMax.Flag MinMax.Flag PRINT Time.Value; ","; Amplit.Value; ","; ELSEIF MinMax.Flag THEN MinMax.Flag MinMax.Flag PRINT Amplit.Value; ","; ELSE MinMax.Flag PRINT Amplit.Value Time.Value Time.Value X.Resol MinMax.Samples THEN 'Min/Max waveform MinMax.Flag THEN MinMax.Flag PRINT Time.Value; ","; Amplit.Value; ","; ELSE MinMax.Flag PRINT Amplit.Value Time.Value Time.Value X.Resol MinMax.Samples THEN 'Single waveform PRINT Time.Value; ","; Amplit.Value Time.Value Time.Value X.Resol NEXT CLOSE RETURN '****************** example program ****************** Page 3.59 READ DATE -Purpose: Reads real time clock date settings. Command Syntax: RD<cr> Response Syntax: <acknowledge><cr>[<date><cr>] where, <date> string following format: <year>,<month>,<day> e.g. 1999,8,14 Example: following example program reads date setting from ScopeMeter. '***************** Page 3.60 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "RD" 'Sends READ DATE query. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT SMYear$, SMMonth$, SMDay$ 'Inputs date string. PRINT "Date SMYear$; "-"; SMMonth$; "-"; SMDay$ 'Displays date string. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.61 RESET INSTRUMENT -Purpose: Resets entire instrument, including interface. baud rate remains unchanged. Command Syntax: RI<cr> Response Syntax: <acknowledge><cr> Note: Wait least seconds after <acknowledge> reply been received, ScopeMeter settle itself before send next command. Example: following example resets ScopeMeter waits seconds ScopeMeter execute reset become ready next commands. ScopeMeter queried identification data; this data input displayed screen. Page 3.62 '***************** Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "RI" 'Sends RESET INSTRUMENT command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. SLEEP 'Delay necessary after reset. GOSUB ClearPort 'Clears pending data from port. PRINT "ID" 'Sends IDENTIFICATION query. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT IDENT$ 'Inputs queried data. PRINT IDENT$ 'Displays queried data. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '******* Clears pending data from RS232 port ********* ClearPort: WHILE LOC(1) Dummy$ INPUT$(1, WEND RETURN '****************** example program ****************** Page 3.63 REPLAY -Purpose: select setup Replay analysis mode select replay screen (see Syntax query total number valid replay screens (see Syntax Note: applicable Fluke families Command Syntax RP<cr> Command Syntax <screen_index><cr> where, <screen_index> Replay screen number newest (current) screen oldest screen Response Syntax where, <nr_of_screens> number valid screens valid screens index actual screen <screen_screen> Response Syntax <acknowledge><cr> result, Replay function started replay screen <screen_index> shown instrument. Notes: When <screen_index> omitted, nothing happens. Replaying screens works only SCOPE mode. Tips: commands information about replayed screen measurements. Send command return disable Replay function return normal (running). Example: Page 3.64 '***************** Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "RP" 'Queries number valid replay 'screens active screen number GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT nr.of.screens '1st <decimal_number> (nr.of.screens (nr.of.screens 100) THEN PRINT nr.of.screens; valid number replay screens" ELSE PRINT "Number valid replay screens nr.of.screens INPUT current.index '2nd <decimal_number> PRINT "Current replay screen number current.index PRINT "Previous replay screen number current.index PRINT 'Queries current replay screen PRINT current.index GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT PRINT "View previous Replay screen." PRINT "Press keyboard continue." SLEEP PRINT "AT" back normal mode (running) GOSUB Acknowledge 'Input acknowledge from ScopeMeter. CLOSE '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error; SCOPE mode selected?" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.65 RECALL SETUP -Purpose: Recalls internally stored setup. This setup must have been stored ScopeMeter manually with (Save Setup) command. effect command that instrument setup recalled instrument forced running state. Command Syntax: <setup_reg><cr> where, <setup_reg> 1001 1002 Screen/Setup memories Long Record/Replay memory Input Long Record/Replay memory Input Response Syntax: <acknowledge><cr> Note: setup active when have received <acknowledge> response from ScopeMeter. Example: following example program saves present setup setup memory requested change present settings. Then original settings recalled from setup memory made actual setting. '***************** Page 3.66 Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT 'Sends SAVE SETUP command. 'Setup saved setup memory GOSUB Acknowledge 'Input acknowledge from ScopeMeter PRINT "The present setup data stored setup memory PRINT "The remainder this program will restore these." PRINT test this works, change present settings" PRINT "and verify ScopeMeter returns original" PRINT "settings after continuing program." PRINT PRINT "Press keyboard continue." SLEEP PRINT 'Sends RECALL SETUP command. 'Setup recalled from register GOSUB Acknowledge 'Input acknowledge from ScopeMeter. PRINT PRINT "Original settings restored" CLOSE Page 3.67 '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.68 READ TIME -Purpose: Reads real time clock time settings. Command Syntax: RT<cr> Response Syntax: <acknowledge><cr>[<time><cr>] where, <time> string following format: <hours>,<minutes>,<seconds> e.g. 15,4,43 Example: following example program reads time setting from ScopeMeter. '***************** Page 3.69 Begin example program ***************** OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT #1,"RT" 'Sends READ TIME query. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. INPUT #1,SMhour$,SMmin$,SMsec$ 'Inputs time strings. PRINT "Time SMhour$;":";SMmin$;":";SMsec$ 'Displays time string. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.70 SWITCH -Purpose: Switches ScopeMeter This only works when ScopeMeter powered power adapter. Command Syntax: SO<cr> Response Syntax: <acknowledge><cr> example this command under DOWN (GD). Page 3.71 SAVE SETUP -Purpose: Saves present setup battery-backup instrument registers. Command Syntax: <setup_reg><cr> where, <setup_reg> Screen/Setup memories When <setup_reg> omitted, number assumed. Long Record/Replay memory Input Long Record/Replay memory Input 1001 1002 Response Syntax: <acknowledge><cr> example this command under RECALL SETUP (RS). Page 3.72 STATUS QUERY -Purpose: Queries error status ScopeMeter. This 16-bit word, presented integer value, where each represents Boolean value related error event. After reply after (Reset Instrument) command, value reset zero. complete description status word given Appendix Command Syntax: ST<cr> Response Syntax: <acknowledge><cr>[<status> where, <status> integer value 32767 Example: following example program sends wrong command ScopeMeter test Acknowledge subroutine check status returned from query. acknowledge subroutine contains GOSUB Status.display input status data from ScopeMeter when acknowledge response non-zero (ACK '***************** Page 3.73 Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT 12345" 'Sends baud rate value that range ScopeMeter. GOSUB Acknowledge.Status 'Input acknowledge from ScopeMeter 'and status value 'acknowledge value non-zero. '************* Acknowledge Status subroutine *********** 'This subroutine inputs acknowledge value from 'ScopeMeter. acknowledge value non-zero, 'the query used further status information from 'the ScopeMeter with respect error. case error program aborted. Acknowledge.Status: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT GOSUB Status.display 'Further specifies error. PRINT "Program aborted." RETURN '************** Page 3.74 Displays ScopeMeter status ***************** 'This subroutine gives further information 'acknowledge reply from ScopeMeter non-zero. Status.display: PRINT "ST" 'Sends STATUS query. GOSUB Acknowledge.Status 'Inputs acknowledge from ScopeMeter. INPUT STAT 'Inputs status value. PRINT "Status STR$(STAT) STAT THEN PRINT error" (STAT THEN PRINT "Illegal Command" (STAT THEN PRINT "Data format parameter wrong" (STAT THEN PRINT "Parameter range" (STAT THEN PRINT "Invalid command this interface" (STAT THEN PRINT "Command implemented" (STAT THEN PRINT "Invalid number parameters" (STAT THEN PRINT "Wrong number data bits" (STAT 512) THEN PRINT "Conflicting instrument settings" (STAT 16384) 16384 THEN PRINT "Checksum error" RETURN '****************** example program ****************** Page 3.75 TRIGGER ACQUISITION -Purpose: Triggers acquisition. This command acts hardware trigger start acquisition. SINGLE shot acquisition mode trigger system must have been armed with (Arm Trigger) command. Command Syntax: TA<cr> Response Syntax: <acknowledge><cr> Example: Page 3.76 '***************** Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT "TA" 'Sends TRIGGER ACQUISITION command. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.77 WRITE DATE -Purpose: Writes real time clock date settings. Command Syntax: <date><cr> where, <date> string following format: <year>,<month>,<date> e.g. 1999,9,14 Response Syntax: <acknowledge><cr> Example: following example program programs ScopeMeter with date setting. Page 3.78 '***************** Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT 1999,9,14" 'Sets real time clock September 1999 GOSUB Acknowledge 'Input acknowledge from ScopeMeter. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page 3.79 WRITE TIME -Purpose: Writes real time clock time settings. Command Syntax: <time><cr> where, <time> string following format: <hours>,<minutes>,<seconds> e.g. 15,30,0 Response Syntax: <acknowledge><cr> Example: following example program programs ScopeMeter with time setting. Page 3.80 '***************** Begin example program ***************** 'Clears screen. OPEN "COM1:1200,N,8,1,CS,DS,RB2048" RANDOM PRINT 15,28,0" 'Sets real time clock '03:28 p.m. GOSUB Acknowledge 'Input acknowledge from ScopeMeter. '**************** Acknowledge subroutine ****************** 'Use this subroutine after each command query sent 'ScopeMeter. This routine inputs acknowledge 'response from ScopeMeter. response non-zero, 'the previous command correct correctly 'received ScopeMeter. Then error message 'displayed program aborted. Acknowledge: INPUT 'Reads acknowledge from ScopeMeter. THEN PRINT "Error ACK; SELECT CASE CASE PRINT "Syntax Error" CASE PRINT "Execution Error" CASE PRINT "Synchronization Error" CASE PRINT "Communication Error" CASE PRINT "Unknown Acknowledge" CASE PRINT "Unknown Acknowledge" SELECT PRINT "Program aborted." RETURN '****************** example program ****************** Page APPENDIX ACKNOWLEDGE DATA -The ScopeMeter returns <acknowledge> reply after each command query. value indicates correct incorrect operation. always must read this reply check correct operation achieve synchronization between your program RS232 interface ScopeMeter. <acknowledge> VALUE MEANING Error Syntax Error (see Note) Execution Error (see Note) Synchronization Error Communication Error Note: query give additional information. When ScopeMeter detects error during execution command, sends corresponding <acknowledge> reply, terminates further execution command will ready accept command. Syntax Error Returned when command understood ScopeMeter following reasons Unknown header Wrong instructions Data format body wrong, e.g. alpha characters when decimal data needed. Execution Error Returned when internal processing possible because following reasons: Data range Conflicting instrument settings Page Synchronization Error Returned when ScopeMeter receives data while does expect data. This occur follows: ScopeMeter receives command while previous command query completely executed. prevent this error doing following: Read <acknowledge> reply after each command query. this <acknowledge> zero query sent ScopeMeter, read available response data. Communication Error framing, parity overrun error detected received data will cause Communication Error. Page APPENDIX STATUS DATA -The Status word returned from query gives extra information when have received non-zero <acknowledge> reply. Status word 16-bit binary word where each true represents error event with decimal value determined position. (See following table.) When more than true status word, response from query will decimal values individual bits. Example: <status> This equals Wrong parameter data format Invalid number parameters DECIMAL <acknowledge> VALUE EVENT DESCRIPTION VALUE Illegal command Wrong parameter data format Parameter range Command valid present state Command implemented Invalid number parameters Wrong number data bits Flash present Invalid flash software Conflicting instrument settings 1024 User Request (URQ) device dependent 2048 Flash programmable 4096 Wrong programming voltage 8192 Invalid keystring 16384 Checksum error 32768 Next <status> value available Remarks: status word when corresponding error event occurs. Bits affect each other. error events will 'accumulate' status word. This means existing bits remain set. status word cleared (all bits reset) follows: After response (the status word) from query been read. After (Reset Instrument) command. Page APPENDIX WAVEFORM DATA -The waveform data that received from (Query Waveform) query, consists following data. <trace_admin>,<trace_samples> where, <trace_admin> where, <block_header> <binary_character> Possible values: value returned when also <trace_samples> data block requested. <block_length> <unsigned_integer> This value gives number bytes that transmitted after <block_length> before <check_sum>. <trace_result> <binary_character> (decimal value trace direct result trace acquisition. (decimal value trace result TrendPlot function (recording numerical results). (decimal value either trace itself envelope trace, envelope trace available. (decimal value either trace itself reference trace, reference trace available. (decimal value either trace itself mathematics trace, mathematics trace available. Note: This <trace_result> information available instrument types/versions. <y_unit> <x_unit> <unit> <unit> <unit> <binary_character> which value represents unit: None <Volt> <Ampere> <Ohm> <Watt> <Farad> <Kelvin> <seconds> <hours> <days> <Hertz> <Degree> <degree_Celsius> <degree_Fahrenheit> <percentage> <dBm Ohm> <dBm Ohm> Volts> Ampere> Watts> <Volt Ampere Reactive> VAR, <Volt Ampere> Page <y_divisions> <unsigned_integer> Number divisions which waveform displayed instrument screen. <unsigned_integer> Number divisions which waveform displayed instrument screen. <float> Number units division. <float> Number units division. <binary_character> Specifies which scale <y_scale> instrument: 1-2-5 range 1-2-4 range <binary_character> Specifies which scale <x_scale> instrument: 1-2-5 range record range variable range <float> Measurement value samples with value zero that offset value. <float> This field specifies x-offset first sample <trace_samples>. time between trigger moment first sample.) <x_divisions> <y_scale> <x_scale> <y_step> <x_step> <y_zero> <x_zero> <y_resolution> <float> This field contains value that represents step between consecutive sample values other words step least significant bit. <x_resolution> <float> This field contains value (seconds) that represents distance between samples. time between samples.) case FFT-trace, this value frequency fundamental (Hz). Page <y_at_0> <float> This field contains value corresponding with lowest horizontal grid line. <float> This field contains value corresponding with most left vertical grid line. Value (not used). <year><month><day> <digit><digit><digit><digit> <digit><digit> <digit><digit> <hours><minutes><seconds> <digit><digit> <digit><digit> <digit><digit> <binary_character> binary character which represents <binary_character>'s sent after <block_length> before <check_sum>. <x_at_0> <date_stamp> <year> <month>= <day> <time_stamp> <hours>= <minutes>= <seconds>= <check_sum> where <trace_samples>= <samples><check_sum><cr> <block_header>= <block_length>= <binary_character> which 129. <unsigned_long> This (4-bytes) value gives number bytes that transmitted after <block_length> before <check_sum>. <sample_format>= <binary_character> This byte specifies format samples. highest defines whether samples should interpreted signed unsigned values (0). numbers <sample_format> define sample combination (bits 654): normal trace samples Min/Max trace samples Min/Max/Average trace samples Min=Max trace samples Min=Max=Average trace samples [Average Display Glitches <nbr_of_samples> specifies number sample pairs this case. bits <sample_format> define number <binary_character>'s which sample value represented. <overload> <sample_value> This field specifies which value trace samples represents overload value. Page <underload> <sample_value> This field specifies which value trace samples represents underload value. <sample_value> This field specifies which value trace samples represents invalid sample. Invalid samples present locations trace that have been filled (yet). This e.g. occur random sampling. <invalid> Total number samples, Min/Max sample pairs, Min/Average/Max sample triplets that follow. <samples> {<sample_value>} total <nbr_of_samples> will transmitted. {<binary_character>} Depending number <binary_character>'s <sample_format>, each <sample_vale> transmitted number <binary_character>'s. case, <sample_value> contains multiple <binary_character>'s, most significant byte transmitted first. <binary_character> binary character which represents <binary_character>'s sent after <block_length> before <check_sum>. <sample_value>= <check_sum> Remarks: instrument will finish processing queried waveform first before sending data remote device. This means that remote device will have polling status bits before query sent. When waveform that queried for, still under processing, processing finished first. "half traces" will returned. When waveform under processing roll mode, query will give execution error. remote device possibility cancel query, when waiting response takes long. This achieved sending <esc> hardware break. Page APPENDIX ASCII CODES Hexadecimal value ASCII character Decimal value Page Hexadecimal value ASCII character Decimal value Other recent searchesTMP86P203PG - TMP86P203PG TMP86P203PG Datasheet TC51WHM716AXBN70 - TC51WHM716AXBN70 TC51WHM716AXBN70 Datasheet TC51WKM716AXBN75 - TC51WKM716AXBN75 TC51WKM716AXBN75 Datasheet SD0403 - SD0403 SD0403 Datasheet EDZ20B - EDZ20B EDZ20B Datasheet CTTF0201F - CTTF0201F CTTF0201F Datasheet BSO200P03S - BSO200P03S BSO200P03S Datasheet AT-28C040 - AT-28C040 AT-28C040 Datasheet AE312 - AE312 AE312 Datasheet 2SJ209 - 2SJ209 2SJ209 Datasheet
Privacy Policy | Disclaimer |