Argantix KDC 80-62 Manuel d'utilisateur Page 11

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 120
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 10
Programming Manual
2.2 RS232C Interface
A suitable cable to connect the power supply to a 9 pin PC-AT style serial port is supplied with
the power supply.
The KDC Series expects a LF (Hex 10) terminator at the end of each string sent over the
RS232C interface. If the programming environment you use to develop test programs does not
append a LF terminator to each output string, the KDC Series will not respond. This may be the
case for programs like LabView™ using VISA drivers.
2.2.1 Serial Communication Test Program
The following sample program written in Quick-BASIC can be used to check communication to
the KDC Series Power supply over the RS232C serial interface. The interface is optional and
must be installed for this to work.
'Argantix RS232C Communication Demo Program
'(c) 2002 Copyright Argantix, All Rights Reserved
'
'This program is for demonstration purposes only and is not to be
'used for any commercial application
'================================================================
'Function and Subroutine Declarations
DECLARE FUNCTION retstring$ ()
'================================================================
'MAIN PROGRAM CODE
'================================================================
'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:19200,n,8,1,BIN,LF,TB2048,RB2048" FOR RANDOM AS #1 LEN = 1
CLS
PRINT "**** INTERACTIVE MODE ****"
'Enter and endless loop to accept user entered commands
DO
INPUT "Enter Command ('quit' to exit)--> ", cmd$
IF cmd$ <> "QUIT" AND cmd$ <> "quit" THEN
IF cmd$ <> "" THEN
PRINT #1, cmd$ + CHR$(10);
END IF
IF INSTR(cmd$, "?") THEN
PRINT "Power supply query response = "; retstring$
END IF
'Check for Errors after each command is issued
PRINT "Sending non-query syntax check *ESR?"
'On fast PC's we may have to hold off between commands
FOR t = 0 TO 1000: NEXT t
PRINT #1, "*ESR?" + CHR$(10);
esr% = 0 'Clear last error
'Mask off bits 5,4,3,2 only. Other bits are not used.
esr% = VAL(retstring$) AND 60
'Process esr% value for error bits
IF esr% AND 4 THEN
PRINT "*** Query Error Reported by power supply ***"
END IF
IF esr% AND 8 THEN
PRINT "*** Instrument Dependent Error Reported by power supply ***"
END IF
IF esr% AND 16 THEN
PRINT "*** Command Execution Error Reported by power supply ***"
END IF
IF esr% AND 32 THEN
PRINT "*** Command Syntax Error Reported by power supply ***"
END IF
'Clear ERR. -XXX Message from front panel if any error occurred
10 KDC Series DC Power Supplies
Vue de la page 10
1 2 ... 6 7 8 9 10 11 12 13 14 15 16 ... 119 120

Commentaires sur ces manuels

Pas de commentaire