beautypg.com

Brookfield Temperature Controller, Model 106 User Manual

Page 24

background image

Brookfield Engineering Labs., Inc.

Page 24

Manual No. M/02-207-C009

APPENDIX A - External Mode Command Protocol Demonstration

1000 ‘

1010 ‘ Programmable Temperature Controller External Mode Command

1020 ‘ Protocol Demonstration Copyright 1991, Brookfield Engineering

1030 ‘ Labs....Written by Greg Krysko

1040 ‘

1050 ‘

1060 CLS

1070 PRINT SPC(26);

“Brookfield Engineering Labs”

1080 PRINT SPC(16);

“External Mode Demonstration Program”

1090 PRINT SPC(32);

“Copyright 1991”

1100 PRINT

1110 PRINT “This program is intended to demonstrate the use of the RS-232”

1120 PRINT “command set employed by the Brookfield Engineering Labs Model”

1130 PRINT “Programmable Temperature Controllers in their External mode.”

1140 PRINT “This program and/or any of the commands used within may be freely”

1150 PRINT “used in your own applications.”

1160 PRINT

1170 PRINT “Press any key to continue...”

1180 GOSUB 1670

‘ Wait for a keypress

1190 GOSUB 1760

‘ Initialize variables

1200 OPEN “COM1:9600,N,8,1,CS,DS,CD” FOR RANDOM AS #1 ‘ Open com port #1

1210 CLS

1220 PRINT “The Controller will run a temperature ramp from 100°C to 200°C”

1230 PRINT “in 25°C increments. When the current temperature is within”

1240 PRINT “one half a degree of the setpoint, there will be a 10 minute”

1250 PRINT “delay before ramping to the next temperature to allow the”

1260 PRINT “temperature to settle. When the ramp is complete, the”

1270 PRINT “controller will be placed in the Standby mode and allow the”

1280 PRINT “Thermosel to return to ambient temperature.”

1290 PRINT

1300 PRINT “Press any key to continue...”

1310 GOSUB 1670

‘ Wait for a keypress

1320 CLS

1330 PRINT “Beginning temperature ramp...”

1340 PRINT

1350 WHILE SETPOINT <= 200

‘ Repeat until temp = 200

1360 LOCATE CURSY, 1

1370 PRINT “Temperature Setpoint #”;

1380 PRINT USING “#”; POINTNUM;

1390 PRINT “ = “;

1400 PRINT USING “###.#”; SETPOINT; ‘ Print Setpoint Temperature

1410 PRINT SPC(3);

1420 HTCMD$ = “RS” + RIGHT$(STR$(FIX(SETPOINT * 10)), 4) + “C” ‘ Form command

1430 GOSUB 1890

‘ Send command to Controller

1440 GOSUB 1970

‘ Wait for Controller to reply

1450 GOSUB 2090

‘ Parse response

1460 ‘ Send a run mode command if not already in run mode

1470 IF INRUN = 0 THEN INRUN = 1:HTCMD$ = “RA1”:GOSUB 1890:GOSUB 1970

1480 WHILE ((SETPOINT - .5) > TEMPERATURE) OR ((SETPOINT + .5) < TEMPERATURE)

1490 GOSUB 2480

1500 WEND

1510 GOSUB 2290

1520 SETPOINT = SETPOINT + 25

‘ Increment setpoint by 25

1530 CURSY = CURSY + 2

1540 POINTNUM = POINTNUM + 1