def On_Instrumentation_StartAnimation():
"""
Syntax : On_Instrumentation_StartAnimation()
Purpose : Fired if the animation is started
Parameters : None
"""
print "----------------------------------------------------------------------------------------"
localtime = time.asctime(time.localtime(time.time()))
global start
start = time.clock()
print "The user entered Animation Mode at local time: ", localtime
print("This data has also been written to 'c:\dSPACE71\cdlog\cdlog.txt'")
threading.Timer(2, ExecuteDemo).start()
ExecuteDemo()
# Printing to the text file
file1 = open('c:\dSPACE71\cdlog\cdlog.txt', 'a')
file1.write("\n----------------------------------------------------------------------------------------")
file1.write("\nThe user entered Animation Mode at local time: ")
file1.write(localtime)
file1.close()
def ExecuteDemo()
.
.
.
Current_value = Current.Read()
localtime = time.asctime(time.localtime(time.time()))
print "The current reading at localtime:", localtime, "is", str(Current_value) + "."
# Printing to the text file
file1 = open('c:\dSPACE71\cdlog\cdlog.txt', 'a')
file1.write("\n----------------------------------------------------------------------------------------")
file1.write("\nThe current reading at localtime: ")
file1.write(localtime)
file1.write(" is: ")
file1.write(str(Current_value))
file1.close()
.
.
.
ご覧のとおり、StartAnimation関数が呼び出された後、2秒ごとにExecuteDemo()関数を繰り返そうとしています。しかし、ここでの私の問題は、ExecuteDemo()が2回しか実行されないことです。どうすれば繰り返し続けることができますか?私は何かが足りないのですか?