2 - Introduction to Programming
FUNCTION gets$ | ‘ Get a new line feed terminated string from device #1 |
C$ = “” | ‘ Set C$ to null |
WHILE c$ <> CHR$ (10) | ‘ Set loop to stop at Line Feed |
C$ = INPUT$ (1, #1) | ‘ Read 1 bit into file #1 |
Resp$ = resp$ + c$ | ‘ Concantenate bit with previous bits |
WEND | ‘ End of WHILE loop |
gets$ = resp$ | ‘ Assign response to gets$ |
END FUNCTION |
|
RS-232 Troubleshooting
If you are having trouble communicating over the
♦The computer and the dc source must be configured for the same baud rate, parity, number of data bits, and flow control options. Note that the dc source is configured for 1 start bit and 1 stop bit (these values are fixed).
♦The correct interface cables or adaptors must be used, as described under
♦The interface cable must be connected to the correct serial port on your computer (COM1, COM2, etc.).
Introduction to SCPI
SCPI (Standard Commands for Programmable Instruments) is a programming language for controlling instrument functions over the GPIB. SCPI is layered on top of the
Conventions Used in This Guide
Angle brackets | < | > | Items within angle brackets are parameter abbreviations. For example, | |
|
|
|
| <NR1> indicates a specific form of numerical data. |
Vertical bar |
|
| Vertical bars separate alternative parameters. For example, NORM TEXT | |
|
|
|
| indicates that either "TEXT" or "NORM" can be used as a parameter. |
Square Brackets | [ | ] | Items within square brackets are optional. The representation [SOURce:]. | |
|
|
|
| VOLTage means that SOURce: may be omitted. |
Braces { | } |
|
| Braces indicate parameters that may be repeated zero or more times. It is |
|
|
|
| used especially for showing arrays. The notation <A>{<,B>} shows that |
|
|
|
| parameter "A" must be entered, while parameter "B" may be omitted or |
|
|
|
| may be entered one or more times. |
Boldface font |
|
|
| Boldface font is used to emphasize syntax in command definitions. |
|
|
|
| TRIGger:COUNt:CURRent <NRf> shows command definition. |
Computer font |
|
| Computer font is used to show program lines in text. | |
|
|
|
| TRIGger:COUNt:CURRent 10 shows a program line. |
12