Rs-232 Flow Control; Rs-232 Programming Example - Keysight Technologies 66332A Programming Manual

Table of Contents

Advertisement

Baud Rate
The front panel Address key lets you select one of the following baud rates, which is stored in non-volatile
memory:
300
600
1200

RS-232 Flow Control

The RS-232 interface supports several flow control options that are selected using the front panel Address
key. For each case, the dc source will send a maximum of five characters after holdoff is asserted by the
controller. The dc source is capable of receiving as many as fifteen additional characters after it asserts
holdoff.
XON-XOFF
A software handshake that uses the ASCII control code DC3 (decimal code
19) to assert hold-off, and control code DC1 (decimal code 17) to release
hold-off.
RTS-CTS
The dc source asserts its Request to Send (RTS) line to signal hold-off
when its input buffer is almost full, and it interprets its Clear to Send (CTS)
line as a hold-off signal from the controller.
DTR-DSR
The dc source asserts its Data Terminal Ready (DTR) line to signal hold-off
when its input buffer is almost full, and it interprets its Data Set Ready
(DSR) line as a hold-off signal from the controller.
NONE
There is no flow control.
Flow control options are stored in non-volatile memory.

RS-232 Programming Example

The following program illustrates how to program the power supply using RS-232 to set the output voltage
and current and to readback the model number and output voltage. The program was written to run on any
controller using Microsoft QBasic.
NOTE:
The power supply must be configured for RS232 and the same baud rate and parity as
the controller.
' Program to write and read via RS232.
' Configure the power supply for 9600 baud, even parity and RS232
' Configure serial port for:"
'
9600 baud
'
7 bit data
'
2 stop bits
'
Ignore request to send
'
Ignore carrier detect
'
Even parity
'
Send line feed
'
Reserve 1000 character buffer for serial I/O
'
DECLARE FUNCTION gets$ ()
CLS
LOCATE 1, 1
' Configure Com Port
OPEN "com1:9600,e,7,2,rs,cd,pe,lf" FOR RANDOM AS #1 LEN = 1000
PRINT #1, "OUTPUT ON"
PRINT #1, "VOLT 6"
PRINT #1, "CURR .5"
PRINT #1, "*IDN?"
PRINT gets$
PRINT #1, MEAS"VOLT?"; volt
Volt = VAL (gets$)
PRINT gets$
END
2400
4800
9600
' Needed with Vectra basic, ignored with QBasic
' Clears screen
' Position curser at top left
' Turn on output then set voltage and current
' Set voltage to 6 volts
' Set current to 0.5 amps
' Query the power supply identification string
' Go to gets$ Function and print data returned
' Query the power supply voltage
' Convert gets$ string to a value
' Print the value of the voltage
' End of main program
Introduction to Programming - 2
11

Advertisement

Table of Contents
loading

This manual is also suitable for:

66312a6631b6632b6633b6634b6611c ... Show all

Table of Contents