Code:
;----[handle incoming serial Terminal data]---------------------------------
Term_RX:
HSERIN [Char]
SELECT CASE Char
CASE "R","r" ' Refresh
GOSUB TerminalMenu
CASE "S","s" ' Enter Setpoint
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter SetPoint ... (340=34.0",$F8,"): "]
HSERIN [DEC SetPoints(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_SetPoint1,EE_SetPoint2, _
EE_SetPoint3,EE_SetPoint4],Bvar
WRITE Bvar, WORD SetPoints(EditChannel)
CASE "P","p"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter P term as HEX4 ... : "]
HSERIN [HEX4 pid_Kp(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_pid_Kp1,EE_pid_Kp2, _
EE_pid_Kp3,EE_pid_Kp4],Bvar
WRITE Bvar, WORD pid_Kp(EditChannel)
CASE "I","i"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter I term as HEX4 ... : "]
HSERIN [HEX4 pid_Ki(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_pid_Ki1,EE_pid_Ki2, _
EE_pid_Ki3,EE_pid_Ki4],Bvar
WRITE Bvar, WORD pid_Ki(EditChannel)
CASE "D","d"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter D term as HEX4 ... : "]
HSERIN [HEX4 pid_Kd(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_pid_Kd1,EE_pid_Kd2, _
EE_pid_Kd3,EE_pid_Kd4],Bvar
WRITE Bvar, WORD pid_Kd(EditChannel)
CASE "T","t"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter Ti term as DEC ... : "]
HSERIN [DEC pid_Ti(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_pid_Ti1,EE_pid_Ti2, _
EE_pid_Ti3,EE_pid_Ti4],Bvar
WRITE Bvar, pid_Ti(EditChannel)
CASE "C","c"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter I term Clamp as DEC ... : "]
HSERIN [DEC pid_I_Clamp(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_pid_I_Clamp1,EE_pid_I_Clamp2, _
EE_pid_I_Clamp3,EE_pid_I_Clamp4],Bvar
WRITE Bvar, WORD pid_I_Clamp(EditChannel)
CASE "O","o"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Enter Output Clamp as DEC ... : "]
HSERIN [DEC pid_Out_Clamp(EditChannel)]
GOSUB TerminalMenu
LOOKUP2 EditChannel,[EE_pid_Out_Clamp1,EE_pid_Out_Clamp2, _
EE_pid_Out_Clamp3,EE_pid_Out_Clamp4],Bvar
WRITE Bvar, WORD pid_Out_Clamp(EditChannel)
CASE "M","m"
X=1 : Y=22 : GOSUB MoveCursor
HSEROUT ["Manual Mode not available. "]
CASE "1","2","3","4" ; select channel
IF EditChannel != Char -49 THEN
GOSUB ClearBox
EditChannel = Char -49
GOSUB DrawBox
ENDIF
CASE ELSE
HSEROUT [7] ; bad key, send Bell
END SELECT
RETURN
It might not work with the version in MCS, but works fine with the version that came with windows XP - maybe google for a similar application
Bookmarks