Note the use of a semicolon as a separator between the device command and the data in the second example program line above. The semicolon suppresses the carriage return and line feed which would be sent with a comma. The carriage return and line feed sent with a comma would cause an unrecognized statement.
A
EXAMPLE 1: Programming voltage with a variable. This program ramps up output voltage in 200mV steps from 0 to 20 volts.
10 ASSIGN @Ps TO 705
20OUTPUT @Ps: “CLR: ISET 1”
30FOR Voltage=0 T0 20 STEP .2
40 | OUTPUT @Ps : “VSET” :Voltage |
50WAIT .2
60NEXT Voltage
70END
Explanation:
10:Assign I/O path name to power supply
20:Initialize, program current limit to non zero value
30,60:Increment voltage in 0.2 volt steps to 20 volts
50:Wait 200mS between steps
Voltage and Current Readback
Reading back data from the power supply requires two statements. First, a device command must be sent which tells the power supply which data to obtain and send. Then the data can be entered into a variable. For example, the output voltage can be measured and read into the variable A with the following statements:
OUTPUT @PS;”VOUT?”
ENTER @ PS;A
Output current can be measured and read into A using the statements above by substituting "IOUT?" for “VOUT?”
The voltage and current settings can be read back as shown above using the queries “VSET?” and “ISET?”.
EXAMPLE 2: This example programs up the
10ASSIGN @Ps T0 705
20COM /Ps/ @Ps
30OUTPUT @Ps:”CLR:VSET 20:ISET 2”
40 |
| WAIT 1 |
|
50 |
| OUTPUT @Ps; “VSET .1” | |
60 | Im: | IMAGE “SETTLED IN “,Z.DDD. “SECONDS” | |
70 |
| IF FNSettled (.02,5) THEN | |
80 |
| PRINT USING Im;FNElapsed_time | |
81 |
| 90 | END IF |
100END
110!