'---------------------------------------------------------------------------------------- ' Name: RESTART_PROG_ON_SER_IN.TIG ' Type: TIGER-BASIC(tm) Source Code ' Purpose: Show how to remotely restart a program by serially sending a specific command ' ' (C) - Copyright Wilke Technology, P.O.Box 1727, D-52018 Aachen, Germany '---------------------------------------------------------------------------------------- ' ' Thank you for using BASIC Tigers in your products. If you have questions, ideas ' or special needs, please contact your next distributor or the Tiger support team ' and visit our web site: ' ' Wilke Technology GmbH ' The Tiger Support Team ' P.O.Box 1727, D-52018 Aachen, Germany ' Krefelder Str. 147, D-52070 Aachen, Germany ' ' email: support@wilke-technology.com (english) ' email: support@wilke.de (german) ' Phone: +49 (241) 918 900 Mo to Fr, 7:00 to 16:00 (GMT) ' Fax: +49 (241) 918 9068 ' ' New information, new drivers and free downloads see: ' ' www.wilke-technology.com (english) ' www.wilke.de (german) ' ' Sincerely, ' ' Your Tiger Support Team ' '---------------------------------------------------------------------------------------- ' ' Sample for a remote restart of the program running in the Tiger. ' In this case, the program restarts when the character 'Z' is ' received on Ser-0. The number of characters received since last ' program start is displayed on LCD. ' '---------------------------------------------------------------------------------------- USER_VAR_STRICT ' variables must be declared #INCLUDE DEFINE_A.INC ' general symbol definitions #INCLUDE UFUNC3.INC ' symbols for USER functions LONG N, COUNT ' <- Global ! STRING A$(1) ' TASK Main ' begin task MAIN INSTALL_DEVICE #LCD, "LCD1.TDD" ' install LCD driver INSTALL_DEVICE #SER, "SER1B_K1.TDD",& ' install serial driver BD_38_400, DP_8N, JA, BD_38_400, DP_8N, JA '<-----Ser-Ch-0-----> <-----Ser-Ch-1-----> PRINT #LCD, "Program start" ' "start" message COUNT = 0 ' reset char counter WHILE 1 = 1 ' endless loop FOR N = 0 TO 0 STEP 0 ' endless loop until N=1(GET!) RELEASE_TASK ' release remaining task time GET #SER, #0, #1, 1, N ' N = chars in Ser-0 input buffer NEXT ' end of endless loop GET #SER, #0, 1, A$ ' read 1 char from serial buffer COUNT = COUNT + 1 ' increase character counter PRINT #LCD, "<2><10>Chars:"; COUNT ' print counter IF A$ = "Z" THEN ' if char = "Z" RESTART_PROG () ' restart program ENDIF ' ENDWHILE ' end of endless loop END ' end of task MAIN