OPEN "LPT1:BIN" FOR OUTPUT AS #7 WIDTH #7, 132 PRINT #7, USING "&"; CHR$(0); PRINT #7, USING "&"; CHR$(128); CLS PRINT "REV 4-22-98 >>>>>>>>>CDFR21 TESTING PROGRAM<<<<<<<<<<<<<< 7-14-83" REM REM REM motor selection Forward/Reverse MSB--Speed--LSB REM MOTOR FORREV SPEED REM Binary Binary Binary REM 0=Motor1 0=Forward & open 0=stopped & Mech Brake (not released) REM 1=Motor2 1=Reverse & shunt 1=stopped without Mech Brake (released) REM 2=4.7% duty cycle REM 63=100% duty cycle REM REM weighting weighting weighting REM D7 D6 D5-D0 REM 0=Motor1 0=Forward & open REM 128=Motor2 64=Reverse & Shunt REM MOTOR FORREV SPEED REM REM PRINT PRINT PRINT "This program will NOT run in the WIN95 DOS window!" PRINT PRINT "Restart NEC-CAD machine in the MS-DOS mode" PRINT PRINT " Use LPT2 port on front of machine " PRINT " Negative strobe used " PRINT PRINT PRINT PRINT "Press any key to proceed, or Q to quit." ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE K$ = "" IF K$ = "Q" OR K$ = "q" THEN GOTO TESTFINEY CLS PRINT "REV 4-22-98 >>>>>>>>>CDFR21 TESTING PROGRAM<<<<<<<<<<<<<< 7-14-83" REM set both motor off PRINT #7, USING "&"; CHR$(0); PRINT #7, USING "&"; CHR$(128); PRINT PRINT PRINT "Brakes on Motors #1 & #2 should be stopped and UNbraked...." PRINT "Press any key to proceed, Q to Quit" PRINT ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE K$ = "" IF K$ = "Q" OR K$ = "q" THEN GOTO TESTFINEY PRINT PRINT "SET THE CDFR21 DIP PROGRAMMING SWITCH AS FOLLOWS:" PRINT TAB(5); , "JP1 338Hz PWM rate = OFF" PRINT TAB(5); , "JP2 ignore select = OFF" PRINT TAB(5); , "JP3 ignore select = OFF" PRINT TAB(5); , "JP4,5,6,7,8 not used = OFF" PRINT PRINT PRINT "Press any key to proceed, Q to Quit" PRINT ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE K$ = "" IF K$ = "Q" OR K$ = "q" THEN GOTO TESTFINEY START: REM stop both motors PRINT #7, USING "&"; CHR$(0); PRINT #7, USING "&"; CHR$(128); PRINT PRINT "DO YOU WISH TO TEST IN:" PRINT TAB(5); , "AUTOMATIC?" PRINT TAB(5); , "MANUAL?" PRINT TAB(5); , "EXERCISOR?" PRINT TAB(5); , "STROBES ONLY, ....MOTORS OFF" PRINT TAB(5); , "QUIT?" ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE INSTR("AMESQ", K$) = 0 IF K$ = "A" OR K$ = "a" THEN GOTO AUTOMATIC IF K$ = "M" OR K$ = "m" THEN GOTO MANUAL IF K$ = "E" OR K$ = "e" THEN GOTO EXERCISOR IF K$ = "S" OR K$ = "s" THEN GOTO STROBES IF K$ = "Q" OR K$ = "q" THEN GOTO TESTFINEY ELSE GOTO START AUTOMATIC: PRINT #7, USING "&"; CHR$(0); PRINT #7, USING "&"; CHR$(128); CLS PRINT "automatic not available" GOTO START PRINT "AUTOMATIC TESTING WILL BEGIN WITH" PRINT "ELECTRODYNAMIC BRAKES ON and MECHANICAL BRAKES ON (Not Released)" PRINT "Verify by hand and press any key to proceed or Quit." ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE K$ = "" IF K$ = "Q" OR K$ = "q" THEN GOTO TESTFINEY PRINT "ELECTRODYNAMIC BRAKES ON and MECHANICAL BRAKES OFF (Not Released)" PRINT "Verify by hand and press any key to proceed or Quit." ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE K$ = "" IF K$ = "Q" OR K$ = "q" THEN GOTO TESTFINEY PRINT "MOTOR 1 will gradually accelerate Forward" PRINT "MOTOR 1 will gradually slow from Forward" PRINT "MOTOR 1 will gradually accelerate Reverse" PRINT "MOTOR 1 will gradually slow from Reverse" PRINT "MOTOR 2 will gradually accelerate Forward" PRINT "MOTOR 2 will gradually slow from Forward" PRINT "MOTOR 2 will gradually accelerate Reverse" PRINT "MOTOR 2 will gradually slow from Reverse" PRINT "MOTORS will repeat sequence but faster, with coast" PRINT "MOTORS will repeat sequence but faster, with BRAKE" PRINT "AUTOMATIC TEST COMPLETE" GOTO START REM ***************** MANUAL: REM Set both motors off, dynamic braked, mech brake on (not released) PRINT #7, USING "&"; CHR$(0); PRINT #7, USING "&"; CHR$(128); REM Set starting parameters Motor 1, Forward, coast, stopped motor = 0 motor$ = "Motor 1, " DIRECTION = 0 DIRECTION$ = "Forward, " speed = 1 GOSUB TRANSMIT speed$ = "Coasted Stopped, Mech Brake off (released)." MANUALMORE: CLS PRINT PRINT " MANUAL SEQUENCED TESTING " PRINT PRINT PRINT "CHOOSE ONE" PRINT TAB(5); , "1 = Motor 1 select" PRINT TAB(5); , "2 = Motor 2 select" PRINT TAB(5); , "F = Forward select" PRINT TAB(5); , "R = Reverse select" PRINT TAB(5); , "I = increment speed COMMAND" PRINT TAB(5); , "D = decrement to no brake COMMAND" PRINT TAB(5); , "J = Jam FULL Speed COMMAND" PRINT TAB(5); , "C = Coast to a stop, neither brake COMMAND" PRINT TAB(5); , "E = Electro dynamic brake ONLY COMMAND" PRINT TAB(5); , "B = BOTH Brakes...Electro-dynamic & Mech COMMAND" PRINT TAB(5); , "M = Mechanical brake ONLY (valid but no practical use) COMMAND" PRINT TAB(5); , "Quit" PRINT PRINT motor$; DIRECTION$; speed$ ' Get valid key DO K$ = UCASE$(INPUT$(1)) LOOP WHILE INSTR("12FRIDJCEBMQ", K$) = 0 SELECT CASE K$ CASE "1" GOSUB SETMOTOR1 CASE "2" GOSUB SETMOTOR2 CASE "F" GOSUB SETFORWARD CASE "R" GOSUB SETREVERSE CASE "I" GOSUB UP CASE "D" GOSUB DOWN CASE "J" GOSUB JAM CASE "C" GOSUB COAST CASE "E" GOSUB ELECTROBRAKE CASE "B" GOSUB BOTHBRAKE CASE "M" GOSUB MECHBRAKE CASE "Q" GOTO START END SELECT PRINT GOTO MANUALMORE SETMOTOR1: IF motor = 0 AND motor$ = "Motor 1, " THEN GOTO setmotor1end changed = 1 motor = 0 motor$ = "Motor 1, " speed$ = "changed motor and/or direction" setmotor1end: RETURN SETMOTOR2: IF motor = 128 AND motor$ = "Motor 2, " THEN GOTO setmotor2end changed = 1 motor = 128 motor$ = "Motor 2, " speed$ = "changed motor and/or direction" setmotor2end: RETURN SETFORWARD: IF DIRECTION = 0 AND DIRECTION$ = "Forward, " THEN GOTO setforwardend changed = 1 DIRECTION = 0 DIRECTION$ = "Forward, " speed$ = "changed motor and/or direction" setforwardend: RETURN SETREVERSE: IF DIRECTION = 64 AND DIRECTION$ = "Reverse, " THEN GOTO setreverseend changed = 1 DIRECTION = 64 DIRECTION$ = "Reverse, " speed$ = "changed motor and/or direction" setreverseend: RETURN UP: IF speed <= 1 THEN LET speed = 1 IF changed = 1 THEN LET speed = 2 ELSE LET speed = speed + 1 IF speed > 63 THEN LET speed = 63 changed = 0 GOSUB TRANSMIT speed$ = STR$(speed + 1) + "/64ths" RETURN DOWN: IF changed = 1 THEN LET speed = 0 ELSE LET speed = speed - 1 IF speed < 2 THEN LET speed = 2 changed = 0 GOSUB TRANSMIT speed$ = STR$(speed + 1) + "/64ths" RETURN JAM: IF changed = 1 THEN GOTO CHANGEJAM LET speed = 63 LET speed$ = "FULL SPEED" GOSUB TRANSMIT RETURN CHANGEJAM: PRINT "Motor or Direction was changed, try again" changed = 0 GOSUB COAST FOR delayj = 1 TO 1000000 NEXT delayj RETURN COAST: REM In application commands oscillating between Coast and ElectroBrake REM Provide duty cycled controlled electro dynamic braking IF DIRECTION = 0 THEN LET speed = 1 ELSE speed = -64 + 1 speed$ = "COAST, no speed, neither brake." GOSUB TRANSMIT speed = 1 RETURN ELECTROBRAKE: REM ELECTRO DYNAMIC BRAKE only, No Mech Brake (brake released) IF DIRECTION = 64 THEN LET speed = 1 ELSE LET speed = 65 speed$ = "ELECTRO DYNAMIC BRAKE only." GOSUB TRANSMIT speed = 1 RETURN MECHBRAKE: REM MECHANICAL BRAKE only (Brake not released), NO ELECTRO DYNAMIC BRAKE REM Valid state, but not practically useful IF DIRECTION = 0 THEN LET speed = 0 ELSE LET speed = -64 speed$ = "MECH BRAKE ONLY (not released) " GOSUB TRANSMIT speed = 0 RETURN BOTHBRAKE: REM BOTH MECHANICAL and ELECTRO DYNAMIC BRAKES ON IF DIRECTION = 64 THEN LET speed = 0 ELSE LET speed = 64 speed$ = "BOTH MECH BRAKE ON (not released) & ELECTRODYNAMIC BRAKE." GOSUB TRANSMIT speed = 0 RETURN TRANSMIT: WORD = motor + DIRECTION + speed PRINT #7, USING "&"; CHR$(WORD); RETURN EXERCISOR: STROBES: PRINT " EXERCISOR, STROBES Not available" GOTO START TESTFINEY: PRINT "THIS TEST PROGRAM ENDED" END