INFICON STC-2000A Thin Film Deposition Controller Operating Manual User Manual

Page 200

Advertising
background image

p

STC-2000A DEPOSITION CONTROLLER

y

Table 6.1










Basic Driver Routine
4 Rem Sycon STC-2000A Communications Demo Routine. 6/12/1989 S. Bender
5 Rem Sycon Instruments Inc. E. Syracuse, NY 13057
6 Rem***------------------------------------------------------------
8 Rem ============ Establish Communications Parameters And Open As File #1.
10 Open "Com1:9600,N,8,1,Cs,Cd" As #1
29 Rem ============ Get Console User Input To Be Sent To STC As A Command.
30 Input "Enter Message To Send"; Msg$
34 Rem ============ Enter Stop At Prompt To Exit Program.
35 If (Msg$="Stop" Or Msg$="Stop") Then 1000
39 Rem ============ Send Message And Get Reply, Or Else Some Kind Of Error.
40 Gosub 500
50 Print Rply$
54 Rem ============ For Debug Purposes, Show Returned Reply In Hex Codes Too.
55 Print "Hex Data is {";
60 For Cnt=1 To Len(Rply$)
70 Print Using "\\" ;Hex$(Asc(Mid$(Rply$,Cnt,1)));
75 If Cnt <> Len(Rply$) Then Print ":";
80 Next Cnt
90 Print "}"
99 Rem ============ Loop Until Break Or User Exit.
100 Goto 30
101 Rem ============ ******* End Of Main Program Body ***********
102 Rem ***********************************************
103 Rem ============ **** Start Of Msg/Reply Driver Subroutine ****
499 Rem ============ Initialize Variables.
500 Outcnt=Len(Msg$):Cksum=0
509 Rem ============ Compute Outgoing Message Check Sum.
510 For Indx= 1 To Outcnt:Cksum=Cksum+Asc(Mid$(Msg$,Indx,1)):Next Indx
519 Rem ============ Send Msg To STC, ASCII Stx, Count, And Checksum.
520 Print#1,Chr$(2)+Chr$(Outcnt)+Msg$+Chr$(Cksum And 255);
529 Rem ============ Get Returned Chars From STC-200/SQ And Check For ASCII Stx.
530 Gosub 600:If Char$ <> Chr$(2) Then 520
539 Rem ============ Got ASCII STX, Next Data is Length In Binary, Get It.
540 Gosub 600:Incnt=Asc(Char$)
544 Rem ============ Init Variables For Receiving Incoming Reply.
545 Cksum=0:Rply$=""
549 Rem ============ Loop Inputting The Remote Reply Message.
550 For Indx=1 To Incnt
560 Gosub 600:Rply$=Rply$+Char$:Cksum=Cksum+Asc(Char$)
565 Next Indx
569 Rem ============ Get Final Data, The Checksum.
570 Gosub 600
579 Rem ============ Check For Valid Checksum And Data Integrity.
580 If (Asc(Char$))<>(Cksum And 255) Then Print "Bad Reply Checksum"
590 Return
591 Rem ============ ******* End Of Msg/Reply Driver Subroutine *********
592 Rem ***********************************************
593 Rem ============ ** Start Of Receive A Char From Com1 Subroutine **
600 On Timer(3) Gosub 620 : Timer On
610 If Loc(1)<1 Then 610 Else Timer Off : Char$=Input$(1,#1) : Return
620 Timer Off : Print "Receive Timeout" : Close #1 : Return 10
621 Rem ============ **** End Of Receive A Char From Com1 Subroutine **
1000 Print:Print "Program Terminated By User":Print

SECTION 6.XX

page 200 of 292

Advertising