AMETEK BPS Series Programming Manual User Manual
Page 24

AMETEK Programmable Power
BPS / MX / RS Series SCPI Programming Manual
24
Manual P/N 7003-961 Rev AA
3.3
RS232C Interface
MX/RS/BPS power sources that have an RS232 interface but no USB interface use a
special cable to connect to a 9 pin PC serial port. The cable is marked “SOURCE” on one
end and “PC” on the other end and the orientation of the cable is important. The required
serial cable is supplied with the source. If you are unable to locate this cable, you need to
use a cable that conforms to the wiring diagram shown in Figure 3-1.
MX/RS/BPS power source that have both RS232 and USB interface use a standard straight
through DB9 to DB9 serial cable. The orientation of the cable is not important. This cable (CI
P/N 250709) is also supplied with the power source.
Note:
If a USB cable is plugged into the USB interface connector of the
power source, the RS232 interface will be disabled. Remove any USB
connection to use the RS232 port.
3.3.1
Serial Communication Test Program
The following sample program written in GW-BASIC can be used to check communication to
the MX/RS/BPS Series source over the RS232C serial interface.
'California Instruments MX Series RS232C Communication Demo Program
'(c) 1995-2002 Copyright California Instruments, All Rights Reserved
'This program is for demonstration purposes only and is not to be
'used for any commercial application
'================================================================
'OPEN COM2. Replace with COM1, COM3 or COM4 for Com port used
'The input and output buffers are set to 2K each although
'this is not required for most operations.
OPEN "COM2:9600,n,8,1,BIN,TB2048,RB2048" FOR RANDOM AS #1
CLS
PRINT "**** INTERACTIVE MODE ****"
'Enter and endless loop to accept user entered commands
DO
INPUT "Enter AC Source Command ('quit' to exit)--> ", cmd$
IF cmd$ <> "QUIT" AND cmd$ <> "quit" THEN
PRINT #1, cmd$ + CHR$(10);
IF INSTR(cmd$, "?") THEN
PRINT #1, CHR$(4);
LINE INPUT #1, response$
PRINT response$
END IF
'Check for Errors after each command is issued
PRINT #1, "*ESR?" + CHR$(10);
PRINT #1, CHR$(4);
LINE INPUT #1, esr$
esr% = VAL(esr$) AND 60
IF esr% AND 4 THEN
PRINT "*** Query Error Reported by AC Source ***"
END IF
IF esr% AND 8 THEN
PRINT "*** Instrument Dependent Error Reported by AC Source ***"
END IF
IF esr% AND 16 THEN
PRINT "*** Command Execution Error Reported by AC Source ***"
END IF
IF esr% AND 32 THEN
PRINT "*** Command Syntax Error Reported by AC Source ***"
END IF
END IF
LOOP UNTIL cmd$ = "QUIT" OR cmd$ = "quit"
'Close COM port on exit
CLOSE #1
END